➜ ~ which hass
/usr/local/bin/hass
sudo vim /etc/systemd/system/home-assistant@zhangyuqing.service
➜ ~ cat /etc/systemd/system/home-assistant@zhangyuqing.service
[Unit]
Description=Home Assistant
After=network-online.target
[Service]
Type=simple
User=%i
ExecStart=/usr/local/bin/hass -c "/home/zhangyuqing/.homeassistant"
[Install]
WantedBy=multi-user.target
sudo systemctl --system daemon-reload
sudo systemctl enable home-assistant@zhangyuqing.service
sudo systemctl start home-assistant@zhangyuqing.service