Flattr this  

Categories

Archives

Elsewhere

     

QR Code

QR Code

My Home Automation System

The Intelligent Home

I first started experimenting with home automation in 2002 with an X10 CM12U computer interface and a handful of light and appliance modules and it has grown since then.

I have control of most of the lights around the house, several appliances, AV equipment, fans etc. as well as monitoring of power usage and temperature. Everything is controlled from a central server and operated via a web interface or wall mounted and handheld RF controllers. The X10 back end and the main web interface is built around a heavily modified installation of the Perl based Misterhouse package which allows me to build up macros and base events on various inputs such as whether I am at home or not. Other additions include sending a text message to my mobile phone if someone presses the doorbell when I am out, CCTV, VoIP, whole house audio and much more also play a hand in making the automated home, read on for a more detailed explanation.

X10 Automation

AM12UX10 is a powerline carrier technology that allows devices throughout the home to communicate with each other via the existing mains wiring in the house, this makes it possible to control lights and power for many other electrical device from anywhere in the house with no additional wiring. It’s quite old technology (originally developed in 1975) and better solutions are now available but X10 remains cheap and easy to deploy and I have quite an investment in X10 equipment now so that’s what I have stuck with in the main.

A number of X10 modules are installed around the house to control lights and appliances plus several wireless wall controllers and hand held remote controls, there is also a mini controller by my bed and  motion sensors at the top and bottom of the stairs. A CM12U computer interface is connected to a Debian Linux box running my heavily modified version of Misterhouse.

Misterhouse – Perl based house control software

The Misterhouse web interface offers easy point & click operation of X10 controlled appliances & lights but Misterhouse is more than just an X10 control system and has support for a huge array of automation, communications and security equipment. Being Perl based you can easily code your own events, macros and integrate it with other systems etc.  I’ve tweaked it to my needs a lot over the years and it doesn’t look much like Misterhouse now.

I have several macros set up so that on arriving home I can, for example, press the ‘home’ button on the entry/exit wall controller (an SS13E) which causes the computer to turn on the audio amplifier and welcome me and announce if I have new email. On leaving the house I press the ‘away’ button and all X10 devices are turned off. This also allows Misterhouse to base events on whether the house is occupied or not. Other macros include a ‘going to bed mode’ which turns all the ground floor lights and the amplifier off and turns on the stairs and main bedroom lights.

Controlling the system

Most of the control is done via the web interface these days. I have a couple of O2 Jogglers running Ubuntu, these are 7″ touchscreen devices in the style of a digital picture frame and make ideal HA controllers. Of course I can also access the web interface from any computer in the house as well as my Android phone or tablet. Elsewhere in the house an 18 button X10 RF remote control or one of the 3 button SS13E wall switches allow remote control of various functions. I can also pick up any phone extension and dial certain extensions to turn lights & appliances on and off.

In the hall and at the top of the stairs are RF motion sensors with built in light sensors that turn the landing/stairs light on for one minute if it is dark when it detects movement.

The web interface also acts as a central hub for all the other things in the house that I can control via the web,  CCTV, music playback, DAB tuner, TiVo, power and temperature monitoring,  Bittorrent downloads, UPS Status, DD-WRT Router config, Xbox Media Center, Bandwidth Stats and so on.

Out of the House Control

If I am out of the house I can log in to the web interface using my Android phone or from any other internet connected computer using http, https or ssh. Also, when I dial home from my mobile I get a menu which allows me to listen to my voicemail and to turn lights & appliances off by dialling extension numbers just as I can internally.

Door Bell

Originally the door bell was based on a modified KR19 RF keyfob with a standard door bell push button connected to the two traces on the pcb that operated button 2 ‘on’. Pressing the doorbell then sent an X10 signal to Misterhouse which announced through the speakers that there is someone at the door and logged it to a file. When I was out (known from the entry/exit status) it also sent an sms text message to my mobile phone using the now defunct vgsmail.

In 2011 I replaced this system with a Nanode based system that sends a message to Twitter when the doorbell is pressed, I have twitter set up to send me text message when that account tweets me @nathanchantrell and I have customised the text message notification to be a doorbell sound. The message also includes a link to view my front door camera so it’s only a tap away. I haven’t implemented any status to change what happens when I am in or out of the house on this one yet. You can read more about the Twitter Door Bell here.

Power Monitoring

I used an OWL Home Energy Monitor system to display power usage for a few years, I also had the USB receiver which I used with the Electric Owl software to provide graphs, this system left a lot to be desired so I was very happy to discover the OpenEnergyMonitor project and in 2011 I built my own energy monitor system based on their design, you can read more about that in this blog post. I subsequently went on to build several wireless graphical displays for this which are becoming more a part of the home automation system in general. You can read more about the first display I made here and the newer touchscreen one with colour changing RGB backlight here.

As well as being displayed on these graphical displays the data is uploaded via the Nanode base station to the excellent EmonCMS web interface which provides some superb graphing and visualisation options. I also pull the data back from its database for use in several places within the Misterhouse web interface.

Temperature Sensing

For many years I used a serial port adapter and two DS1920 temperature sensor iButtons (one indoors, one outdoors) to log the temperature which was graphed using gnuplot and also used to turn the fan in my computer area on and off depending on the temperature. Since playing with the OpenEnergyMonitor stuff I have gone on to develop several wireless temperature sensors using the same basic system and expanded this to cover most of the house, here is my design for one using an ATmega microcontroller and another using the ATtiny microcontroller, as well as displaying the temperature on the graphical displays the same Nanode base station used for the power monitoring is used to upload the readings to the EmonCMS web interface. From there is is also pulled down to a status display that I usually have displayed on one of my monitors and into the status line on the Misterhouse web interface.

