Home Automation

I've been adding lots of additional devices to my home network. In addition to the wireless wall switches and LED bulbs, I've also added an LED strip light (with 1m extension) which runs along the inside edge of the staircase between the two floors of the house. It's really neat to be able to have those lights illuminate as soon as I hit the top of the stairs and stay on for five minutes (programmed.) Enough time to don my shoes, tie my laces and leave the house, locking up after myself. And I'm able to control all the lights (grouped into "rooms") from the Hue app running on my iPhone and iPad. Voice control is possible via Siri on the iPhone as well my Amazon Echo Dots.

History

A little historical perspective is required at this juncture. Arguably the first widespread home automation technology was known as X10. Introduced in the mid-seventies, it enjoyed somewhat limited popularity due to the nature of communications and the wiring in the standard detached home. There you have a 230V feed supplied on three wires: neutral, leg 1 and leg 2. The potential between each of the legs and neutral is 115V. The potential between the legs is the full 230V feed. Because X10 sends signals over the power lines, signals sent on leg 1 might not be received on leg 2 and vice versa. There are solutions available, including this coupler, but it obviously led to some frustrations for early adopters: unless all your devices were on the same leg then the commands might or might not arrive at the intended destination.

But technology continued its relentless progress and wireless products became prevelant as the cost of hardware continued to drop. In the same way that your cellular telephone has more power than the mainframe computers of the '70s, wireless devices have shrunk in size. It's now possible to manufacture LED bulbs in the standard form factors which incorporate a wireless transceiver. They're not exactly cheap, but with some governments effectively outlawing standard (Edison) incandescent bulbs, along with significantly lower current draw, switching can still be cost-efficient.

But as is often the case, companies want to distinguish themselves and "protect their turf." Philips has a marvelous system for lighting control known as Hue. Under the covers it uses the ZigBee protocol, but only a subset, namely the Light Link. If you want to control things like appliances or electrical outlets (it can also control light switches) then you have to use a different set of products, ones which use Z-Wave. So you might end up using both a Philips Hue hub and a Z-wave controller, as I have done, in order to arrive at a complete solution. I also had a number of devices left over from my previous experimentation with X10. Here's a schematic diagram of my network:

I have a number of infrared sensors installed (MS16A) in almost every room. They communicate wirelessly with the CM15A X10 control module. That's connected via USB to the Raspberry Pi 3. The Pi also has a Razberry Z-wave board installed. That communicates wirelessly with a wall switch for the basement lights and an outlet for my reading lights. The Pi sits on the gigabit LAN which is also connected to the wireless router. That communicates with a repeater which plugs into the Philips Hue hub with a short CAT-5 Ethernet cable. The Amazon Dots connect to either the router or the repeater, depending on where in the house they're located.

These are the devices in my office. I built an acrylic box to house everything.
On the left is a wireless modem which I plan to use as a backup if the power and cable go out.
On the right is the Raspberry Pi with the Razberry board mounted on top.

I installed a shelf in the kitchen so that I would have a place for (left to right) an Amazon Dot, Philips Hue Hub and my wireless repeater.

Raspberry Pi

The Raspberry Pi 3 is a single-board computer which is only about 85x56x16mm in size but packs a big punch. It has four USB ports, an RJ-45 Ethernet port and supports WiFi (802.11n) and Bluetooth. The operating system I use is called Raspbian and is a port of Debian Linux. It's stored on a 64 GB MicroSD card so no traditional hard drive is required. If you're at all familiar with Linux (and you really should be) then you'll have no difficulty navigating this system. There's also a 40-pin GPIO (General-Purpose Input/Output) header. The required 5 volts at 2.5 amperes is provided by an external power supply, but that's the only separate part needed to get up and running.

There are some commonalities and differences in the various Linux distributions but the requisite functionality can usually be found if you root around. For example, rather than using yum to install and update packages, on Raspbian you use apt-get. Raspbian does include systemd so you can use standard service files or even use this to convert SysV init scripts to service files.

