DIY Touch Screen Alarm Control Panel

I’ve created a touchscreen panel to arm/disarm Home Assistant’s alarm system. It’s powered by a Raspberry Pi, 3.5" touchscreen display, a custom Python-based application, and MQTT. It uses the new Manual Alarm with MQTT Support introduced in version 0.50.

Build details: https://www.hackster.io/colinodell/diy-alarm-control-panel-for-home-assistant-ac1813

Video: https://www.youtube.com/watch?v=2Lei8n_aSJI

Source code: github.com/colinodell/mqtt-control-panel

Hope someone finds this useful!

20 Likes

This is awesome! Bookmarked for later as I would definitely like to build this. Thanks for sharing :slight_smile:

1 Like

Really like this! Thank you for sharing @colinodell

At the moment by my front door I have an MQTT RFID sensor to disable and enable the alarm in HomeAssistant. I also have a modified BRUH sensor that’s connected to a reed switch on my letter box and also my front door and a push button by the front door that triggers an “away” Automation. I then have a Google Chromecast Audio connected to a speaker for TTS notifications. I also have a relay (MQTT) that operates my door bell and exposed as a sensor in Home assistant l.

I’m wondering if I can roll all this into one on a PiZero, I’ve added solution after solution and now ended up with too many devices in one location in my opinion.

Might try and add all of it to a pi running this alarm panel!

2 Likes

Hi,

I did get the alarm panel up and running today, but when i start the python program i the touch function stops working. So i cannot type in a code or so, but if i arm/disarm from HA i see the changes in the alarmpanel.

What could i been doing wrong?

@Daniel_Gronlund make sure you have SDL 1.2 installed as other versions do not properly support touchscreen displays: https://learn.adafruit.com/adafruit-pitft-28-inch-resistive-touchscreen-display-raspberry-pi/pitft-pygame-tips#ensure-you-are-running-sdl-1-dot-2

@colinodell WOuld this work with the adafruit 7’’ touchscreen. I have one laying around and thought i would ask. if not i think, a new 3.5 would suffice.

Looks like the screenat 3,5" Will not work togheter with Pie 3.
Im waiting on my pi zero

Hi,

Nice setiup!

but i dont like the pir on the device. I have a motion sensor in my hallway were i would like to install my screen. Is it possible to use this sensor in HA to send a mqtt message that will turn on the screen?

Can you post the MQTT RFID code, its on esp8266 right?

The PIR sensor is completely optional. I think your solution will work as long as HA supports that.

I followed all the instructions and it works fine on my Rpi 3 with the Adafruit image but on my Zero W with jessie lite I get the following error (SDL 1.2 is installed with the linked shell script):

Initting...
Setting Mouse invisible...
Traceback (most recent call last):
  File "main.py", line 119, in <module>
    ui = UI('images/bg.png')
  File "/srv/alarmpanel/ui.py", line 25, in __init__
    pygame.mouse.set_visible(False)
pygame.error: video system not initialized

The program launches when I sudo it but the touch doesn’t work.

I tried the same instructions with the full jessie raspbian image and was able to use the touchscreen in the GUI. Still got the same error and was able to launch it with “sudo” but again, no touch input

I got it to work eventually by using a modded Rpi kernel with built in TFT support:

https://whitedome.com.au/re4son/sticky-fingers-kali-pi/#TFT

Vanilla Jessie lite install -> ran the commands on that site -> Ran the SDL 1.2 script -> apt-get install pip ->apt-get install git.

Requirements.txt gave some errors so I had to install pygame with apt-get install python-pygame and the other requirements manually with pip-install.

Next up is adding an RFID reader. I ordered this one on eBay and it should arrive soon.

I’m getting the same error message and same when sudo, when running from sudo the panel will update if I arm from HA, but does not update after that,
so if I arm the alarm in HA the status text updates but not the buttons, no further inputs in HA are reflected by the status text or buttons.

Cool, i Will try with that image

Yes it is, just shared it here:

1 Like

This did not work for me. Did get same error even after mod. kernel.
Im gonna try some more the day after tomorrow.

Maybe we should make an working image for RPI3 when we get it all to work?

@colinodell
Everything worked up until this below:

After I run the pip install -r requirements.txt, I get this error below can you give me some assistance?

pi@pizeroalarm:/srv $ pip install -r requirements.txt
Collecting paho-mqtt==1.3.0 (from -r requirements.txt (line 1))
Using cached paho-mqtt-1.3.0.tar.gz
Collecting pygame==1.9.3 (from -r requirements.txt (line 2))
Using cached pygame-1.9.3.tar.gz
Complete output from command python setup.py egg_info:

WARNING, No "Setup" File Exists, Running "config.py"
Using UNIX configuration...

sh: 1: sdl-config: not found
sh: 1: sdl-config: not found
sh: 1: sdl-config: not found

Hunting dependencies...
WARNING: "sdl-config" failed!
Unable to run "sdl-config". Please make sure a development version of SDL is        installed.

----------------------------------------

Command “python setup.py egg_info” failed with error code 1 in /tmp/pip-build-vA 6G8L/pygame/

I confirmed I installed the SDL 1.2 via the : https://learn.adafruit.com/adafruit-pitft-28-inch-resistive-touchscreen-display-raspberry-pi/pitft-pygame-tips#ensure-you-are-running-sdl-1-dot-2 and the install went throguh correectly, but i still get this error. Any help would surely be appreciated.

That’s really impressive :slight_smile:

I now know what I am doing at the weekend :slight_smile:

I bought this screen from AliExpress but haven’t been able to successfully install it either on my PiZero nor my Pi3, any one has the same screen?

If my home assistant is configured and running on a Pi3, can i use a few Pi Zero with display all working together? having the Zero’s to activate or disarm at various locations in the house.