Homeassistant on RaspberryPi 4

I struggled a lot to bring Homeassistant to work. Here some of my failures and solutions.

RPI-WLAN

It seems to be not possible to install Homeassistant with WLAN.on RPi. All the tricks with a CONFIG directory and networksettings on the SDcard do no longer work. Maybe because they now use a docker container.

So I tried via LAN. With the image from Homeassistant, HASS came up and I got a web GUI in the LAN.

Then I tried to configure a WLAN. THe GUI accepted all my configuration, warned me that the Connection may break if I activate them. After activation as expected the conection was gone.

But nothing come up on the WLAN. So I entered the HA CLI on the command line. This is a nasty bit of software! It dump tons of instructions on the screen but gives you no clue how to get things done. Seldom found such a weird CLI, even Oracle CLI is better, which I hate. Why can this CLI not offer the same confort as raspi-config to setup a WLAN connection?

Configuring the WLAN via the CLI was impossible for me. So I digged into the network configuration via the root shell. To get to a root shell you have to type "login" in the HA CLI. This fact is also hidden from the comon people and needs some deep diggin into the net.

I noticed that my WLAN configuration options (given via the GUI) indeed are stored under the NetworkManager settings. With nmcli I checked that they are valid and online. But by no means I get a network connection to the HASS.

OK one may have a bad day. Or one may not belong to the initiated ones, which know all the hidden features, not to be found in the help of the CLI.

 

Next Day: Virtual Machine.

My aim for using Homeassistant was to simply check if a certain ESPHome ESP32 microcontroller is a good base for my next project.

To get things done I choose a virtual machine as the fastest approach.

I was not able to get the Homeassistant VM image for KVM run. I got some strange internal error of my libvirt-stack that never has failed me before.

OK, this may be a problem with my KVM setup. But I run dozens of VMs with no problem.

 

Same Day: Virtual Debian Machine with Core setup.

I had setup Homeassistant a year ago with the core setup. I am a true Pythonist and I remembered that it was quite simple.

But this aptempt shattered on the requirement of python3.8 which is not available on my Debian Buster VM.

 

Same Day: Virtual Mint Machine with Core setup.

Core Install works like a charm. But KVM refuses to talk with my WLAN which I need to access my ESP Transmitters.

This is no fault of Homeassistant but of the KVM people. Virtualbox can bridge to a WLAN interface, but KVM not.

 

Same Day: Rpi revisited.

After so much trouble I decided to go back to the roots and raspberries.

I compiled Python3.8 on the raspberry following this guide for Debian.

Then I followed the Instructions for homeassistant core installation.

But this will break since Pillow does not install correctly.

 

Final install guide on RPi4 (Buster)

Flash a stock RaspberryOS Buster on the Rpi4.

Install the dependencies of Python3.8 and Pillow rolled into one:

apt-get  install build-essential curl libbz2-dev libffi-dev libfreetype6-dev libfribidi-dev libgdbm-dev  libharfbuzz-dev libjpeg8-dev  liblcms2-dev libncurses5-dev libnss3-dev  libopenjp2-7-dev libreadline-dev libsqlite3-dev libssl-dev libtiff5-dev libwebp-dev libxcb1-dev python3-tk tcl8.6-dev tk8.6-dev zlib1g-dev

Install Python3.8 e.g. following this guide

Then follow the Homeassistant guide for the Core installation and you are done.