NAS HomeAssistant

NAS HomeAssistant

部署 HomeAssistant

安装 Docker 套件

下载HomeAssistant 镜像

  • 打开 Docker - 注册表 - 搜索 HomeAssistant - 选中 Start 最多的项目 - 点击下载 - 选择 Latest 标签

启动 HomeAssistant 容器

  • 切换到 Docker - 映像 ,等待镜像下载并解压,解压后约 1GB 大小,点击启动该镜像
  • 容器初始化配置
    • 修改容器名称为 homeassistant
    • 高级设置
      • 高级设置 - 启用开机启动
      • 存储空间 - 创建docker/homeassistant/config本地目录装载到容器中作为/config配置存放路径
      • 网络 - 勾选使用 Docker Host 相同的网络
      • 环境 - 新增 TZ : Asia/Shanghai
  • 点击 应用启动容器
  • 输入 http://IP:8123进入 HomeAssistant Web 页面

初始化 HomeAssistant

创建 HomeAssistant 用户

配置 HomeAssistant 家庭名称

后续使用默认设置 下一步直到完成

安装 HACS

使用 SSH 连接 NAS

ssh root@nas -p 22 # 登录NAS
docker exec -it homeassistant bash # 进入容器
wget -O - https://get.hacs.xyz | bash - # 安装HACS 最新指令见 https://github.com/hacs/get

执行wget -O - https://get.hacs.xyz | bash如果报错如下

bash-5.1# wget -O - https://get.hacs.xyz
Connecting to get.hacs.xyz ([2606:4700:3036::6815:502]:80)
Connecting to get.hacs.xyz ([2606:4700:3036::6815:502]:443)
Connecting to raw.githubusercontent.com (0.0.0.0:443)
140201083824968:error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed:ssl/statem/statem_clnt.c:1919:
ssl_client: SSL_connect
wget: error getting response: Connection reset by peer

那么执行指令

cat >> /etc/hosts << EOF
185.199.109.133 raw.githubusercontent.com 
EOF
sudo nscd restart
# 若此处IP失效可通过以下两种方式更新
# 1. 在 https://www.ipaddress.com 里搜索 raw.githubusercontent.com 的IP
# 2. 在 https://github.com/maxiaof/github-hosts 页面中搜索 raw.githubusercontent.com 的IP

执行wget -O - https://get.hacs.xyz | bash成功安装日志如下

Connecting to get.hacs.xyz ([2606:4700:3033::ac43:84ae]:443)
Connecting to raw.githubusercontent.com (185.199.109.133:443)
writing to stdout
-                    100% |****************************************************************************************************************************************************************************************************************************************|  2742  0:00:00 ETA
written to stdout
INFO: Trying to find the correct directory...
INFO: Found Home Assistant configuration directory at '/config'
INFO: Creating custom_components directory...
INFO: Changing to the custom_components directory...
INFO: Downloading HACS
Connecting to github.com (140.82.121.4:443)
Connecting to github.com (140.82.121.4:443)
Connecting to objects.githubusercontent.com (185.199.109.133:443)
saving to 'hacs.zip'
hacs.zip             100% |****************************************************************************************************************************************************************************************************************************************| 1970k  0:00:00 ETA
'hacs.zip' saved
INFO: Creating HACS directory...
INFO: Unpacking HACS...
INFO: Removing HACS zip file...
INFO: Installation complete.

INFO: Remember to restart Home Assistant before you configure it

安装完成后重启 HomeAssistant 配置 - 系统 - 点击右上角重新启动

重启后进入 HomeAssistant 配置 - 设备与服务 - 集成 - 点击右下角添加集成

搜索框输入 HACS并确认,等待不到一分钟,会弹出用户协议同意窗口,同意所有协议后提交

提交后会弹出一个关联 Github 的窗口,复制窗口下方的授权码并点击窗口中的 Github 链接

在跳转页中填入授权码,并确认授权关联,最后点击完成

接入米家设备

首页 - HACS - 集成 - 右下角浏览并下载存储库 - 搜索并下载 Xiaomi MIoT - 下载完成后重启 HomeAssistant

重启后 首页 - 配置 - 集成 - 右下角添加集成 - 搜索 Xiaomi MIoT,如果搜索不到,尝试重启 Docker或手动安装

选择 登录小米账号 - 输入账号密码进行登录 - 登录成功后在设备列表中选择要添加的设备并提交

连接HomeKit

首页 - 配置 - 集成 - 右下角添加集成 - 搜索 homekit - 使用默认设备列表并提交

首页 - 通知 - 使用Apple 设备扫描通知中的二维码 将 Home Bridge 绑定到家庭

在 Apple 设备上完成每个设备的分配


利用群晖NAS搭建homeassistant,把米家设备免费接入苹果智能家居HomeKit家庭APP中

Home Assistant 安装 HACS

HACS download script

Docker Homeassistant安装HACS遇到的问题

通过修改Hosts解决国内Github经常抽风访问不到

解决raw.githubusercontent.com无法访问的问题

  • 0
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值