X10 Home Automation with SMS

01 Feb 2010
Posted by gerry

I am currently building a house, and as such, have a great platform for implementing all the things I have dreamt of but could never manage to achieve in a rented house. Apart from finally having the spaghetti finally embedded in the walls and floors, and having almost enough power and network sockets (you can never actually have enough, right?) I can experiment with centralising control of the house and accessing home telemetry through my phone.
So... walk before you can run, right? I was discussing all of this with my builder who mentioned that he'd always wanted to be able to SMS his heating system to get it to turn on an hour before he gets home or whatever, and asked if I would be able to do it for him. Great! A testbed for the grand plan!
Being a Linux admin, I generally eschew embedded solutions for linux hosted ones, and in this case, hosted on suitably small hardware... the Acer Veriton. This little box is basically an Acer Aspire One with no keyboard or screen. Powered by an 1.6GHz Atom and containing 1GB of RAM and 160GB HDD, it's a decent little box for many purposes, including general computing, and drawing only 20W of power is perfect for an always-on system.
The system was planned as a couple of scripts polling the GSM dongle via the gnokii toolset and parsing out commands which would be passed to the heyu commandline tool which drives the Marmitek CM11 X10 controller.
Older styles of GSM dongle appear to Linux as a couple of USB ttys, which will accept AT commands and the like. The gnokii toolset simplifies this and allows SMS to be sent and received from the commandline. gnokii is available as a Debian package, so that made things as painless as it is possible for software installation to be; sudo apt-get gnokii-cli and 30 seconds later it's done. I then edited /etc/gnokiirc and saved it as .gnokiirc in my home directory.
The CM11 has a USB connector which also shows up as a USB tty. The heyu toolset needs to be downloaded and compiled, but it's a painless experience.
I built the eeePC version of Debian 5 on the Veriton booting from the SD, which had the netinstall image dd'd onto it. I then installed the usual suspects; vi, sudo and build-essential, followed by gnokii and heyu (which had to be compiled).
The CM11 controls 4 X10 relays, which are ganged with the original relays to allow
The scripts that run this whole thing were developed specifically for this site, but could easily be modified to handle different situations and functionalities. They are very much alpha version and there is absolutely no warranty, either explicit or implicit. That being said, I have made it available under the GPL, so it is open to copying, modification and everything else the GPL permits. It can be downloaded from Sourceforge.

 Login to post comments