sudo nano /etc/apt/sources.list

deb http://mirrors.aliyun.com/raspbian/raspbian/ stretch main non-free contrib
deb-src http://mirrors.aliyun.com/raspbian/raspbian/ stretch main non-free contrib
deb http://mirrors.ustc.edu.cn/raspbian/raspbian/ stretch main non-free contrib
deb-src http://mirrors.ustc.edu.cn/raspbian/raspbian/ stretch main non-free contrib
deb http://ftp.jaist.ac.jp/pub/Linux/raspbian-archive/raspbian/ stretch main contrib non-free rpi
deb-src http://ftp.jaist.ac.jp/pub/Linux/raspbian-archive/raspbian/ stretch main contrib non-free rpi

sudo apt-get update && apt-get upgrade -y 


curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
sudo apt-get install -y nodejs


sudo apt-get install libavahi-compat-libdnssd-dev -y


sudo npm install -g --unsafe-perm homebridge

sudo npm install -g --unsafe-perm homebridge-mi-air-purifier miio

sudo npm install -g --unsafe-perm homebridge-mi-fan

sudo npm install -g --unsafe-perm homebridge-nest

sudo npm install -g homebridge-xiaomi-roborock-vacuum --unsafe-perm


sudo npm install -g --unsafe-perm homebridge-harmonyhub

nano ~/.homebridge/config.json