Controlling Home Lighting with Clipsal C-Bus

Jim O'Halloran • January 18, 2004

linuxconfau-2004

The last talk before lunch was LinuxSA and Linux.Conf.Au organiser Geoffrey Bennet's talk on "Controlling your home lighting with C-Bus". Geoffrey is a very bright guy who I've known since school, and the fact that he's spent quite a bit of time reverse engineering his home lighting system doesn't surprise me in the least.

Clipsal C-Bus is a home automation system allowing control of lights and power points via a programmable system. Rather than being connected directly to the lights, each switch is connected to a light via the Relay/Dimmer unit. This means that switches can be reprogrammed to turn on different lights, or do different things. Although the Windows software doesn't allow it Geoffrey's Linux software can also turn on and off the lights directly from a PC.

C-Bus also allows you to connect multiple switches (3 or more) to one light which is difficult to do with conventional wiring, and also to connect several lights to one switch. You can also set up a switch (e.g. by the front door of the bed) to turn all of the lights in the house off.

Clipsal only provides Windows based software to program the C-Bus controller, which Geoffrey took as a challenge. Using sersniff he was able to see what the Windows software was sending to the controller and eventually was able to reverse engineer the protocol by hand. Essentially this was a process of correlating what the Windows software was showing on the screen with changes in the data on the wire. As noted above, his cbusd software now supports some operations that you can't do on the Windows software.

Along the way he wrote his own tool called spreech that connects any two character devices or TCP streams together in order to better be able to see what the C-Bus software was doing, and also a C-Bus simulator to help exercise the Windows software and see everything that it can do.