Home Automation Reboot
December 4th, 2016

Module When we moved to our current house about four years ago, I tried to rebuild a modest home automation system around a newly purchased CM15A. But I quickly ran into problems: power receptacles on different phases, distances too great for the wireless controllers, incompatibility between lamp modules and CFLs, the CM15A was a dud and so on. And then disappeared and I switched from Windows to Linux So I more or less gave up. We used what was working: seven X10 lamp and appliance modules, two X10 receptacles, two old Radio Shack plug ‘n play controllers and two wireless transceivers and three wireless controllers. When leaving the house for an extended period, I would "program" the controllers to turn on lights as if we were home. That was the extent of our home automation system: basically, I had remote controlled lamps with no "intelligence" to it.

SonoffCurrently, home automation has become fun again. News about the ESP8266; cheap, Wifi based yet compatible with the Arduino looked interesting. Then came ITead’s Sonoff: basically a small package containing an ESP8266, a power supply and a relay to control a light or appliance and local switch at less than half the cost of a lamp module from X10 including shipping costs all the way to our tiny village near Moncton, New Brunswick (Canada).

I ordered three and they arrived a couple of weeks ago. There is free (but not open) software, eWeLink, to control the switch. Unfortunately, the app can only be installed on telephones and it uses a cloud service. Since I don’t have a smart phone, I borrowed one, installed the software, and quickly got excited by the possibilities afforded by that switch. And the news keeps on getting better: I managed to install the software on an Android tablet, Pete Scargill showed how to connect a FTDI cable to reprogram the device. And it seems that all sorts of libraries are available including Theo Arends’ which adds MQTT (machine to machine protocol) and OTA (over the air updating). I am impatiently waiting for a 3.3 volt FTDI cable.

While waiting, I am investigating altering one of the Sonoff switches to control my garage door. More on that later but it certainly looks feasible. And I have had time to look at home automation software that would allow me to take care of the following scenario: send notifications at regular intervals if the garage door is open and close it after a certain interval unless I have set a software flag to disable this and close it at dusk no matter what. Of course there is more I would like to do.

There are so many home automation applications, it’s hard to decide which to choose. Even when limiting one’s self to open source software capable of running on a Raspberry Pi, there is quite a few choices. Previously, I looked at MisterHouse, Heyu, OpenRemote… Now I wanted a modern home automation application that runs on a Raspberry Pi, does not involve a cloud service, that is compatible with MQTT (to handle reprogrammed Sonoffs), and can control my old X10 devices using a CM11A or CM19A and, eventually, control newer devices using Z-Wave, ZigBee etc. A first look at openHab was not conclusive. Later, I may try it again when the documentation better reflects the new version. I then moved on to Home Assistant and did setup a passive system (changes made manually to devices are not reflected in the home automation application) using the CM19A. It looked very interesting and remains a contender mainly because of the plethora of devices it can control. And it has a very pleasing interface. Finally, I moved on to Domoticz. After a few days of fiddling, I managed to get a system working that controls all my X10 modules using a CM11A and CM19A. It was passive but a second try improved things considerably; the system is two way but, unfortunately, dimmer switches reached by the CM19A are treated as on/off switches only. Nevertheless, It looks like a system that, because of MQTT, will be able to handle reprogrammed Sonoff’s to take care of the tasks mentioned above.

Here is a description of how I managed to install my old X10 hardware in Domoticz running on a Rapsberry Pi.