For too many years it has been on the “To do” list to connect an X10 module to the central heating thermostat input so that the HA system can also control the heating based on the temperature information, I might actually get round to it one day.

CCTV System

CCTVThe CCTV system consists of one IP camera and one wireless camera and four wired cameras connected to a cheap TE104 4 channel Digital Video Recorder card in the HA server. Camera one is a wireless colour camera with night vision, it faces down the front path from above the front door. Camera 2 is a mono camera mounted inside the front window giving additional coverage of the front door. Camera 3 is a colour IP camera in an upstairs window giving a view of the street outside and cameras 4  and 5 are both wired colour cameras with night vision, one giving a view of the rear yard and back door, and the other an internal view of the computer area.

The software I’m using is the Linux based Motion package which has motion detection, live streaming, mpeg recording and much more. The cameras are only recorded when there is motion which is very handy and saves a lot of disk space. The web interface for this is one I developed myself and allows viewing of single live cameras, a live quad view or recorded events. I have a dedicated 12″ monitor to view this in the area where my main computer is (where I spend most of my time) or I can pull it up on any computer, on one of the Jogglers or on my phone or tablet.

Telephone System

In the very early days I used an external Pace Voice modem and VOCP running on Linux as my voicemail system but in 2004 I switched to Asterisk, the open source VoIP PBX.

I’ve got a Digium FXO card for the connection to my PSTN line and the phones are a Grandstream BT-100 IP phone and pair of DECT cordless phones connected via a Grandstream Handytone FXS gateway and a Sipura 3000 FXO/FXS Gateway or I can also connect from my Android phone if need be.

I can dial out through several VOIP to PSTN services or PSTN from any phone and when a caller leaves a voicemail message it is encoded as a wav file which is then emailed to me along with the caller ID.

Asterisk is very powerful and has huge potential for home automation, features include music on hold, call parking, speaking clock, alarm calls and so on (Asterisk features). I’ve also got a load of extensions set up which allow me to control X10 devices from any extension, for example dialing 21 would turn the lounge lights on, dialling 20 would turn them off.

Caller ID

Caller ID is handled by Asterisk and is passed along to any capable phone with the Grandstream IP phone also reading it out.  For a few years I used a TV Messenger Caller Display unit to overlay the caller ID on a couple of TV screens but its composite in/out means it is no longer in use, it didn’t do much for the picture quality either, nice idea but overall not brilliant.

TV & Audio

The main audio amplifier is located in the living room next to the main TV and can be powered on or off via X10. This feeds sound to four sets of speakers covering the ground floor, currently there is a separate amplifier upstairs but I plan on connecting the upstairs speakers to the main amplifier at some point. All audio goes via my main Linux PC before reaching the audio amp so that system sounds, email announcements etc can be mixed in over the TV or music sound. This also means that I can control the volume and mute inputs etc from the web interface or via the X10 remotes.

I have a four output TV distribution amplifier which feeds video from a UK Series 1 TiVo box (using AltEPG) with a TurboNet card and a digital satellite box (a sub-less sky box). This then outputs to the main TV in the lounge, the TV tuner in my main workstation PC where I watch most of my TV from and the bedroom TV. Also connected to the main TV is an Acer Revo running Xubuntu and XBMC and I have a USB DVB-T tuner plugged into my main PC.

Despite all that I actually listen to the radio a lot more than I watch TV and usually use a DAB tuner connected to my main amplifier, to control this from anywhere in the house I built a Nanode based infrared controller for it. This gives me a web interface to turn it on or off and select any of the 10 presets.

Music playback is exclusively in the form of MP3, using Banshee on my main PC (with control also available via a web interface) or from XBMC.

Computer Network & Servers

This is much simpler than it used to be, the network is a mix of 100 Mbit/s wired & 802.11b/g wireless and the home automation server itself is nothing fancy, currently it is a 3.2GHz dual core Pentium E5800 with 2Gb RAM running Debian GNU/Linux. A 2TB NAS backs everything up daily with an offsite backup rotated via external drives.

Security

I have a stand alone professionally fitted hardwired security system with communications, I won’t be going into any more detail here for obvious reasons but needless to say as I have a background in security I don’t have any worries on this score.

Barcode Reader

Barcode ReaderI have a Datalogic DLC7070-M1 barcode reader with the keyboard wedge interface that was bought on a whim many years ago, I did put together a database to keep an inventory of food & drink so I can do automated shopping lists a la icepick.com, simply scan items before throwing away the used packet and you have a computer generated shopping list. This was one of those things that was fun to set up but never actually got used.

The Future

I was surprised when updating this page how many of the things that used to be in this section were actually accomplished over the intervening years, the few left are:

  • Heating Control - I already have several temperature sensors so the next logical step is X10 control of the combi boiler via the thermostat connection. This will give much better control of the heating than the built in timer and will allow features like a ‘boost’ button on a remote control to tell the heating system to stay on for an extra hour if I’m staying up late.
  • Washing Machine Monitor I frequently put a load of clothes in the washing machine and then forget about them. It would be useful if I could have an alert when it has finished its cycle and a reminder if it isn’t opened within a certain period. Two non-invasive methods spring to mind to detect when it is on/off, a current sensor or a light sensor to detect when the power light goes off.

Home Automation Links:

UK Home Automation Suppliers:

 

TwitterFacebookRedditDiggStumbleUponDeliciousShare