hass配置文档:https://www.home-assistant.io/integrations/
注意:docker如果使用host桥接op物理网络,homekit的mDNS发射不出来
所以这里使用默认的bardge网络
下载安装docker镜像
拉取镜像:
docker pull homeassistant/home-assistant:latest
创建实例容器.
docker run -d –name=”hass” -v /etc/config/docker/hass:/config -p 8123:8123 homeassistant/home-assistant
修改avahi-daemon配置,使mDNS跨网段
修改/etc/avahi/avahi-daemon.conf (注意下面的中文注释,删掉或设utf8)
[server] #host-name=foo #domain-name=local use-ipv4=yes use-ipv6=yes check-response-ttl=no use-iff-running=no #添加这行 allow-interfaces=br-lan,docker0,ipsec0 [publish] publish-addresses=yes publish-hinfo=yes publish-workstation=no publish-domain=yes #publish-dns-servers=192.168.1.1 #publish-resolv-conf-dns-servers=yes [reflector] #no修改为yes enable-reflector=yes reflect-ipv=no [rlimits] #rlimit-as= rlimit-core=0 rlimit-data=4194304 rlimit-fsize=0 rlimit-nofile=30 rlimit-stack=4194304 rlimit-nproc=3
重启avahi-daemon服务
防火墙配置图
HASS的蓝牙代理 在线烧录:
https://esphome.io/projects/?type=bluetooth
如果esp32不断重启,需按住RST键让他发现设备, 在开始烧录时松开RST
如果仍然不行则用上述方法使用乐鑫官方在线工具连接成功后再断开,再去烧录蓝牙代理
乐鑫官方的在线烧录:
https://espressif.github.io/esptool-js/
nginx反向代理hass
server { listen 80; listen 443 ssl; server_name hass.local; ssl_certificate /etc/config/crt/eATM.crt; ssl_certificate_key /etc/config/crt/eATM.key; ssl_session_cache shared:SSL:32k; ssl_session_timeout 64m; location / { proxy_pass http://172.17.0.2:8123; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection $http_connection; proxy_set_header Host $http_host; } }
2