Kiosk Mode for Raspberry Pi with Touch Display

In my search for suitable touchscreen hardware to display the Home Assistant dashboard in kiosk mode, I decided to use a Raspberry Pi with the official 7" Touch Display 2. While a 7" display may not be the largest, it’s sufficient to effectively display a complete Home Assistant dashboard. I’ve never been a fan of tablets that constantly require a charging battery, as I’m not convinced they will last any longer than a Raspberry Pi.

I would like to introduce you to my TouchKio project, which supports any kind of Linux device connected to a Touch Display and is designed for easy setup, making it beginner-friendly.

TouchKio

A Node.js application that utilizes Electron to create a kiosk mode window specifically designed for a Home Assistant dashboard. This tool is packaged as a .deb file, making it easy to launch the kiosk application on any Debian based Linux hardware (e.g. Raspberry Pi) equipped with a DSI or HDMI Touch Display. Additional releases for other Linux systems are available as .zip file.

display

This implementation addresses common issues encountered when using the built-in browser running in fullscreen mode on the Raspberry Pi with Touch Display.

Moreover, the device running the kiosk application also offers several Home Assistant MQTT sensors, enhancing it’s functionality for automation purposes.

mqtt

If you are interested you may want to have a closer look into this github repository:

1 Like

If I tie a PIR or proximity sensor to the Pi, would the app be able to wake up the screen?
If not, is it something on the roadmap?

Technically, it is possible to connect some additional sensors directly to GPIO and trigger the wlopm --on * command (which is used to turn on the screen), but that would require wiring and custom programming.

The screen can be put into sleep mode using the Raspberry Pi’s built-in screen blanking function (e.g. blank screen after 10 minutes) and woken up again by tapping it once. Alternatively, the method below can also be used.

With the mqtt integration it is possible to turn the screen on via Home Assistant. The only thing required would be a Home Assistant automation and an existing presence or motion sensor. e.g when presence is detected, turn the screen on, turn off when no presence or after some timeout.
Additional the screen brightness may also be adjusted if the sensor provides some light (lux) measurements. e.g. dim the screen brightness down at night.

Using mqtt via an existing sensor is a good idea. I will look into that.

And thank you for the build :+1:

1 Like

Awesome kiosk application. Works way smoother for me than chromium in kiosk mode.

However, since I am using a Pi 4, I am unable to use/test the MQTT sensors. For testing, would it be enough to alter the model filter and remove the 5 in it so it is “supported” on all Pi’s?

1 Like

Yes, please try this. :clap:
I’m pretty sure it should work with RPi 4 and Touch Screen 2, but I’m unsure about Touch Screen 1.

Please let me know if it works and feel free to do a pull request to make this project support more devices.

Alright. So I did some testing… I am using an HDMI-Display so the brightness and display status won’t work for me. So I commented out all function calls for getting this data and removed the model number from the getModel() function to allow other Pi’s than the 5.

This seems to work for me. Of course, the display is not controllable at the moment but for me that would be enough. A bit of code optimization is needed as well as in my fork at pdsccode/touchkio: Home Assistant Touch Kiosk for Raspberry Pi with the official 7" Touch Display. the display is completely out of order.

Will do a pull request when I optimized the code.

Update: Just opened a PR to allow other Pi models and Displays: Feat: Allow other displays and Raspberry Pi models by pdsccode · Pull Request #2 · leukipp/touchkio

With the help of @pdsccode, this project now supports a variety of DSI and HDMI touch displays. Thanks for that! :+1:

Check out the latest releases if you want to try it out:

1 Like