gkdv - geek articles
GKDV - Useless proofs of concepts ¯\_(ツ)_/¯

Useless proofs of concepts ¯\_(ツ)_/¯

Articles geek en français Articles in english

Make your own alarm system with your raspberry pi

April 7, 2019

A konyks senso with a raspberry pi and… You have now your diy alarm!

What you need

About the konyks senso sensor

The konyks senso sensor is basically a door opening sensor. It should work with ifttt, google home and alexa. However… I tried to configure it on ifttt, but only the “door closed” event is triggered, not the “door opened”. So… I thought about how to use this new toy with my awesome raspberry pi. And… surprise: the sensor never answers to ping, except when an event is triggered. It means that when the door is opened, the sensor wakups and answers to ping. And that is what we will use here.

Let’s code

You can find a simple proof of concept sourcecode on the Raspberry-pi-alarm repo.

Simple installation

$ git clone https://github.com/gpenverne/raspberry-pi-alarm.git  
$ make install  

Configure it!

Open the listener.py file: you have to edit the line 11 to put your chromecast name:

chromecast_name = 'my-chromecast-name'  

Launch it!

$ make start  

Explain it…

The make start command will start a simple static file server (using the python3 http.server library), and launch the listener.py script. This script will check if the sensor answers to ping, and will play the alarme.mp3 sound file on the chromecast.

To conclude

The repository is only a proof of concept, I have a custom version to turn on/off the alarm using google home, and to stop the alarm. But it’s a very customised version ;)

Let's twitt about it!

When you click on links to various merchants on this site and make a purchase, this can result in this site earning a commission.
Affiliate programs and affiliations include, but are not limited to, the eBay Partner Network and Amazon.