This is my step-by-step guide for Home Assistant installation with GPIO and TouchKio.
NOTES:
- This guide comes with ABSOLUTELY NO WARRANTY, to the extent permitted by applicable law,
- It shows how to install great TouchKio (
https://community.home-assistant.io/t/kiosk-mode-for-raspberry-pi-with-touch-display/821196
) at standard Raspberry Pi OS.
BoM:
- Raspberry Pi 4, 4GB RAM with sufficient power supply (RPi)
- 64 GB microSD card (example: https://www.amazon.de/-/en/SanDisk-Extreme-microSDXC-RescuePRO-Performance/dp/B09X7BYSFG)
- 4.3" IPS touch screen (example: https://www.aliexpress.com/item/1005005777123509.html)
- Display cable (15pin Ribbon Flexible Flat cable, forward direction)
- USB keyboard (for installation only).
Steps:
Preparation
- Install the Raspberry OS Lite 64bit to microSD card (recommended: https://www.raspberrypi.com/software/) with allowed SSH access. I have defined user “assist” with password.
- Connect display to the RPi, connect Ethernet cable, insert microSD card and power the RPi. RPi will start, shows prompt and actual IP address at the end.
Installation via SSH
3. Connect to the RPi via SSH protocol (example: from Windows PowerShell) with
ssh assist@<RPi IP address>
-
Enter password defined in step 1. RPi returns promt for standard user
$
. -
Ask for superuser privileges. If password is requested, type the same as for your user
sudo su
. RPi returns promt for super user#
. -
Upgrade the Raspberry Pi OS and reboot then RPi:
apt update
apt upgrade
reboot
Note: You have to connect to RPi again after each reboot (see Step 3)
-
Install minimal desktop required for TouchKio, set the graphical start of RPi:
sudo su
apt install lightdm xserver-xorg labwc libnotify4 xdg-utils
systemctl --quiet set-default graphical.target
-
Set the apparmor during boot:
nano /boot/firmware/cmdline.txt
- Insert following command as first comand. (Note: file shall have one line only, commands are separated with spaces.)
lsm=apparmor
- Save the file (Ctrl-X, then confirm the changes and file name), then reboot RPi:
reboot
- Install Home Assistant dependencies
sudo su
apt install \
apparmor \
bluez \
cifs-utils \
curl \
dbus \
iproute2 \
jq \
libglib2.0-bin \
lsb-release \
network-manager \
nfs-common \
systemd-journal-remote \
systemd-resolved \
systemd-timesyncd \
udisks2 \
wget -y
- Set the Network Manager. (Note: don’t forget to save all changes with Ctrl-X, then confirm the changes and file name)
nano /etc/NetworkManager/NetworkManager.conf
[main]
dns=default
plugins=keyfile
autoconnect-retries-default=0
rc-manager=file[keyfile]
unmanaged-devices=type:bridge;type:tun;driver:veth[logging]
backend=journal
nano /etc/NetworkManager/system-connections/default
[connection]
id=Supervisor default
uuid=b653440a-544a-4e4f-aef5-6c443171c4f8
type=802-3-ethernet
llmnr=2
mdns=2[ipv4]
method=auto[ipv6]
addr-gen-mode=stable-privacy
method=auto
nano /etc/network/interfaces
source /etc/network/interfaces.d/*
auto lo
iface lo inet loopback
Then reboot RPi:
reboot
-
Install Docker-CE
sudo su
curl -fsSL get.docker.com | sh
-
Install latest version of OS Agent (here it is 1.7.2)
wget https://github.com/home-assistant/os-agent/releases/download/1.7.2/os-agent_1.7.2_linux_aarch64.deb
sudo dpkg -i os-agent_1.7.2_linux_aarch64.deb
-
Test (optional)
gdbus introspect --system --dest io.hass.os --object-path /io/hass/os
-
Home Assistant installation
wget -O homeassistant-supervised.deb https://github.com/home-assistant/supervised-installer/releases/latest/download/homeassistant-supervised.deb
apt install ./homeassistant-supervised.deb
- select
raspberrypi4-64
reboot
Now, Home Assistant supervised is installed.
- Login to the Home Assistant (Note: Open your browser at PC, type
<RPi IP address>:8123
and configure it.) - Remember the full address of the initial dashboard ‘Overview’. It should be like
http://<RPi IP address>:8123/lovelace/0
. (Note: You can create dashboard dedicated to the kiosk. In my case is named ‘kiosk’ and full address ishttp://1<RPi IP address>:8123/dashboard-kiosk/0
. - It is recommended to create dedicated local user in Home Assistatant just for TouchKio
Direct installation on RPi
- Connect the USB keyboard to RPi.
- Insert your name and password.
- Stay logged as standard user (
assist
in my case; promt remains$
. - Run this installation script:
bash <(wget -qO- https://raw.githubusercontent.com/leukipp/touchkio/main/install.sh)
- As web url enter
http://127.0.0.1:8123/lovelace/0
. Note: Address ‘127.0.0.1’ is device (RPi) itself. - Now, TouchKio is automatically started. The touchscreen goes to white first, then started with given page.
Now, Home Assistant supervised is installed incl. TouchKio.
Note: The TouchKio dashboard can be easily changed via SSH. The configuration file is located at ~/.config/touchkio/Arguments.json
(in my case /home/assist/.config/touchkio/Arguments.json
) and can be changed with nano ~/.config/touchkio/Arguments.json
.
Credits:
- Home Assistant team and community
- leukipp,
https://github.com/leukipp/touchkio