Skip to content

alertR: dbus and xbmc notification client

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: Introducing alertR: Open-Source alerting system (with video)
* Blog article: alertR: rule engine (with video)

Introduction and motivation

Since I published this project, a lot has changed and a lot was added. Two things I added since the last post I wanted to introduce here. First of all, the dbus notification client. alertR was used during the 2014 CTF (Capture-The-Flag) to monitor all services that we had provided. Since a push notification would be a great asset in maintaining the CTF, I wrote a client that sends notifications on the screen via dbus. It went so great, that if a service went down we noticed it shortly after. The feedback that was given to us after the CTF was astonishing. One point of the feedback was that it was hardly noticed when a service went down because it was up again almost immediately. I can not claim that all the work in monitoring was done by alertR (for example because some authors did not write a watchdog script for it), but it did it part in it.

The second thing is the xbmc notification client. Regularly I did not hear my door bell at home when I was in the living room watching a movie or hearing music via xbmc. So I thought to myself: "I want alertR to monitor the door bell". Most solutions I found were something like replacing the door bell by a Raspberry Pi. But I did not like this solution. First, the door bell does not work if the network or Raspberry Pi is down. Second, I do not own this apartment so I do not want to make major changes in it (because I will not live in here forever). So I made a circuit (with some help of a friend of mine and Google searching) that watches the door bell by connecting it to connect to the Raspberry Pi (this is the reason why I added the ability of monitoring GPIOs via interrupt to alertR). Now if someone rings the door bell, the video/music on my xbmc is paused and a notification is displayed. With this, I do not overhear the door bell :-)


Before I tell you, how I did the circuit for the door bell I want to present the notification clients to you via a short video. Please have the subtitles activated to get a description of what I am doing and what is happening.

How does it work?

The problem on how to connect your door bell to the Raspberry Pi is that the door bell works usually with AC. In our case (and the usual case from what I can tell from Google searching) the door bell is powered by 8 VAC. The AC first have to be converted to DC before we can use it. The following schematic show you how I did it:

This circuit was copied from (german link) and slightly modified. The four diodes are used to convert the AC to DC. Because the Raspberry Pi GPIO is operating on 3,3 V DC, a photo-coupler is used to disconnect both circuits from each other. The GPIO of the Raspberry Pi is configured on interrupt and therefore every change on the GPIO will be noticed.

One problem arrives with this circuit which I first realized when I had it already finished. It is very sensitive. When I plugged in a vacuum cleaner, the interrupt was triggered. As a software bypass, I added a counter which counts the number of interrupts that occur in a short time frame. Because of the bouncing when you use the door bell normally, I get more interrupts (usually over 6) than from a vacuum cleaner (usually under 4). Therefore, I fixed this with a little workaround on the software side. Since then, I never had no false positive notification triggered again.

Final words

I finished the circuits and needed software a long time ago but did not find the time nor the motivation to make the video, create the circuit image and write this article. If you are interested in this project, you should watch the github repository. There I regularly add new features and fix found bugs.


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.