These are the (messy) steps to install Home Assistant (on Linux) to control Google Home (via Google Assistant SDK)...
-
We begin with a rather old Debian Linux...
$ neofetch ##### pi@rak-gateway ####### -------------- ##O#O## OS: Linux (Unknown) armv7l ####### Host: Raspberry Pi 4 Model B Rev 1.4 ########### Kernel: 5.10.103-v7l+ ############# Uptime: 14 hours, 52 mins ############### Packages: 912 (dpkg) ################ Shell: bash 5.1.4 ################# Terminal: /dev/pts/0 ##################### CPU: BCM2711 (4) @ 1.500GHz ##################### Memory: 116MiB / 3839MiB #################
-
WARNING: This step might break
apt upgrade
later...Upgrade Python to 3.11: Follow these steps
If we don't do this:
pip3 install
will fail to findhomeassistant==2023.7.2
-
Upgrade SQLite to 3.34.1: Follow these steps
If we don't do this:
hass
will say "SQLite 3.27.2 not supported" -
Because we upgraded Python,
apt upgrade
might break and "keep back" a whole bunch of packages.Not sure why, but this worked: Revert to old version of Python,
apt upgrade
, switch back to new version of Python, thenapt install --only-upgrade gcc-8-base
...## Revert to old version of Python sudo rm /etc/alternatives/python sudo ln -s /usr/bin/python3.7 /etc/alternatives/python sudo rm /etc/alternatives/python3 sudo ln -s /usr/bin/python3.7 /etc/alternatives/python3 ## Upgrade will show "kept back" packages sudo apt upgrade ## Switch back to new version of Python sudo rm /etc/alternatives/python sudo ln -s /usr/local/bin/python3.11 /etc/alternatives/python sudo rm /etc/alternatives/python3 sudo ln -s /usr/local/bin/python3.11 /etc/alternatives/python3 ## Magically fixes the "kept back" packages sudo apt install --only-upgrade gcc-8-base sudo apt upgrade
-
Install Home Assistant Core: Follow these steps
If
pip3 install
fails to findhomeassistant==2023.7.2
: Upgrade Python to 3.11 (see above)If
pip3 install
fails to findrustc
: Install Rust (see below)If
hass
says "SQLite 3.27.2 not supported": Upgrade SQLite to 3.34.1 (see above) -
Install Rust as
homeassistant
user: Follow these stepsIf we don't do this:
pip3 install
will fail to findrustc
-
Install Integration for Google Assistant SDK: Follow these steps
If it fails with "google_assistant_sdk: gRPC is not installed, please install the grpcio package to use the gRPC transport", check whether it's a GLIBC problem...
$ python3 >>> import grpc Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/srv/homeassistant/lib/python3.10/site-packages/grpc/__init__.py", line 22, in <module> from grpc import _compression File "/srv/homeassistant/lib/python3.10/site-packages/grpc/_compression.py", line 20, in <module> from grpc._cython import cygrpc ImportError: /lib/arm-linux-gnueabihf/libc.so.6: version `GLIBC_2.33' not found (required by /srv/homeassistant/lib/python3.10/site-packages/grpc/_cython/cygrpc.cpython-310-arm-linux-gnueabihf.so)
If so, then recompile and reinstall
grpcio
(will take a while)...pip install --upgrade --force-reinstall --no-binary=grpcio grpcio
And restart
hass
. -
Go to the Home Assistant Web UI and chat with Google Assistant.
We will be able to control our lights in Google Home (pic above)...
switch off bedroom light switch on bedroom light
Why are we doing this?
We might use Home Assistant API and Google Home with a Smart Power Plug (IKEA TRÅDFRI and DIRIGERA) to power-cycle our Star64 SBC for Automated Testing of Apache NuttX RTOS...