zoukankan      html  css  js  c++  java
  • 树莓派虚拟环境手动安装HA

    树莓派手动安装


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

    sudo apt-get update
    sudo apt-get upgrade -y
    sudo apt-get install python3 python3-venv python3-pip
    sudo useradd -rm homeassistant -G dialout,gpio
    cd /srv
    sudo mkdir homeassistant
    sudo chown homeassistant:homeassistant homeassistant




    sudo -u homeassistant -H -s
    cd /srv/homeassistant
    python3 -m venv .
    source bin/activate
    (homeassistant) homeassistant@raspberrypi:/srv/homeassistant $ python3 -m pip install wheel
    (homeassistant) homeassistant@raspberrypi:/srv/homeassistant $pip3 install homeassistant
    (homeassistant) homeassistant@raspberrypi:/srv/homeassistant $hass



    更新HA到最新版本

    sudo -u homeassistant -H -s
    cd /srv/homeassistant
    source bin/activate
    pip3 install --upgrade homeassistant

    如果更新pip使用

    pip install --upgrade pip



    设置自动启动

    sudo nano -w /etc/systemd/system/homeassistant@homeassistant.service
    [Unit]
    Description=Home Assistant
    After=network-online.target
    
    [Service]
    Type=simple
    User=%i
    ExecStart=/srv/homeassistant/bin/hass -c "/home/homeassistant/.homeassistant"
    
    [Install]
    WantedBy=multi-user.target




    sudo systemctl --system daemon-reload
    sudo systemctl enable homeassistant@homeassistant.service
    sudo systemctl disable homeassistant@homeassistant.service
    sudo systemctl start homeassistant@homeassistant.service
    sudo journalctl -f -u homeassistant@homeassistant.service










  • 相关阅读:
    android spinner学习
    cookie的学习笔记三(做俩个小练习);
    Cookie的细节具体保存的有效时间
    cookie技术核心! 就是四个类的应用 搞懂这个基本上就把这个搞定了!
    学习Servlet的重要应用 在什么地方用写路径
    数组空值empty
    ios学习杂记
    ios广告封装
    Runtime
    UIImage分类,设置边框
  • 原文地址:https://www.cnblogs.com/arrive/p/10319857.html
Copyright © 2011-2022 走看看