Dashboard on wall-mounted touchscreen display with raspberry pi

Goal was to have a wall-mounted touchscreen display without battery/charging topics, that would start in a kiosk-like mode.

Shopping list:

  1. Raspberry pi starter kit like this one (I used the 4GB version to also allow running youtube videos smoothly since the display is mounted in the kitchen area): Raspberry Pi 5 8GB Starter-Kit | 128GB microSD | Offizielles 27W Netzteil | Offizielles Gehäuse mit Lüfter | 4K Micro HDMI Kabel 1m | Alu-Kühlkörper: Amazon.de: Computer & Zubehör

  2. Touchscreen display: Tragbarer Monitor Touchscreen, 18,5 Zoll 1080P 99% sRGB FHD HDR USB HDMI mit VESA & Standfuß 180° einstellbar Portable Monitor, Reise zweiter Monitor für Computer Laptop Surface PC PS4/PS5 Xbox: Amazon.de: Computer & Zubehör

  3. Wall mount: https://www.bauhaus.at/tv-wandhalterungen/schwaiger-tv-wandhalterung-fixed-1/p/25631519 (the included screws did not fit the VESA 75 mounts on the display, so I used two short M4 screws)

  4. Mini HDMI to HDMI adapter (to allow connecting the HDMI/Micro HDMI cable from raspberry): https://www.bauhaus.at/hdmi-kabel/hdmi-adapter/p/26082794?search_p=true&adb_search=hdmi%20mini

  5. To provide a simple way to operate the raspberry pi throughout the setup process, I also connected a USB keyboard/touchpad like this one: Rii i8 Mini Tastatur Wireless, Smart TV Tastatur, Kabellos Tastatur mit Touchpad, Mini Keyboard für Smart TV Fernbedienung/PC/PAD/Xbox 360/ PS3/Google Android TV Box/HTPC/IPTV: Amazon.de: Computer & Zubehör

Wiring of touchscreen:

setup:

  1. put raspberry pi OS (debian bookworm 64-bit) on SD card with raspberry pi imager (enable SSH access and wifi connection in image configuration)

  2. installed the matchbox on-screen keyboard and enabled it as additional application via right click on the top left menu (terminal icon)

  3. for the matchbox keyboard to display properly, I had to switch the window manager from wayland to X11 via „sudo raspi-config“ in the terminal (or via ssh)

  4. setup a dashboard called „kalender“ in home assistant, copied the URL

  5. test run of chromium browser via ssh/terminal command:

Trying to run the chromium command directly, gave me a „Display …“ error, so I tried to place a command first that gives control over the screen (run in terminal/ssh as @raspberrypi:~ $:)

export DISPLAY=:0.0

chromium-browser --noerrdialogs --disable-infobars --kiosk http://192.168.0.110:8123/dashboard-example/kalender

these two commands after each other should start up your dashboard URL smoothly.

Furthermore, I disabled startup error messages in chromium (source by https://web.archive.org/web/20210225045501/https://desertbot.io/blog/raspberry-pi-touchscreen-kiosk-setup) :

Remove exit errors from the config files that could trigger a warning (run these in the terminal/ssh):

sed -i ‘s/“exited_cleanly”:false/“exited_cleanly”:true/’ ~/.config/chromium/‘Local State’

sed -i ‘s/“exited_cleanly”:false/“exited_cleanly”:true/; s/“exit_type”:“[^”]+"/“exit_type”:“Normal”/’ ~/.config/chromium/Default/Preferences

To enable autorun of the startup commands, I created a .desktop file in /etc/xdg/autostart with the nano editor:

sudo nano /etc/xdg/autostart/chromium_autorun.desktop

in nano, I pasted the prepared commands (this is the full file content):

[Desktop Entry]

Type=Application

Name=chromium_autorun

Comment=Autostart chromium

NoDisplay=false

Exec=export DISPLAY=:0.0

Exec=chromium-browser --noerrdialogs --disable-infobars --kiosk http://192.168.0.110:8123/dashboard-example/kalender

Save the file in nano with CTRL+o, then

Exit nano by CTRL+x

sudo reboot

to reboot into your nice start-up

Next up on the project: Setting up presence detection to cut off power to the screen after a few minutes with no presence. Only cutting off the power for the display did not work, since the screen still tries to draw sufficient power from the raspi. So I am getting a wifi-connected USB plug to also cut power via the display – raspberry USB connection.

For the time being, I left screen blanking on in the raspi configuration.

4 Likes

Really nice hardware setup! :+1:

You could give this a try to expose the display sensors via MQTT:

1 Like

Thank you! And thank you very much for pointing me in this direction. Your application looks awesome! I will give it a try as soon as I am home and family allows :wink:

I have successfully switched to your touchkio application, I have to admit it is amazing!
I am now able to control (not only :wink:) the display ON/OFF state through the mqtt integration, which enables me to run the automations for switching off the screen after some unattended time, and switch it back on again if presence is detected.
Steps that I performed on the Home Assistant Raspi for this change:

  1. (was already present actually) created a dedicated user for the screen in Home Assistant users
  2. installed the MQTT Addon and MQTT integration
  3. (after touchkio setup on Dashboard Raspi - see below): added automations to switch the display on/off depending on detected presence by a sonoff zigbee PIR sensor; created a helper switch button to disable the display-on automation for the remaining day.

The steps that I performed on the Dashboard Raspi for this change:

  1. removed the /etc/xdg/autostart/chromium_autorun.desktop file

  2. switched the window manager back to wayland using raspi-config (X11 was not needed anymore since now I am using squeekboard as on-screen-keyboard)

  3. sudo update, sudo upgrade

  4. installed touchkio using the easy way
    4.1 during touchkio setup, entered the dedicated screen home assistant user for mqtt
    4.2 during touchkio setup, inserted my full dashboard url for the web_url argument, so that touchkio will startup displaying my nice dashboard (actually I missed that during the initial setup and modified the web_url argument afterwards in ~/.config/touchkio/Arguments.json)

  5. rebooted the Dashboard Raspi
    Perfection. And very wife-appreciated :slight_smile:

A funny thing that I recognized some strange behaviour of squeekboard when used with Chromium, but I am just using Firefox now to access youtube and other web pages on the display.

1 Like