DIY home alert system
Last year Andre Pawlowski started work on a home security project. A friend of his had been burgled, and he thought an open-source client/server DIY home alarm system would be a good idea.
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.
Andre ended up with a system called alertR that he calls a “unified alerting system” which works with the client/server model he wanted. But why stop there? AlertR has gone a long way since its beginnings as a home alarm system; he’s integrated it with other systems in the house to the point where it’s become a complete home automation and notification system. So it can act as a watchdog to check your online services are running, tell you the doorbell is ringing when you’re playing music that’s so loud you can’t hear it, turn your devices on and off to order, alert you when a water leak sensor is triggered, monitor your smoke alarm, tell you if your server is pingable, watch to see whether the door and windows are open – there’s no limit to what you can add to the system. Andre says:
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.
Here’s Andre’s video intro to the system. Please turn on captions; Andre has used them to explain what’s going on.
Best of all, the system also incorporates an events-driven rules engine. The engine means you can chain rules together so you can have a sequence of rules which have to be fulfilled in a specific order and in a specific time frame. One rule can consist of different rule elements that are bound together by a boolean operator.
Doesn’t make sense? Let’s imagine that every morning, you like to listen to a particular radio station throughout the house while you’re getting ready for work; but your start time varies, and on some days you might not be at home at all. This means that triggering your media centre to start playing at the same time every morning won’t work (although it can do that too, if you want it to). Instead, the system can watch for things that you do every time you get ready – opening a specific drawer in your bedroom within a certain number of seconds of turning the kettle on in the kitchen, say – and turn on the media centre, tuned to the right channel, when those rules are satisfied. Speakers in every room? The system can use a PIR sensor to tell which one you’re in, and move the music around the house to follow you.
The system comes with a nice notification client, so you can see what’s going on in your house using your mobile device.
It’s also configured so you can have alerts pop up on other devices you might be using. There’s integration with Kodi (which was still XBMC when this was being developed) for notifications; here’s a video to demonstrate. (Please turn the captions on again.)
The project is open source, so you can replicate it in your own house. Check out the GitHub repository, the Wiki, and Andre’s own blog posts about alertR.
You’ll be unsurprised to learn that we absolutely love this project. This is definitely one I’ll be using at home; let us know if you’ve got similar plans in the comments!
Nice project. I imagined being able to do something like this in my house when I was a kid, and it is nice that such a project is now within reach.
That is really cool. I like things that you change it the way you not like iOS (I like the devices just wish there was an easy way to have more control ;) )
Very slick! Shows how plugging together open-source components allows customisations (pausing the video when doorbell rings – brilliant!) that a commercial system would never be able to offer :-)
I guess this could also link in nicely with e.g. https://www.raspberrypi.org/lego-model-smart-home/ and https://www.raspberrypi.org/internet-doorbell/
It’s fun to see i’m not alone on the topic :) I’m also doing such system using JSON-RPC clients and servers, probes and RF wall plugs, with a PHP mobile-oriented interface :) I must look at this project when i’ll be at home and see what each one can bring the other !
Great Idea, would like to see the use of thermostat and heater/ac vents for zone heating and cooling also attached so that only rooms being used would be heated or conditioned. Instead of an alarm a local circuit would close off unoccupied rooms allowing airflow to occupied rooms. Savings would be significant. Thermostats would be set by phone interface for pre conditioning home prior to occupancy. Would need a clock interface like a smart thermostat
WOW!!! This is cool!
Nice work, but can you explain what it does that some of the existing HA/security software doesn’t, as I’m currently looking to change my HA software?
I’ve been using “misterhouse for over 10 years, and from research so far expecting to replace it with openhab on a Pi. They both seem to have the same capabilities but a larger and more active community developing and supporting them, and the Pi is one of the platforms right at the top of the openhab homepage.
I’m right behind the idea of good interaction between all the different classes of sensors (I use X10, RF, IR, various serial protocols, Weeder I/O boards, PIR sensors etc etc etc) and defining rules to control things, but I’m not sure what this does better than some fairly well established open source alternatives?
If you want home automation, stick to openhab. I designed alertR as an alarm/notification system. It does not send/process values like temperature values from a sensor. Though, it can handle triggered alerts because of the temperature rising above a threshold.
But I would suggest to separate home automation from home security. When you take a look at openhab, the core is over 30 MB of Java code. Despite my personal distaste for Java, the code base is just too large in my opinion. They try to support a lot of protocols (and from what I have seen they are doing a great job there). But when it comes to security I prefer smaller and simpler things. That is the reason the clients of alertR have the actual logic to decide to trigger an alarm (and not the server). This way, each client can exactly do its job and has the actual code for its job (and not the code for all jobs).
I hope this helps.
This is great. But I wanted to point somthing out. A criminal looking at a window as an entryway will no be opening it that wat. Need a way to sense the glass being broken.
No, but a criminal will likely open a door to exit.
Cool delivery of a practical solution to a what seems on the face of it a simple need. I have been looking for a practical Pi solution to a nurse call system in a nursing home and this looks like a perfect fit (with a bit of jiggey pokery). Will have to have a play.
I read about this project I started browsing through your blog. I am very, very interested in implementing your design at my house, which is now being built and every possibility is open to me. I am no stranger to the command line and I’ve recently started GPIO programming and fiddling with electronics so I was able to understand your schematics. That’s a plus, but I’ve never gone beyond basic scripting in python, so I really hope I will be able to browse through your code and set it up. The electrician hasn’t even laid a single plastic tube for wires yet so I’m trying to gather all the possible sensors and electronics I’m going to need so that the are all neatly wired behind the plaster board before the walls are sealed. The smoke detectors for example were a really nice idea that I hadn’t thought of! Thanks! Nor had I thought of motion detectors, but hey, I’m still learning. What matters to me at this point is what I’m going to need sensor-wise and where would be the optimal place to put it, and then, quite later, I can get to connecting and testing.
Once again, brilliant job!
Comments are closed