视频教程如下:
https://youtu.be/CeiW-G1ghPc

更多视频教程请点这里

1.树莓派更换国内apt源(可选,中国大陆必须)

sudo su
echo 'deb http://mirrors.tuna.tsinghua.edu.cn/raspbian/raspbian/ stretch main contrib non-free rpi' > /etc/apt/sources.list
echo 'deb-src http://mirrors.tuna.tsinghua.edu.cn/raspbian/raspbian/ stretch main contrib non-free rpi' >> /etc/apt/sources.list
echo 'deb http://mirror.tuna.tsinghua.edu.cn/raspberrypi/ stretch main ui' > /etc/apt/sources.list.d/raspi.list
echo 'deb-src http://mirror.tuna.tsinghua.edu.cn/raspberrypi/ stretch main ui' >> /etc/apt/sources.list.d/raspi.list
apt-get update
exit

斐讯N1 ArmBian换apt源(可选,中国大陆必须)
sudo su
echo 'deb http://mirrors.ustc.edu.cn/debian stretch main contrib non-free' > /etc/apt/sources.list
echo 'deb http://mirrors.ustc.edu.cn/debian stretch-updates main contrib non-free' > /etc/apt/sources.list
echo 'deb http://mirrors.ustc.edu.cn/debian stretch-backports main contrib non-free' > /etc/apt/sources.list
echo 'deb http://mirrors.ustc.edu.cn/debian-security/ stretch/updates main contrib non-free' > /etc/apt/sources.list
apt-get update
exit

2.安装依Python3运行环境
sudo apt-get -y install python3-pip build-essential libssl-dev libffi-dev python-dev openssl libssl-dev python3-cffi python3-setuptools python3-cryptography python3-bcrypt python-cryptography python-bcrypt python3-dev

3.修改阿里云pip源(可选,中国大陆必须)
sudo su
mv /etc/pip.conf /etc/pip.conf.bak
echo '[global]' > /etc/pip.conf
echo 'timeout = 6000' >> /etc/pip.conf
echo 'index-url = https://mirrors.aliyun.com/pypi/simple/' >> /etc/pip.conf
echo 'trusted-host = mirrors.aliyun.com' >> /etc/pip.conf
exit

4.安装python依赖包
pip3 install requests
pip3 install sqlalchemy
pip3 install distro
pip3 install hass-nabucasa
pip3 install xmltodict
pip3 install mutagen
pip3 install netdisco
pip3 install pynacl
pip3 install pyotp
pip3 install pyqrcode
pip3 install aiohttp
pip3 install aiohttp_cors
pip3 install cryptography
pip3 install gtts-token
pip3 install hass-nabucasa
sudo pip3 install pycryptodome
sudo pip3 install --upgrade pip

5.安装Home Assistant
sudo pip3 install homeassistant

6.手动启动测试一下是否正常,启动过程中会自动安装一些依赖包,耐心等待。
hass

7.创建系统服务

sudo chown -R $USER /tmp
echo $USER > /tmp/user.txt
sudo su
USER1=`cat /tmp/user.txt`
echo '[Unit]' > /etc/systemd/system/hass.service
echo 'Description=Home Assistant Service' >> /etc/systemd/system/hass.service
echo 'After=network.target' >> /etc/systemd/system/hass.service
echo 'Wants=network.target' >> /etc/systemd/system/hass.service
echo '[Service]' >> /etc/systemd/system/hass.service
echo 'User='$USER1 >> /etc/systemd/system/hass.service
echo 'Type=simple' >> /etc/systemd/system/hass.service
echo 'ExecStartPre=/bin/sleep 3' >> /etc/systemd/system/hass.service
echo 'ExecStart=/usr/local/bin/hass' >> /etc/systemd/system/hass.service
echo 'Restart=always' >> /etc/systemd/system/hass.service
echo '[Install]' >> /etc/systemd/system/hass.service
echo 'WantedBy=multi-user.target' >> /etc/systemd/system/hass.service
exit

8.添加开机启动并启动Home Assistant

sudo systemctl enable hass
sudo systemctl start hass

打开Home Assistant 界面

http://xxx.xxx.xxx.xxx:8123

28 对 “树莓派/斐讯N1/Armbian/安装Home Assistant”的想法;

  1. 你好
    非常感谢作者的树莓派搭建智能家居安装教程
    但我再安装hass中出现问题显示如下错误“ ERROR: Package ‘homeassistant’ requires a different Python: 3.5.3 not in ‘>=3.6.0’
    ”是python的版本不对吗?如何解决?还请作者不吝赐教。如有可能想与作者建立联系,以便再日后学习中遇到问题可及时向您提问
    我的qq:1173472955
    微信:li15188677636

    1. 你好,很高兴你对我的教程感兴趣,8月31日之后home assistant要求升级Python大于3.6了,所以你要参考我另一篇文章升级Python。

      如果想进群讨论,请观看我教程上的视频,看下方显示的TG群连接,进群讨论。

    2. 请看文章里内嵌的视频链接,视频内有提供群组联系方式,还有就是你的python版本太低了,你要去看另一篇文章,参照文章里的视频升级到python3.7。

  2. Command “/usr/bin/python3 -m pip install –ignore-installed –no-user –prefix /tmp/pip-build-env-9qb4clxc –no-warn-script-location –no-binary :none: –only-binary :none: -i https://mirrors.aliyun.com/pypi/simple/ –trusted-host mirrors.aliyun.com — setuptools wheel “cffi>=1.4.1; python_implementation != ‘PyPy’”” failed with error code 1 in None 安装依赖时报错

  3. 你好;
    在这一步“安装Home Assistant
    sudo pip3 install homeassistant“
    发生错误,一大片红色,其中第一句是:ERROR: Command errored out with exit status 1:

  4. 不好意思,我前面就有一个错误忽略了,导致后面错误一大片红色;前面在执行pip3 install pynacl命令是的错误是Command “/usr/bin/python3 -m pip install –ignore-installed –no-user –prefix / tmp/pip-build-env-psg1pg9g –no-warn-script-location –no-binary :none: –only-b inary :none: -i https://mirrors.aliyun.com/pypi/simple/ –trusted-host mirrors.a liyun.com — setuptools wheel “cffi>=1.4.1; python_implementation != ‘PyPy'”” fa iled with error code 1 in None

          1. 树莓派3b,我装的应该是最新版本的镜像,我看了看内置python3版本是3.7的,是这个问题吗?

  5. 大神几时出一个配置文件设置安装及怎么获取小米家token的教程,看了你的视频已经在ESXI下虚拟机安装了homeassistant,但不会设置配置文件。望解惑,感谢。

  6. Command “/usr/bin/python3 -m pip install –ignore-installed –no-user –prefix /tmp/pip-build-env-g3zkduoz –no-warn-script-location –no-binary :none: –only-binary :none: -i https://mirrors.aliyun.com/pypi/simple/ –trusted-host mirrors.aliyun.com — setuptools>=40.8.0 wheel “cffi>=1.1; python_implementation != ‘PyPy'”” failed with error code 1 in None

  7. 你好,我在安装homeassistant时总是出现保存,红色部分太多,应该怎么做,python版本查了一下是python3.5.3,
    其他地方都完成了,但是homeassistant的主页面没有见到,只显示无法访问,服务器端拒绝了链接

wh进行回复 取消回复

电子邮件地址不会被公开。 必填项已用*标注

此站点使用Akismet来减少垃圾评论。了解我们如何处理您的评论数据