On to installing Home Assistant on our device. Like with the KODI installation, this is mostly information widely available on the internet, yet again included within this series for compleness sake. So let’s get started with installing the dependencies if not yet installed. (Not really sure anymore, sorry for this)
sudo apt-get install python3 python3-venv python3-pip
Next we need to create a dedicated user for running the software. This is recomended by the developers of Home Assistant, so will follow their advise to do so. Run the following commands;
sudo useradd -rm homeassistant -G dialout,gpio cd /srv sudo mkdir homeassistant sudo chown homeassistant:homeassistant homeassistant
Now we will change our environment to that new user and create a virtual environment for installing the software.
sudo -u homeassistant -H -s cd /srv/homeassistant python3 -m venv . source bin/activate
Next is to install some dependencies within this virtual environment
python3 -m pip install wheel
And then we can finally install Home Assistant itself
pip3 install homeassistant
If everything went OK, we can start Home Assistant manually for the first time.
Running Home Assistant for the very first time will take a while as it is downloading and installing all other things it needs at start up. The documentation mentions 5 – 10 minutes. Best is to keep checking the webpage at the device it’s IP:8123. Once the GUI is all ready, we can stop Home Assistant and carry on.
Let’s create the systemd autostart at boot file, so that HASS get’s started at boot.
sudo nano -w /firstname.lastname@example.org
And insert the following content
[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
And then finally onto the last step to enable the service
sudo systemctl --system daemon-reload sudo systemctl enable home-assistant@homeassistant reboot