嵌入式

安装home assistant

安装编译所需依赖包:

sudo apt-get install build-essential tk-dev libncurses5-dev libncursesw5-dev libreadline6-dev libdb5.3-dev libgdbm-dev libsqlite3-dev libssl-dev libbz2-dev libexpat1-dev liblzma-dev zlib1g-dev

安装SSL依赖:

sudo apt-get install libssl-dev

到官网下载Python3.6.6: https://www.python.org/downloads/source/

wget https://www.python.org/ftp/python/3.6.6/Python-3.6.6.tar.xz

解压:

tar xf Python-3.6.6.tar.xz 

进入目录:

cd Python-3.6.6

开始编译(时间漫长,需要等待,建议用&&把三句连在一起执行):

sudo  ./configure
sudo make
sudo make install

升级pip:

sudo python3.6 -m pip install --upgrade pip

安装库:

apt-get install -y build-essential libssl-dev libffi-dev

安装homebridge:

sudo apt-get install libavahi-compat-libdnssd-dev
sudo npm install -g --unsafe-perm homebridge

安装mosquitto:

sudo apt-get install libssl-dev
sudo apt-get install libc-ares-dev
sudo apt-get install uuid-dev
make && sudo make install

安装home assistant:

sudo apt-get install libfftw3-dev
sudo apt-get install -y build-essential libssl-dev libffi-dev
sudo pip3.6 install homeassistant

home assistant 开机自启动:

sudo nano -w /etc/systemd/system/home-assistant@root.service
sudo systemctl --system daemon-reload
sudo systemctl restart home-assistant@root.service
/**file**/
[Unit]
Description=Home Assistant
After=network-online.target

[Service]
Type=simple
User=%i
ExecStart=/usr/local/bin/hass -c "/home/debian/.homeassistant"

[Install]
WantedBy=multi-user.target

升级node.js:

npm cache clean -f
sudo npm install -g n
sudo n stable

运行homebridge:

sudo npm install homebridge-homeassistant -g
sudo journalctl -f -u homebridge@root.service # 查看日志

回复

This is just a placeholder img.