Skip to content

Introducing alertR: Open-Source alerting system

Foreword and interesting links

alertR is a project of mine which I started in August 2014. It is an unified alerting system which is based on a client/server model. The main part is written in Python and is published as Free-Software. If you do not know this project yet, here are some interesting links:

* Github repository
* Github wiki for documentations
* Blog article: alertR: dbus and xbmc notification client (with video)
* Blog article: alertR: rule engine (with video)

Introduction and motivation

Today something about "physical security". After some friends told me that someone broke into their home, I thought it would be nice to have an alarm system at home. Later when developing it, it become clear that it can not only be used for this purpose. It can be used for any kind of sensor you can think of (in a physical way for a PIR (Passive InfraRed) sensor, a magnetic switch on a window, a water leak alarm sensor, a smoke detector and so on) and is not limited to physical sensors (scripts that watch services of a host and so on). So it developed itself from an alarm system to an unified alerting system. For example it is planed to be used at the 2014 CTF (Capture-The-Flag) competition to monitor the offered services.

I created a github repository for it which contains all the code I have written so far.

How does it work?

The first thing was to search for Open-Source solutions that offer the same. But the only solutions I found were limited to just one device. For example one solution for the Raspberry Pi only works locally with components that are directly connected to the Raspberry Pi itself. I wanted a client/server based structure which can be easily extended by just adding a new client to it. I did not found anything like it, so I had to write it myself.

The clients and server communicate via a SSL encrypted connection. The clients have to log in at the server and register themselves. The server contains all the logic and processes the information the clients send to it. The clients are merely there to send information to the server or to react to a message from the server.

I looked into some commercial home alarm systems. All of them (at least the ones I looked into) had the same problem: they are limited to a count of x sensors to handle. alertR is logically not limited to a maximum count of sensors it can handle. Of course, it will be eventually reach a limit of resources at some point or the maximum value the database can store as an ID ;-). At the moment my instance handles 6 clients with 16 sensors and is not even close at being at its full capacity.


As an example I use my own instance. I used Raspberry Pis to connect switches and sensors to alertR. At the moment 3 Raspberry Pis are watching all my windows (if they are opened or not), the entrance door (if it is opened or not), smoke detectors, a water leak alarm and if my servers are pingable. When an alert is triggered, 2 sirens start yelling in my apartment and I got an eMail send to me.

To show you that it works, I made a short demonstration video. The text is hard to read on the display, but the colors are the important thing. Red/green for the alert system means it is deactivated/activated. Green for a sensor means it is in a normal state, yellow for a sensor means it is triggered. Please activate the subtitles in the video to understand what is going on there.

For the windows and door, the sensors are self made. First let me tell you that I have absolutely no clue about all these electronics stuff. I always ask a friend of mine when I have an idea that I want to build and need electronics for it. He then tells me how the circuit have to look like and when it is easy enough, I build it. And in this case it is really easy. For the sensors I used magnetic switches (link in German) with a simple pull-up circuit. Here is a simple schematic of the circuit:

The same circuit I used to connect the water leak alarm (link in German) and the smoke detectors (link in German) to alertR. But I do not like to fiddle with both of these sensors. They will lose their certification if you do so and in the worst case they do not work afterwards. So I used sensors with a built-in relais and used the relais as switch in the circuit seen above.

For the 2 sirens that are switched on by Raspberry Pis, the circuit looks a little bit more complicated, but is still pretty easy to build yourself. Here is a simple schematic of the circuit:

I used the 5V of the Raspberry Pi as power supply for the siren. But you can use any other power supply for it (for example if 5V is to low for the siren). Just keep in mind that the relais have to be able to work with your chosen power supply. But having sirens on your alertR setup does not mean they will be used for any alarm that is triggered. You can configure each sensor in the way you want. You can configure alertR in such a way, that it will switch on the sirens when a window is opened, but only send you an eMail when a server that is watched is not reachable anymore. For this alertR provides you with "alert levels" which can be thought of like categories. You can configure each alert level in the way you like.

alertR also gives you the possibility to be controlled via your mobile device. Here is a picture of my mobile device showing the alertR app:

Green means that the sensor is in a normal state, yellow means that the sensor is in a triggered state. A triggered state does not necessarily mean that an alert is triggered. Perhaps you have sensors you just want to watch via alertR but they should not trigger any alarm (for example if you use alertR just to collect the data and read the data directly from the database). You can configure each sensor if it should trigger an alarm or not.

To be able to activate or deactivate the alerting system when you leave/enter the apartment, I set up a keypad client that can be used for it:

With this client everyone who knows the correct PIN can activate alertR, deactivate it or activate it in a 30 seconds delay. The last option is handy when you want to leave the apartment. In order to not directly turn on the sirens when anyone enters the apartment through the entrance door, you can configure sensors to trigger an alert in x seconds delay. This means when someone enters the apartment through the door, he has x seconds time to deactivate alertR via the keypad (or mobile device or ...).

Some sensors should also trigger an alarm when the alerting system is deactivated. For example the smoke detector should always trigger an alarm. This can be configured for each sensor as well.

Final words

My setup is now being used for almost a month without any problem. So if you are interested in this project, feel free to use it. And if some functionality is missing that you want (for example a friend of mine wants a RFID activate/deactivate client) you can easily add it yourself. The code, protocol and database layout lies documented in the github repository. And if you want, you can add your client to the alertR repository.


No Trackbacks


Display comments as Linear | Threaded

No comments

The author does not allow comments to this entry

Add Comment

Standard emoticons like :-) and ;-) are converted to images.
E-Mail addresses will not be displayed and will only be used for E-Mail notifications.
Form options

Submitted comments will be subject to moderation before being displayed.