home :: ha :: software
Protocol: Jabber
I toyed with several ways of dealing with the home automation system. Misterhouse looked very impressive and
was written in Perl so easy to extend, but it also liked to take control directly itself of any hardware. I wanted
each bit of home automation hardware to have its own intelligence, it's own bot, allowing the hardware to exist
on separate machines and architectures. So I started out writing bits of custom perl for each of the bits of
hardware (with some C for things like serial interfacing which was hard for me to get to work perfectly with Perl).
I then heard about the XAP project which looked quite interesting but seemed to have a number of weaknesses - it mostly
relied on udp broadcast packets for the components to talk together (I wanted components on different network segments,
some on wireless, some on links I share with video traffic - udp broadcast packets just are not reliable enough), the other
problem was that the components already written were under a license that prohibited commercial use at all. Not that I
intend to sell this, but if I'm going to work on software I want that sofware under a BSD-style license or failing that
GPL. So my requirements were to have a lightweight messaging system ideally using XML that could run over a security
layer (for the wireless network) that I could extend and easily write a custom client for. The answer of course was
Jabber. With the Net::Jabber module I can easily write bots and clients in Perl for speed, and with the Perl Tk interface
writing user interfaces takes no time at all and they work across platform:
Linux or even Windows.
The nice thing about Jabber is that clients for Jabber exist for just
about every platform. It's simply to take the source code for a
Jabber client and add some buttons and things to make it control any
aspect of the home automation system. And if no source exists you can
simply chat to the lighting bot and tell it "lights living 18".
The plan is to be able to control this all from a wireless PDA too.
Controller: Fujitsu Point
The big test; would Perl and Tk and a Net::Jabber client run okay on a AMD 100MHz processor running in 800x600 256
colour mode? The startup time is about a minute, but then once it's done it happily refreshes the screen with no
real visible delays and sends and receives (and parses) messages without a hitch. Here are some pics from the
initial interface written over Christmas vacation 2002.
Figure 1: Lighting interface (a Jabber x10 bot)
Figure 2: TiVo interface (a Jabber TiVo bot communicating with a custom tivoweb module that
returns XML status information)
Figure 3: Heating interface (a Jabber to one-wire bot that talks to the one-wire temperature sensors,
logs data using rrdtool, and talks to the one-wire heating switch)
Figure 4: Misc stuff interface (the DSL bot talking to the cable modem and the UPS bot talking to the UPS device.
Alerts also come in here)
Figure 5: Caller ID interface (a Meteor caller id bot with pop-up pics for most of the people we know)
Figure 6: Interface to front door camera (rear only goes into the MV1000 so far)
Each hardware component has it's own bot that can be queried for status and can also be made to broadcast
status information either when something changes or every minute. The client simply parses every message
it receives and displays it in the right place. Software will be here soon.
Created: 11 Sep 2003
|