【IoT】安装 Home Assistant Core

Posted by 西维蜀黍 on 2021-02-09, Last Modified on 2024-02-26

Install on Raspberry Pi

python3 -m pip install wheel
pip3 install homeassistant==2024.2.1

# 我出现了找不到该版本错误,2024.2.1 Requires-Python >=3.11.0
# 这时候需要升级 Python版本

ref

Install on Ubuntu

Maintain

# ha home
$  cd /home/homeassistant/.homeassistant
# modify config
$ vim configuration.yaml

Potential Issue

requests 2.25.1 requires idna<3,>=2.5, but you'll have idna 3.1 which is incompatible.

My HA on Ubuntu2

# run
$ /srv/homeassistant/bin/python3.8 /srv/homeassistant/bin/hass -c /home/homeassistant/.homeassistant

# view logs
$ ccat /home/homeassistant/.homeassistant/home-assistant.log

Install on macOS

# Create the virtual Python environment
$ virtualenv homeassistant --python=python3
$ cd homeassistant

Set Python to the virtual environment:

$ source bin/activate

Install Home Assistant

$ pip3 install homeassistant
# 如果找不到源,可以用
$ pip install homeassistant -i https://pypi.python.org/simple

To start it after for example a server reboot, opening a new Terminal window first the virtual environment has to be activated before starting it.

$ source bin/activate
$ bin/hass

Access http://127.0.0.1:8123

Ref

Updating

To update to the latest version of Home Assistant Core follow these simple steps:

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

Install Other Stuff

HACS

https://hacs.xyz/docs/installation/installation

Stop your HA

Open a terminal

Change to the user that is running Home Assistant

sudo -u homeassistant -H -s

Run the HACS install script

wget -q -O - https://hacs.xyz/install | bash -

Then, follow https://hacs.xyz/docs/configuration/basic

Reference