All posts by bob

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.

So I’m totally enraptured by the new Chris Robinson track, Narcissus Soaking Wet

And I’ve been trying to decipher all of the lyrics, but I’m stuck a bit in the firs.t verse…  Great googly moogly, how the rest of it resonates, though.  The album comes out in July, if the rest of it is as good and as heavy as this, I might have to give up my worldly possessions and follow Chris around the planet.

Sour flowers grow, ripe and pink
__________ receives the day, to ______Thunder born and lightning days
Natural magic, mystic ways
The poorest known withstands the (way? weight?)
Oooh, let’s get inside (get inside)

Narcissus soaking wet, lost, but doesn’t know it yet
He has failed to see his true reality
Now he will remain a ghost
Chained to what he loves most
Cast away under pale skies
Oooh, let’s get inside (get inside)Hey baby, your temple or mine

Untethered, unbound, state of grace sold by the pound
If it falls let it crumble to the ground
Burn the commune down

How soon we forget the time that we spent
it comes at great expense, expectations and rents
Kiss the dice, let them roll, all our stories have been told
One million times, one million ways
Oooh, it’s all the same (all the same)
Hey baby, you know there ain’t no shame (ain’t no shame)

Untethered, unbound, state of grace sold by the pound
If it falls let it crumble to the ground
Burn the commune down
Burn the commune down

If there’s somethin’ you don’t know, you better ask somebody
If there’s somethin’ that you need, you better look around
If it’s love that you’re after, well you better listen
Said if you lived here, you’d be home by now

You said you’re gonna get yourself together
Get straight what you, said what you tangled up
And if you think that’s going to be easy
All I have to say, is oh, you shit outta luck
I mean look at all these pieces you’ve got to pick up
Pick ’em up.

Untethered, unbound, state of grace sold by the pound
If it falls let it crumble to the ground
Burn the commune down

Untethered, unbound, state of grace sold by the pound
If it falls let it crumble to the ground
Burn the commune down
Burn the commune down

2016 Day 1

First day of 2016 was somewhat productive as far as goals. Walked a couple of miles, played an hour of guitar, and spent time contemplating the structure of short- and long-term goals. So far I’ve got the following:

Walk or run 1000 miles this year. Today, 2/1000.
Play music 2 hours per week = 104 hours. Today, 1/104.
No smoking. Today, 1/365.
CW practice, 2 hrs per week – 0/104.

Elenco EP-130

So I impulse-shopped again on eBay, which is always a dangerous thing. This time not so much. For just $6 plus shipping, I picked up an Elenco EP-130 “Electronic Playground & Learning Center.” Of course I would have rather had the 500-in-one kit, but that one goes for over $200, so I just can’t justify it.

elenco-ep-130

I’ve always been somewhat ashamed of my lack of intimate electronics knowledge. I know a little about a lot of things, and a lot about a few things. I’ve just never given actual electronic components the proper level of devotion and practical learning time.

So I started today. Experiment #1: Woodpecker. Two resistors, three capacitors, a transistor and a transformer make the speaker emit chirping sounds.  Whoopee.  Changing the capacitors, resistors or voltage changes aspects of the chirping sounds.

Smart Pi

rpi_touchscreen_display_contents_1024x1024So I am currently in possession of a Raspberry Pi 2, along with the official Raspberry Pi 7″ touchscreen by Element14.

Today I had the fun experience of getting the pi and the screen working together, connecting the Edimax nano wifi adapter, and then installing mochad, which resulted in the successful integration of the Pi with the X10 home automation accessories I have installed over the years in various locations throughout the house.

I just realized that over 50% of the people who read my posts have no clue what I’m talking about.