Installation Home Assistant on Docker

docker 是个好东西,想着Raspbian 是基于 Debian的系统,那定然是支持 docker的。

而有了docker,再raspberry pi上安装 Home Assistant就有了一种极其简单的方法。

1. 在Raspberry Pi 上安装docker

curl -sSL https://get.docker.com | sh

参考:https://www.raspberrypi.org/blog/docker-comes-to-raspberry-pi/

2. 验证docker的安装是否正确

1pi@raspberrypi:~ $ sudo docker --version 2Docker version 18.06.0-ce, build 0ffa825 3 4pi@raspberrypi:~ $ sudo docker info 5Containers: 3 6 Running: 2 7 Paused: 0 8 Stopped: 1 9Images: 2 10Server Version: 18.06.0-ce 11Storage Driver: overlay2 12 Backing Filesystem: extfs 13 Supports d_type: true 14 Native Overlay Diff: true 15Logging Driver: json-file 16Cgroup Driver: cgroupfs 17Plugins: 18 Volume: local 19 Network: bridge host macvlan null overlay 20 Log: awslogs fluentd gcplogs gelf journald json-file logentries splunk syslog 21Swarm: inactive 22Runtimes: runc 23Default Runtime: runc 24Init Binary: docker-init...

参考:https://docs.docker.com/get-started/#prepare-your-docker-environment

3. 在Raspberry Pi上基于Docker安装 Home Assistant

1$ docker run -d --name="home-assistant" -v /path/to/your/config:/config -v /etc/localtime:/etc/localtime:ro --net=host homeassistant/raspberrypi3-homeassistant:0.XX.x 2 3注意: 41. /path/to/your/config 指的是你本地的HA配置目录,用来在本地存放你要运行的 HA 配置,比如 configuration.yaml 等配置文件 5 62. :/config 这里的config指的是你 docker 镜像中HA的配置目录,如果/path/to/your/config 这个目录在本地存在,则HA启动时会读取本地的配置,入伏哦/path/to/your/config 在本地不存在,则读取docker镜像中HA的配置目录 7 83. 0.XX.x 指的是要指定的HA版本,比如0.72.0,具体版本可以到HA官网查询 https://www.home-assistant.io/

实际在本机安装案例:

mkdir /home/pi/workplace/config -psudo docker run -d --name="home-assistant" -v /home/pi/workplace/config:/config -v /etc/localtime:/etc/localtime:ro --net=host homeassistant/raspberrypi3-homeassistant:0.72.0

安装成功后验证

1pi@raspberrypi:~ $ sudo docker image ls 2REPOSITORY TAG IMAGE ID CREATED SIZE 3homeassistant/raspberrypi3-homeassistant 0.72.0 df8da8840c1d 8 weeks ago 1.06GB

4. 在Raspberry Pi 上启动Docker中的 

