Home Assistant Supervised with TouchKio: Installation on RPi OS Lite (HOWTO)

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:

Steps:

Preparation

  1. 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.
  2. 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>

  1. Enter password defined in step 1. RPi returns promt for standard user $.

  2. Ask for superuser privileges. If password is requested, type the same as for your user
    sudo su. RPi returns promt for super user #.

  3. 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)

  1. 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

  2. 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
  1. 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
  1. 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

  1. Install Docker-CE
    sudo su
    curl -fsSL get.docker.com | sh

  2. 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

  3. Test (optional)
    gdbus introspect --system --dest io.hass.os --object-path /io/hass/os

  4. 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.

  1. Login to the Home Assistant (Note: Open your browser at PC, type <RPi IP address>:8123 and configure it.)
  2. 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 is http://1<RPi IP address>:8123/dashboard-kiosk/0.
  3. It is recommended to create dedicated local user in Home Assistatant just for TouchKio

Direct installation on RPi

  1. Connect the USB keyboard to RPi.
  2. Insert your name and password.
  3. Stay logged as standard user (assist in my case; promt remains $.
  4. Run this installation script:
    bash <(wget -qO- https://raw.githubusercontent.com/leukipp/touchkio/main/install.sh)
  5. As web url enter http://127.0.0.1:8123/lovelace/0. Note: Address ‘127.0.0.1’ is device (RPi) itself.
  6. 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
2 Likes