- 环境准备
运行Home Assistant需要python3.5以上的python环境.软件源里有现成的3.6,直接安装就好1opkg install python3 python3-pip安装虚拟环境
1pip3 install virtualenv - 指定安装位置,python版本
以 /mnt/sda3/homeassistant 路径为例1virtualenv /mnt/sda3/homeassistant -p /usr/bin/python3.6进虚拟环境
1source /mnt/sda3/homeassistant/bin/activate - 安装Home Assistant
1python3 -m pip install homeassistant
- 测试运行一下
1hass –open-ui
等两分钟初始化 看看能不能打开webui,默认端口8123 路由器ip:8123
Ctrl + C 中止
退出虚拟环境1deactivate - 控制脚本
建立/etc/init.d/hass-daemon
贴最下面的脚本,注意改成自己的安装目录1/etc/init.d/hass-daemon enable设置为开机启动
1/etc/init.d/hass-daemon start启动
1/etc/init.d/hass-daemon stop关闭
1
2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 |
#!/bin/sh /etc/rc.common
START=99 # /etc/init.d Service Script for Home Assistant start() { stop() { create_piddir() { |