Amazon Echo Dot

If you're anything like me then you've probably been intrigued by the Amazon Echo. At close to US$200, it's an interesting device but has some capabilities which don't match my needs. The audio performance might be entirely capable but you're not going to get true stereo rendering from the built-in speaker system, impressive as it may be. So when they introduced the Echo Dot it struck me as the perfect platform for someone with more "modest" requirements. And unlike the newer Tap, it's constantly listening for the command word or phrase. It has a basic speaker to allow Alexa to communicate. Experience confirms that it is able to discern commands spoken at a conversational volume, no shouting required. In short, it's pretty amazing technology.

I'll make some admissions here. I had cancer surgery late last year which involved the excising (cutting out) of almost 2/3 of my tongue. They reconstructed it with some flesh from my forearm but that can't be expected to behave like the original muscle. It's improving over time but my speech at times, with the inability to pronounce sibilants (like the letter S,) can make me sound like a blithering idiot. So I was extremely impressed by Alexa's ability to understand me. In fact, to date there have only been a few instances of misunderstanding what I've said. The comprehension of fluid speech has, entirely honestly, "blown me away!" And I obviously take note of the details, given my decades of experience in Information Technology.

So I ordered a couple of Dots, as mentioned above, from B&H Photo Video in New York. It's a smart company which offers free shipping for orders over $99. Also smart enough to know about the "quirks" of cross-border shipping to Canada, sensibly including HST and customs brokerage fees in the total price. An excellent company to do business with, BTW, whether you're in the United States or Canada. A most impressive product catalog! I didn't mention their name before out of concern for their arrangement with Amazon. But since Amazon is now touting that they sold some nine times as many units in their Echo line in 2016 as they did the year before, I don't think that they're going to be overly concerned about a few units being shipped up to Canada, even though it's not "officially" supported here, i.e. you can't order them through amazon.ca. UPDATE: Amazon now sells the Echo in Canada.

So after working around some of the issues, I was able to load the Alexa app on my iPhone and iPad. Configuration after that was fairly straightforward, although weather reports come from Niagara Falls, New York, the closest American city. As mentioned previously, comprehension is impressive! And it integrates seamlessly (well relatively, once you get it configured) with the Philips Hue hub. I originally ordered two units so that I could take advantage of the free shipping and set up one in my office and another in my kitchen. But here's another admission: I subsequently ordered four more Dots! I've been so impressed that I now want one in almost every room in the house, and it's not as though it's a big house.

But I would be remiss in my obligations to the community if I didn't address some of the criticisms readily found on-line. I don't doubt for a moment that some people have had less-than-stellar experiences. That said, I haven't been able to find fault in the product execution. Realistically, I could have expected problems with speech recognition, for reasons outlined above. But that didn't happen. Granted, it can take some time, research and effort to make everything work seamlessly, but far less than some might have you believe. Full and fair disclosure: my knowledge and extensive experience doesn't qualify me as perhaps your typical user. That said, the investment is more than justified by the rewards.

Philips Hue

The Philips Hue system is a bit of a niche product line, concerned only with illumination. You need a hub which can control up to 63 lights. Various controls are also available, including wall switches which can replace existing ones. But they have a wide range of products, from simply white bulbs to coloured light-strips. I have a colour bulb in my dining room which I can adjust to provide the appropriate ambience. As previously mentioned, I run a light-strip down the staircase to the landing and basement. They even have a flood which can display in full colour. I use mine for purposes detailed below.

The Hue has a REST (REpresentational State Transfer) interface which facilitates programmatic control. There's also an app available on the App Store so that you can control the lights from your iPhone and iPad. One of the quirks of the system is that when you experience a power failure you'll return home to find all of your lights on. I'm planning on writing a daemon for the Raspberry to address this limitation. The use of the ZigBee protocol is sensible as the devices create a dynamic mesh network so commands can be relayed from source to destination.

X10

The CM15A is a control module (hence the designation)

Integration