09树莓派一体化安装(All-In-One Installer)智能家居平台Home Assistant

时间:2022-02-18 09:03:02

2017-08-30 13:29:38

Raspberry Pi All-In-One Installer

全新安装树莓派系统(系统为官方的RASPBIAN STRETCH WITH DESKTOP,Release date:2017-08-16)
将树莓派链接到网络(有线网络连接,WIFI也可)
通过SSH登录树莓派,执行下列命令(命令是一行,并且不用运行为sudo)

pi@raspberrypi:~ $ curl -O https://raw.githubusercontent.com/home-assistant/fabric-home-assistant/master/hass_rpi_installer.sh && sudo chown pi:pi hass_rpi_installer.sh && bash hass_rpi_installer.sh

等待系统安装完毕后(我的网速130kb/s左右的下载速度,持续了1小时左右),自动重启,在树莓派浏览器中输入http://your_raspberry_pi_ip:8123,即可进入Home Assistant界面。
 
注意:在安装系统之前,设置了语言、时区,安装了中文字体和输入法,设置了键盘布局。另外还更改了源为阿里源。
 
重新启动服务

sudo systemctl restart home-assistant.service

更新命令为:
To upgrade the All-In-One setup manually:
Login to Raspberry Pi zssh pi@your_raspberry_pi_ip
Change to homeassistant user 

sudo su -s /bin/bash homeassistant

Change to virtual enviroment 

source /srv/homeassistant/homeassistant_venv/bin/activate

Update Home Assistant 

pip3 install --upgrade homeassistant

 

Type

exit

 to logout the hass user and return to the pi user.
2017年9月26日更新到HA0.54

2017年10月9日更新到HA0.55

 
2017年12月26日升级到HA0.60进行下列额外修复,以支持小米设备:
sudo su -s /bin/bash homeassistant
source /srv/homeassistant/homeassistant_venv/bin/activate
pip3 install --upgrade python-miio
#編輯以下四個檔案,將REQUIREMENTS = ['python-miio==0.3.2'] 改為 REQUIREMENTS = ['python-miio==0.3.3']
#修改完使用ctrl+O --> Enter存檔跳出
sudo nano /srv/homeassistant/homeassistant_venv/lib/python3.5/site-packages/homeassistant/components/vacuum/xiaomi_miio.py
sudo nano /srv/homeassistant/homeassistant_venv/lib/python3.5/site-packages/homeassistant/components/fan/xiaomi_miio.py
sudo nano /srv/homeassistant/homeassistant_venv/lib/python3.5/site-packages/homeassistant/components/light/xiaomi_miio.py
sudo nano /srv/homeassistant/homeassistant_venv/lib/python3.5/site-packages/homeassistant/components/switch/xiaomi_miio.py