Submission by Derek Kennedy: Why the Home Automation Hub? I’ve always been keen on the notion of Home Automation, but two factors put me off getting started. One, the cost of a decent HA controller (and I don’t mean a 24×7 PC). Two, She Who Must Be Obeyed hates wires running around the place.
Getting started – The first thing that was done was to create the project Wiki which we’ve used to track all ideas and work done. Time was taken to replace the Operating System on the unit with one which we have ALL of the source code for (and open source back to the community). The unit runs the BusyBox mini-unix kernel. Auto-update of firmware from our website was also implemented.
Then, we started to think about what to control and monitor. Keeping the SWMBO ‘no wires’ thing in mind, we experimented with controlling RF mains sockets via a custom built micro and RF transmitter. After some work with our ‘scope and on a MEGA8 development board, we had code to control these which are very reliable in operation and with a good range too.
Brett, my software guru friend, started to architect the core functions on the HAH. He does this stuff very thoroughly. We were keen to use ‘open standard’ protocols, so that the HAH can plug and play with other HA kit. Brett quickly found xAP – a cool broadcast based HA protocol. All ‘modules’ on the HAH are fully xAP compliant.
Custom Hardware – The link between our ‘custom hardware’ and the core router hardware is via the serial port on the router. Not many routers expose a serial port, but fortunately this model does. Next I designed a small PCB that would fit inside the router case. This adds four inputs, four relays, the RF transmitter, an LCD, an I2C bus and a 1-wire bus for reading upto 16 x DS1820 temperature sensors. We sent this off for manufacture and fortunately, the board that came back worked 1st time without any track alterations.
The HAH connects to your broadband router and gets its IP address via DHCP. The allocated IP address is displayed on the LCD, so you know where to point your browser at. My Sherline CNC desktop mill was ideal for cutting the aperture in the router case for the LCD.
The cool software – Meanwhile, Brett turned out code like a man possessed. The browser based UI started with a couple of simple pages to allow the RF remote sockets to be controlled, the values of the inputs to be read and the relays to be driven. Temperature readings followed soon after this. Pics of the UI are here. An xAP adaptor was developed to talk to our custom hardware. A Current Cost support module was developed to allow electricity usage to be tracked. Then an xAP to Pachube module allowed the unit to log all datastreams up to pachube.com Scheduled control (rather than via the UI control) was next. An xAP to Google calendar module allows the unit to be driven via events in a Google calendar. Twitter seems to be all the rage these days, a twitter module allows control of the unit via tweets. Of course, the BusyBox OS allows the sending of emails too. The unit can also send SMS messages – just plug in a Nokia phone. We have ‘Wake on LAN’ support too. Great for reducing power by having PCs go to standby until you need them.
HAH interfaces overview
Custom scripting – With all these modules in place, there seemed to be a need to allow interactions between the modules. e.g. if the temperature on sensor on goes over 25C, send an email alert; if the heater has been on for more than an hour, turn it off; when input one closes turn off all RF switches. The ‘plugboard’ module, with its easy to use scripting language allows all of this sort of thing.
Practical Use – In practice, it all works very well, solid and reliable in operation. Pretty ‘green’ because we reuse an old router that might otherwise be thrown away and it only draws 6 Watts of power, so not expensive to run. I do keep an eye on temperatures in my basement workshop and can turn heating on ahead of arriving home. I can also get a tweet if somebody leaves the fridge door open. A dawn/dusk sensor, connected to an input line, allows me to script that lighting be switched on. SWMBO is happy since the unit (with the 1-wire bus connections and the other ‘wired’ sensors) sits in the basement. The RF mains sockets mean little wiring is needed around the house.
What’s next for the HAH – Well, things aren’t so frantic now. Brett and I have lots of day-job commitments. I’m tinkering with a RF receiver subsystem idea. This would use the xAP Bridge (which Brett has already coded) to hook up to the HAH. We’ve tried to document everything in as much detail as is needed to allow others to make up their own HAH – hard to know if anybody has done this. Would be happy to hear if anybody thinks this a worthwhile effort. Messages can be left on the HAH forum or on the AutomatedHome.com comments below.