[NBLUG/talk] Setting up X-10 home automation

Kyle Rankin kyle at nblug.org
Sun Sep 18 15:30:53 PDT 2005


On Sat, Aug 20, 2005 at 08:24:23AM -0700, Lincoln Peters wrote:
> I'd like to use my Linux box to control a few appliances in my house, such as 
> a lamp that I use as an alarm clock (my college schedule is too complex for 
> an ordinary appliance timer to handle).  Of course, being a home automation 
> technology that runs on Linux, I'm sure that once I've set it up, I'll find 
> more wild and crazy applications for it.
> 
> However, the biggest obstacle I've encountered thus far is that I can't find 
> any place that sells all of the necessary hardware.  Radio Shack carries the 
> control modules but not the parts that allow the computer to control them, 
> and nowhere else that I've looked seems to carry any of them.
> 
> Thus, I have two questions for anyone who uses X-10 (and I know *someone* here 
> uses it):

Sorry for the late response. I just finished setting up my old X-10 system I
had set up a few years ago for my DSL modem. I run a number of services on my
home DSL line but over the past few weeks for some strange reason my connection
would drop off and only recover if I power cycled my DSL modem.  I have one of
those old X-10 "Firecracker" sets that include a computer serial adapter, a
remote control, and the basic transceiver, along with lamp and grounded
modules. There is a linux program called "bottlerocket" that you can use to
interface with this serial device, and it has a pass-through so that you can
plug in other devices after it. 

Basically I have a cron job run this script every two minutes:

    #!/usr/bin/perl

    $gateway = '64.142.83.1';
    $result = system("ping -c 5 $gateway > /dev/null");
    unless($result == 0){
      print "disconnected\n";
      system('br --port /dev/ttyS0 A4 OFF');
      sleep 1;
      system('br --port /dev/ttyS0 A4 OFF');
      sleep 30;
      system('br --port /dev/ttyS0 A4 ON');
      sleep 1;
      system('br --port /dev/ttyS0 A4 ON');
      print "reconnected\n";
    }

It pings my gateway and in the case of a failure if will attempt to turn off my DSL modem two times, wait 30 seconds, then turn it back on. It prints "reconnected" so that since cron will email any output to you, I get a nice backlog so I can track how often this happens.

> 
> 1. Where do you buy X-10 hardware?  Is there any place that sells it locally?  
> (I'd like to have it installed and configured by Wednesday, if possible.)

Radio Shack actually stocks a pretty decent array of X-10 devices. HSC used to afew years ago but they've since stopped carrying anything. Fry's also has a lot of X-10 hardware if you need anything fancy (like some of the wall switches and such).

> 
> 2. Any caveats I should know about regarding X-10 controllers?  I'm already 
> aware that it's a good idea to send each command twice in case it got 
> corrupted the first time, and some devices have a tendency to create 
> electrical "noise" that interferes with the signals.
> 
> 
> -- 
> Lincoln Peters
> <sampln at sbcglobal.net>
> 
> hangover, n.:
> 	The wrath of grapes.
> 

The main thing I'd advise other than sending the signal twice, is to possibly pick some other house code than 'A' just in case one of your neighbors has the same set of devices. Also be sure to test everything out with the remote control (if you have one) and your br program a few times. One nice feature of having all of this on a linux system is that it's really simple to set up cron jobs to turn on lamps in your house in the evening if you are away on a vacation, and then turn them off around bed time.

-- 
Kyle Rankin
NBLUG President
The North Bay Linux Users Group
http://nblug.org
IRC: greenfly at irc.freenode.net #nblug 
kyle at nblug.org



More information about the talk mailing list