Before reading further... Are you looking for great Linux hosting from a company that cares about GNU/Linux? Pick Dreamhost hosting, get a 10% bonus to the disk space (and support Free Software Magazine in the meantime!)

Home automation in GNU/Linux

Or how to email your light switch with free software

Download the whole article as PDF

Write a full post in response to this!


Home Automation is anything that your home does for you automatically to make living there more enjoyable or productive. It covers many areas, including remote and timed control of lights and electrical home appliances, distributed media services, and communication. Over the last 10 years, many hardware manufacturers have presented their own proprietary solutions to these problems. Unbeknownst to them, a groundswell of developers from around the world has been providing similar solutions to the free and open source community.

In this introductory article, I will carry out a high-level review of a number of these projects to see what is already available.

Appliance Control

One of the most impressive features of an automated smart home is the ability of a computer to control your lights or to operate the power socket attached to the kettle. Naturally, this requires the addition of hardware, and the most prominent example here (with a good trade-off between cost, longevity, and flexibility) is called X10.

X10 is a protocol that places specifically-formatted high frequency power bursts onto the mains power line. Since the mains cables are connected to every light bulb and power socket in the house, a signal placed onto the power line in one place is seen across the rest of the mains supply. Consequently, a special X10-enabled power socket is able to watch for these power bursts and switch itself on or off, accordingly.

To place these X10 signals onto the mains requires a peripheral, such as the CM12U (see figure 1) which also contains a serial plug (either RS232 or USB) that is inserted into your PC. To receive these signals you can use either:

  • An appliance module that will turn a socket on or off. You simply plug this unit into the wall, your appliance into the other side, and switch the wall socket on. The appliance (such as a kettle) is then controlled by a remote X10 signal. One such unit is shown in Figure 2.

  • A light bulb attachment unit, as seen in Figure 3. It is placed in series with a conventional bayonet light socket, and acts like an AND gate. It can only be controlled through remote X10 signals.

  • Or a special light switch that replaces your existing switch and will control the light to which it is attached. This control is either by the switch itself, or remote X10 signals. This can also function as a dimmer switch, and shown in Figure 4.

Figure 1: This is the CM12U that transfers X10 signals between your computer and the power line
Figure 1: This is the CM12U that transfers X10 signals between your computer and the power line
Figure 2: This listens for X10 signals and controls whatever appliance is plugged into it
Figure 2: This listens for X10 signals and controls whatever appliance is plugged into it
Figure 3: Fitting directly into an existing light socket, this is the easiest way to add lighting control to your home
Figure 3: Fitting directly into an existing light socket, this is the easiest way to add lighting control to your home
Figure 4: This replaces an existing light switch, and is the most effective way of controlling a light
Figure 4: This replaces an existing light switch, and is the most effective way of controlling a light

Each of these devices is given an address. This comprises of a house code (A-F) and a unit code (1-16) for the individual appliance. The house code is necessary because the mains voltage to your house is often fed from the same supply as that of your neighbour, meaning your appliances would see their X10 signals and vice-versa. It is possible to buy an X10 suppressor to stop your X10 signals leaking out, but the current take up of X10 is not universal enough to be a problem—unless you live in a block of flats inhabited by geeks, it’s unlikely to be a problem in the near future.

A question of countries

NOTE: The mains voltage and frequency varies according to country, so specific devices are needed depending on where you live. Check the vendor websites carefully. The codes given in this articles are for UK devices.

Sending suitable X10 signals (through the CM12) requires software, and the current favourite is heyu. This is not truly open source, but close enough for most purposes. It exists as a simple command line utility (with configuration in /etc/heyu/x10.conf) that lets you control the lights with commands such as,

heyu turn bedroom_light on

and

heyu dim studio_light 2

These commands can be triggered from a web site, script, crontab, or command line. As an alternative to cron, you can also upload a program containing a sequence of on/off messages directly into the CM12 as this allows you to specify a set of timer events that will execute, even when the computer is off.

The CM12 gives more control over the lighting sequences in your house than a traditional timer switch, and allows you to program more realistic scenarios. For example, you can program a sequence whereby the unit switches the landing light on, waits one minute, turns the downstairs light off, waits one minute, and then turns the upstairs light on. This subtlety gives the impression of someone walking up the stairs, and switching the lights on and off as they go, which is the mark of a human, not a machine.

Don't miss out on the other pages!
1234next ›last »

Write a full post in response to this!

Similar articles

5

Do you like this post?
Vote for it!

Copyright information

This article is made available under the "Attribution-NonCommercial" Creative Commons License 3.0 available from http://creativecommons.org/licenses/by-nc/3.0/.

Biography

Steven Goodwin: When builders go down to the pub they talk about football. Presumably therefore, when footballers go down to the pub they talk about builders! When Steven Goodwin goes down the pub he doesn’t talk about football. Or builders. He talks about computers. Constantly... He is also known as the angry man of open source. Steven Goodwin a blog that no one reads that, and a beer podcast that no one listens to :)