[## Homeassistant简介
Home Assistant 使用 Python3 开发的,是一个完整的 UI 管理的家庭自动化生态系统,它运行 Home Assistant Core、Home Assistant Supervisor 和附加组件。它预装在 Home Assistant OS 上,当然也可以安装在任何 Linux 系统上。它利用由 Home Assistant Supervisor 管理的 Docker,以及在 Home Assistant 环境中本地运行的数十个附加组件。
官网:
https://www.home-assistant.io...
移植步骤
使用更新命令,发现出现以下错误:

网上查找是许可证过期,安装 debian-ports-archive-keyring。
下载命令:
wget http://ftp.cn.debian.org/debian/pool/main/d/debian-ports-archive-keyring/debian-ports-archive-keyring_2023.02.01_all.deb
安装命令:
dpkg -i debian-ports-archive-keyring_2023.02.01_all.deb

由于国外的都比较慢,可以切换到国内的阿里,清华等软件源
备份当前的软件源配置:
cp /etc/apt/sources.list /etc/apt/sources.list.bak

更新软件源:
`
cat > /etc/apt/sources.list << EOF
deb https:
deb-src https:
deb https:
deb-src https:
deb https:
deb-src https:
deb https:
deb-src https:
EOF
添加SSH登录配置
开发板安装桌面系统后,默认不能通过ssh的方式登录,在/etc/ssh/sshd_config中添加:
PermitRootLogin yes

开发板一个网卡用于连接网络,另一个用于ssh连接,因此将ssh网口设置为静态IP,方便使用。默认情况下这样的

编辑网卡配置文件:
vim /etc/network/interfaces

添加配置内容:

重启一下,然后使用ssh连接:

3.5 Docker安装
由于通过以上方式太过于繁琐和复杂,本次通过ubuntu镜像的方式安装。
启动,登录系统

安装docker,输入以下命令:
sudo apt install docker.io

给用户添加root权限,使用命令行编辑 “/etc/sudoers”文件,默认情况下这个文件是只读的,可以通过chmod 777 /etc/sudoers 添加可写权限,然后编辑完成后将权限修改回来,添加内容如下所示:

安装python
进入容器,安装Python
sudo docker exec -it homeassistant sh

配置,然后编译:

编译完成,进行测试:

安装homeassistant
安装依赖:
apk add —no-cache bluez libffi-dev openssl-dev jpeg-dev zlib-dev autoconf automake linux-headers gcc build-base cmake make openjpeg-dev tiff-dev libjpeg-turbo-dev tzdata ffmpeg lapack-dev openblas-dev rust cargo libpcap-dev

安装netdisco
pip install netdisco

安装warrant:
pip install warrant

安装homeassistant:
pip3 install homeassistant

启动,输hass命令,在浏览器中数据自己的开发板的ip地址:8123,如下所示,这里启动的时候需要很久,需要多等待一段时间。

4 效果
