Raspberry Pi 上安装 Home Assistant

参考1: https://www.home-assistant.io/docs/installation/virtualenv/

参考2: https://www.home-assistant.io/docs/installation/raspberry-pi/

硬件环境:raspberry 3B+

软件环境:RASPBIAN STRETCH WITH DESKTOP 2018-06-27

说明: 基本是抄录hass.io官网资料,只是很多情况需要翻墙才看到到,身为天朝的开发者真是醉了。

 

1. Update the system

$ sudo apt-get update
$ sudo apt-get upgrade -y

2. Install the dependencies

sudo apt-get install python3 python3-venv python3-pip

3. Add an account for Home Assistant called homeassistant

$ sudo useradd -rm homeassistant -G dialout,gpio

4. Create a directory for the installation of Home Assistant

$ cd /srv
$ sudo mkdir homeassistant
$ sudo chown homeassistant:homeassistant homeassistant

5. Create and Change to a Virtual environment for Home Assistant

$ sudo -u homeassistant -H -s
$ cd /srv/homeassistant
$ python3 -m venv .
$ source bin/activate

 pi@raspberrypi:/srv/homeassistant $ source bin/activate
 (homeassistant) pi@raspberrypi:/srv/homeassistant $

6. Once activated the virtual environment, Install a required python package

(homeassistant) homeassistant@raspberrypi:/srv/homeassistant $ python3 -m pip install wheel

7. Now it's time to Install Home Assistant

(homeassistant) homeassistant@raspberrypi:/srv/homeassistant $ pip3 install homeassistant

8. Create /home/homeassistant/.homeassistant configuration directory

(homeassistant) pi@raspberrypi:/home $ ls /home/homeassistant/.homeassistant/
automations.yaml custom_components deps groups.yaml home-assistant_v2.db scripts.yaml tts
configuration.yaml customize.yaml entity_registry.yaml home-assistant.log known_devices.yaml secrets.yaml
(homeassistant) pi@raspberrypi:/home $

9. Run hass, And you can reach your installation on your Raspberry Pi over the web interface on http://ipaddress:8123

(homeassistant) pi@raspberrypi:/home $ hass 

10. When you login in you pi system, before you run hass, you should change to the virtual environment

$ sudo -u homeassistant -H -s
$ source /srv/homeassistant/bin/activate

11. To upgrade to the latest version of Home Assistant

$ pip3 install --upgrade homeassistant

 12. Start HA

hass

 

转载于:https://www.cnblogs.com/dream-2017/p/9483856.html

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值