我的上一篇文章【在嵌入式x86上构建我的智能家居(home assistant)】中本来希望在一个低功耗的x86嵌入式上安装home assistant,但是因为一些限制没有成功。
找到一个低功耗的笔记本(东芝的dynabook SS RX2,cpu:U9400 1.4G ram:2G SSD:128G),拆了光驱,简单测试大概10W功耗,比之前的高好多,但也还不错了。就用他了,安装home assistant。
第一步安装debian11. 我使用的是网络版镜像文件debian-11.3.0-amd64-netinst.iso,安装时使用的中文并多选择了ssh server,这样安装完成后就可以直接ssh登录了。
使用debian11是为了安装home assistant Supervised版。根据官网需求列表中说明,安装此版本需要debian11.
参考:
Linux - Home AssistantInstall Home Assistant on a Linuxhttps://www.home-assistant.io/installation/linux
architecture/0014-home-assistant-supervised.md at master · home-assistant/architecture · GitHubRepo to discuss Home Assistant architecture. Contribute to home-assistant/architecture development by creating an account on GitHub.https://github.com/home-assistant/architecture/blob/master/adr/0014-home-assistant-supervised.md
GitHub - home-assistant/supervised-installer: Installer for a generic Linux systemInstaller for a generic Linux system. Contribute to home-assistant/supervised-installer development by creating an account on GitHub.https://github.com/home-assistant/supervised-installer
系统安装完成后,不需要x环境,而且可以节省资源。变更登录环境
su -
systemctl set-default multi-user.target
sudo update-alternatives --install /usr/bin/python python /usr/bin/python3.9 1
根据安装指导,进入root用户(su - 或 sudo -s)
1.安装需要的依赖命令(从官网网页上直接复制的命令在putty中粘贴好像有问题。)
apt-get install jq wget curl udisks2 libglib2.0-bin network-manager dbus -y
jq: json解释器
udisk2 :u盘自动装载,重命名 库。
2.安装docker curl -fsSL get.docker.com | sh
3.安装OS-Agent
Using Home Assistant Supervised on Debian
Download the latest Debian package from OS Agent GitHub release page at:
https://github.com/home-assistant/os-agent/releases/latest
打开以上网址,查找最新的deb包,下载
wget https://github.com/home-assistant/os-agent/releases/download/1.2.2/os-agent_1.2.2_linux_x86_64.deb
Next, install (or update) the downloaded Debian package using:
sudo dpkg -i os-agent_1.2.2_linux_x86_64.deb
Note: Replace the deb
file in the above example with the file you have downloaded from the releases page.
You can test if the installation was successful by running:
gdbus introspect --system --dest io.hass.os --object-path /io/hass/os
This should not return an error. If you get an object introspection with interface
etc. OS Agent is working as expected.
You might need to install libglib2.0-bin
to get the gdbus
command.
To remove OS Agent from your system use the Debian packaging system:
sudo dpkg -r os-agent
4.安装Home Assisistant Supervised Debian 包
wget https://github.com/home-assistant/supervised-installer/releases/latest/download/homeassistant-supervised.deb
或者
wget https://github.com/home-assistant/supervised-installer/releases/download/1.2.0/homeassistant-supervised.deb
dpkg -i homeassistant-supervised.deb
执行完成后,home assistant Supervised安装完成。
安装并启动后,就可以继续。
查ha 是否运行 ss -anopt|grep 8123
浏览器访问http://机器ip:8123 提示以下内容(8123是默认端口),意思是请等待准备中
使用ps查看有很多后台git相关进程。
。。。。。 20分钟后
网页显示如下
按照页面要求填写相关资料(填写资料输入法会飞,可以使用复制粘贴方法),
然后next。
到这个页面的时候完成。
安装完成。
--------------
如果有新版本的话,会在配置项的最上面出现提示。