X10 Security and the Raspberry Pi

Like a number of folks, I was interested in expanding my X10 smarthome system with Linux.  When the Raspberry Pi became ubiquitous, I felt like that was the perfect opportunity.

At first, I thought I’d use the touchscreen and create a Smarthome interface of some sort.

I started with mochad, like a lot folks.  While watching the logs, however, another idea came to me.  You see, in addition to the usual X10 switches and lamp controllers, I also have the second-generation X10 security system, with a console, keypad, and telephone interface.  I also had the CM15a USB X10 interface, which was crucial to interfacing it with the Pi.

I was seeing the RF reports from my door and window sensors in my X10 logs.  This was exciting to me, because I always felt the X10 console was severely limited in its design.  Each sensor is in its own “zone” and you are limited to 32 zones.  Not a lot of individual thought can be put into each zone, either — the system is either armed or not, and it either chimes when a sensor reports open, or alarms, or nothing.

I decided I didn’t need a Smarthome panel at all. This was no longer a generic Smarthome interface project. This had become a Smarthome security project.

I’ll keep it short, and note a few discoveries and developments, and you can take it from there.

  • Sensors report periodically, even without intervention. They report open/closed status, type of sensor, battery status, and tamper status. Not just on changes, but periodic requests.  Useful things than can come out of this include battery change reminders and door/window left open reminders.  Finally I have a legitimate reason to put a door sensor on my garage door.
  • With mochamon.pl, the somewhat chaotic nature of the other X10 alerts (especially the non-security X10 traffic) could be harnessed and loggedj in a straightforward fashion.
  • I built a system with a MySQL backend that maintained both a status of all sensors and a log of all sensor activity, including assigning friendly names to each sensor. I configured the system to alert me via SMS when specific events occurred, i.e. sensor status changes.
  • Here’s the kicker: I unplugged the SC1200 security console to do some other work, thinking it was temporary, and while it was unplugged, I continued to receive the sensor alerts.  This was when I realized that the RF from the sensors was being received by either an RF module in another room, or the CM15a itself, and the security console was no longer necessary. This, to me, was the crucial moment when I realized I could build my own highly-functional, highly-customizable security system around fully open source software while piggybacking on the pretty decent reliability and cheap sourcing of the X10 sensors and receiver system.
  • Now I can set multiple sensors per “zone,” if I choose to define zones, and have different behaviors per zone or per sensor. I can trigger video surveillance of an area for a period of time after a sensor is tripped, or in conjunction with motion detected by X10 motion sensors. I can notify myself anytime, anywhere, by shooting myself SMS messages and even emailing photos. There aren’t really a lot of limits. I could trigger alarms, sound files, have my neighbors check things out. If I spent significant money I could even have centrally controlled locks that I could trigger.  Maybe release toxic gas, or initiate electric shocks.

putting more of myself out there