Expanding X10 security systems limits and functionality with Raspberry Pi

I was initially happy with my X10 security system years ago.  It performed all the functions of a professional security system for a fraction of the price.  X10 components generally exhibit questionable manufacturing quality, but they’re cheap enough that it’s feasible to maintain spare parts and still stay “under budget.”

As time moved on, however, and computing power became more and more affordable, I started to take another look at X10 security.  Sure it’s dated, mostly losing market share to Zwave and other players. But there are still some rock solid components in the X10 arsenal.

I originally had the Protector Plus PS561 security console, along with the original 9-pin serial interface.  At some point I upgraded to the SC1200 security console and the CM15A USB interface. The SC1200 supports 16 security “zones,” comprised of door/window and motion sensors. That is its limit, as a self-contained unit, with no expansion.  I’m going to show you how to easily improve drastically upon that, limited only by your imagination and creativity, for almost zero investment beyond the initial expense of the console, interface and sensors.

I started with a Raspberry Pi 2B, freed up when a model 3 was purchased.  I installed mochad and Jim’s CM15A controller demo http://www.eclipsehomeauto.com/cm15a_on_linux/cm15ademo.tar.gz and made sure they were up and running first.  Once I could get responses from mochad, I knew I was making progress:

# echo ‘st’ | nc localhost 1099

should return a list of detected sensors.

At first, I worried I would have to write a daemon to monitor traffic on port 1099 to detect events in real time. When I realized that that entailed programming-wise, I put it off and used a periodic poll to port 1099 and parsed the results instead.  Once the results are parsed, they can be inserted into a database for monitoring sensor status and logging details. Later, I realized that mochad includes a Perl script, mochamon,pl, which demonstrates how to poll mochad (actually, MULTIPLE instances of mochad, if you so desire) for real time results, which is what I was looking for, for triggering purposes.

This is where the game gets fun.  Without a programming platform and mochad, you’re limited to the X10 console’s interface and its limits.  Since the X10 sensors generate their own random 6-byte identifier and transmit those by RF, and mochad detects all RF transmissions received by the security device, this means that with a little bit of work, you are no longer bound to the 16-sensor limit provided by the console interface. In fact, once you get your system programmed to your liking, you can deregister ALL of the sensors from the console and have your platform with mochad doing the heavy lifting.  You can even cheat the system, apparently, and send X10 commands directly to piggyback on the security console’s alarm using the “panic” command (and hopefully “disarm” when needed — this process needs testing).

More importantly, you can write your own logic and flow, and add external interfaces.  Maybe I want to be notified by SMS on certain events. Maybe only when “armed.”  Maybe I want to be able to “arm” and disarm the system via SMS. Maybe I want to use security events to trigger other Pi units in the house to start capturing video.

As you can see, adding mochad and a Pi to your existing X10 security system can turn your system into a state-of-the-art security portfolio, limited only by your imagination and coding skill.

2017-03-18 Update: Since writing this article, I have discovered that the console is no longer necessary at all.  So you can REALLY cheat the system. WIth just a CM15A and a bunch of sensors, you can create your own customized security alerting system using mochad and a Raspberry Pi.