1homeassistant/raspberrypi3-homeassistant, 注意要指定版本0.72.0,不然docker会提示本地不存在,然后又重新去docker hup去下载 2 3pi@raspberrypi:~ $ sudo docker run -v /home/pi/workplace/config:/config homeassistant/raspberrypi3-homeassistant:0.72.0 4starting version 3.2.4 52018-08-18 07:33:44 INFO (MainThread) [homeassistant.core] Bus:Handling <Event service_registered[L]: domain=homeassistant, service=turn_off> 62018-08-18 07:33:44 INFO (MainThread) [homeassistant.core] Bus:Handling <Event service_registered[L]: domain=homeassistant, service=turn_on> 72018-08-18 07:33:44 INFO (MainThread) [homeassistant.core] Bus:Handling <Event service_registered[L]: domain=homeassistant, service=toggle> 82018-08-18 07:33:44 INFO (MainThread) [homeassistant.core] Bus:Handling <Event service_registered[L]: domain=homeassistant, service=stop> 92018-08-18 07:33:44 INFO (MainThread) [homeassistant.core] Bus:Handling <Event service_registered[L]: domain=homeassistant, service=restart> 102018-08-18 07:33:44 INFO (MainThread) [homeassistant.core] Bus:Handling <Event service_registered[L]: domain=homeassistant, service=check_config> 112018-08-18 07:33:44 INFO (MainThread) [homeassistant.core] Bus:Handling <Event service_registered[L]: domain=homeassistant, service=reload_core_config> 122018-08-18 07:33:44 INFO (MainThread) [homeassistant.bootstrap] Home Assistant core initialized 132018-08-18 07:33:45 INFO (MainThread) [homeassistant.loader] Loaded frontend from homeassistant.components.frontend 142018-08-18 07:33:46 INFO (MainThread) [homeassistant.loader] Loaded api from homeassistant.components.api2018-08-18 07:33:46 INFO (MainThread) [homeassistant.loader] Loaded introduction from homeassistant.components.introduction 152018-08-18 07:33:46 INFO (MainThread) [homeassistant.setup] Setting up introduction 162018-08-18 07:33:46 INFO (MainThread) [homeassistant.components.introduction] 17 18 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 19 20 Hello, and welcome to Home Assistant! 21 22 We'll hope that we can make all your dreams come true. 23 24 Here are some resources to get started: 25 26 - Configuring Home Assistant: 27 https://home-assistant.io/getting-started/configuration/ 28 29 - Available components: 30 https://home-assistant.io/components/ 31 32 - Troubleshooting your configuration: 33 https://home-assistant.io/getting-started/troubleshooting-configuration/ 34 35 - Getting help: 36 https://home-assistant.io/help/ 37 38 This message is generated by the introduction component. You can 39 disable it in configuration.yaml. 40 41 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

5. 登陆HAweb查看

http://192.168.1.x:8123

注意: 该ip是装docker的宿主ip,也就是你的本机ip

6. 修改配置文件,定制你喜欢的智能家居系统

1pi@raspberrypi:~/workplace/config $ ls /home/pi/workplace/config 2automations.yaml configuration.yaml customize.yaml deps groups.yaml home-assistant_v2.db scripts.yaml secrets.yaml tts
点赞
收藏

评论区

加载中...

相关推荐

MySQL:[Err] 1292 - Incorrect datetime value: ‘0000-00-00 00:00:00‘ for column ‘CREATE_TIME‘ at row 1

文章目录问题用navicat导入数据时,报错:原因这是因为当前的MySQL不支持datetime为0的情况。解决修改sql\mode:sql\mode:SQLMode定义了MySQL应支持的SQL语法、数据校验等,这样可以更容易地在不同的环境中使用MySQL。全局s

Oracle 分组与拼接字符串同时使用

SELECTT.,ROWNUMIDFROM(SELECTT.EMPLID,T.NAME,T.BU,T.REALDEPART,T.FORMATDATE,SUM(T.S0)S0,MAX(UPDATETIME)CREATETIME,LISTAGG(TOCHAR(

MySQL部分从库上面因为大量的临时表tmp_table造成慢查询

背景描述Time:20190124T00:08:14.70572408:00User@Host:@Id:Schema:sentrymetaLast_errno:0Killed:0Query_time:0.315758Lock_

手写Java HashMap源码

HashMap的使用教程HashMap的使用教程HashMap的使用教程HashMap的使用教程HashMap的使用教程22

2020年前端实用代码段,为你的工作保驾护航

有空的时候,自己总结了几个代码段,在开发中也经常使用,谢谢。1、使用解构获取json数据let jsonData  id: 1,status: "OK",data: 'a', 'b';let  id, status, data: number   jsonData;console.log(id, status, number )

KVM调整cpu和内存

一.修改kvm虚拟机的配置1、virsheditcentos7找到“memory”和“vcpu”标签,将<namecentos7</name<uuid2220a6d1a36a4fbb8523e078b3dfe795</uuid

Installation Home Assistant on Docker - HelloWorld