homeassistant_pi
2024 ワード
hdmi_ignore_edid=0xa5000080 hdmi_group=2 hdmi_mode=85
home-assistant名前を取るには大文字ではいけません
pi国内ソース
home-assistant名前を取るには大文字ではいけません
pi国内ソース
1.変更する前に、プロファイルをバックアップします.sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak
sudo cp /etc/apt/sources.list.d/raspi.list /etc/apt/sources..list.d/raspi.list.bak
2.変更/etc/apt/sources.Listまたは元のファイルを直接修正し、元の構成をすべてコメントします(#コメントを使用).
http://mirrors.ustc.edu.cn/raspbian/raspbian/#deb http://mirrordirector.raspbian.org/raspbian/ jessie main contrib non-free rpi
# Uncomment line below then 'apt-get update' to enable 'apt-get source'
#deb-src http://archive.raspbian.org/raspbian/ jessie main contrib non-free rpi
#
deb http://mirrors.ustc.edu.cn/raspbian/raspbian/ jessie main contrib non-free rpi
3.変更/etc/apt/sources.list.d/raspi.list http://mirrors.ustc.edu.cn/archive.raspberrypi.org/debian/#deb http://archive.raspberrypi.org/debian/ jessie main ui
# Uncomment line below then 'apt-get update' to enable 'apt-get source'
#deb-src http://archive.raspberrypi.org/ jessie main ui
#
deb http://mirrors.ustc.edu.cn/archive.raspberrypi.org/ jessie main ui
実際にはraspberrypi.orgをmirrorsに置き換える.ustc.edu.cn/archive.raspberrypi.orgでいいです.
python仮想スペースにインストール
https://home-assistant.io/docs/installation/virtualenv/pip install setuptools --upgrade sudo -u homeassistant/home/homeassistant/homeassistant/bin/hass
起動
ベリーパイはsystemd管理で起動するので、以下に新しいファイル/etc/systemd/systemm/homeassistantを追加します.service [Unit]
Description=Home Assistant
After=network.target
[Service]
Type=simple
User=%i
ExecStart=/home/homeassistant/homeassistant/bin/hass -c "/home/homeassistant/.homeassistant"
[Install]
WantedBy=multi-user.target
sudo systemctl enable homeassistant
sudo systemctl disable homeassistant
sudo systemctl start homeassistant
sudo systemctl stop homeassistant
usermod -a -G video hass
sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak
sudo cp /etc/apt/sources.list.d/raspi.list /etc/apt/sources..list.d/raspi.list.bak
#deb http://mirrordirector.raspbian.org/raspbian/ jessie main contrib non-free rpi
# Uncomment line below then 'apt-get update' to enable 'apt-get source'
#deb-src http://archive.raspbian.org/raspbian/ jessie main contrib non-free rpi
#
deb http://mirrors.ustc.edu.cn/raspbian/raspbian/ jessie main contrib non-free rpi
#deb http://archive.raspberrypi.org/debian/ jessie main ui
# Uncomment line below then 'apt-get update' to enable 'apt-get source'
#deb-src http://archive.raspberrypi.org/ jessie main ui
#
deb http://mirrors.ustc.edu.cn/archive.raspberrypi.org/ jessie main ui
https://home-assistant.io/docs/installation/virtualenv/pip install setuptools --upgrade sudo -u homeassistant/home/homeassistant/homeassistant/bin/hass
起動
ベリーパイはsystemd管理で起動するので、以下に新しいファイル/etc/systemd/systemm/homeassistantを追加します.service [Unit]
Description=Home Assistant
After=network.target
[Service]
Type=simple
User=%i
ExecStart=/home/homeassistant/homeassistant/bin/hass -c "/home/homeassistant/.homeassistant"
[Install]
WantedBy=multi-user.target
sudo systemctl enable homeassistant
sudo systemctl disable homeassistant
sudo systemctl start homeassistant
sudo systemctl stop homeassistant
usermod -a -G video hass
[Unit]
Description=Home Assistant
After=network.target
[Service]
Type=simple
User=%i
ExecStart=/home/homeassistant/homeassistant/bin/hass -c "/home/homeassistant/.homeassistant"
[Install]
WantedBy=multi-user.target
sudo systemctl enable homeassistant
sudo systemctl disable homeassistant
sudo systemctl start homeassistant
sudo systemctl stop homeassistant