Last active
November 30, 2021 16:39
-
-
Save mrpjevans/c20e728c0dfd4cddc35a6e19e32d8381 to your computer and use it in GitHub Desktop.
Install Home Assistant Core
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Please run the following commands line-by-line, not as a script: | |
sudo apt -y update && sudo apt -y upgrade | |
sudo apt install -y python3 python3-dev python3-venv python3-pip libffi-dev libssl-dev libjpeg-dev zlib1g-dev autoconf build-essential libopenjp2-7 libtiff5 libturbojpeg0 tzdata | |
sudo useradd -rm homeassistant -G dialout,gpio,i2c | |
sudo mkdir /srv/homeassistant | |
sudo chown homeassistant:homeassistant /srv/homeassistant | |
sudo -u homeassistant -H -s | |
cd /srv/homeassistant | |
python3 -m venv . | |
source bin/activate | |
python3 -m pip install wheel | |
sudo pip3 install homeassistant | |
To test everything is working: | |
hass | |
To run on boot: | |
sudo nano /usr/lib/systemd/hass.service | |
Add the following text (without the snips): | |
--SNIP-- | |
[Unit] | |
Description=hass | |
[Service] | |
ExecStart=/srv/homeassistant/bin/hass | |
Restart=on-failure | |
User=homeassistant | |
Group=homeassistant | |
[Install] | |
WantedBy=multi-user.target | |
--SNIP-- | |
To activate: | |
sudo systemctl enable /usr/lib/systemd/hass.service | |
sudo systemctl start hass.service | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks. Updated.