Karl SvenssonBlogLinkedIn

Take two on home automation - Z-Wave in HomeKit

Written 2019-01-12 by Kalle
4 min read | 772 words

A couple of years ago, i build my own system for controlling the lights in my apartment via the 433 MHz protocol. The system, which me and my girlfriend have used since then works quite well: lights can be turned on/off from the lock screen of our iPhones, we can control lights via Siri, and automate the times when the lights go on and off. There has always been one drawback, though: the 433 MHz protocol is a one-way protocol, which means that we can send commands to our switches, but get no feedback at all. This means that the system sometimes fails to turn a light on or off, which is infuriating.

Because of this basic limitation, I have since dreamt of migrating to a protocol which supports feedback and which has overall better stability. During the holidays, I decided to commit myself to this project.

A brief survey of the available protocols

After spending some time online, I encircled three protocols which seemed promissing: Z-Wave, Zigbee, and MQTT.

Z-Wave is a proprietary protocol, which means that there is an organization which certifies equipment to work with Z-Wave. This means that all devices can talk to each other, but also that the devices are the most expensive of the three standards.

Zigbee does not have a central organization which certifies devices, but instead enables manufacturers to create their own "sub-standards". Notable examples are the IKEA Trådfri and Philips Hue lights, which do not work with eachother: an IKEA light can not be controlled by the Philip Hue hub, and vice versa. The devices are, however, generally cheaper than Z-Wave equivalents.

MQTT differs from the other two in that it uses Wi-Fi to send information. This means that no hub is required, but also that a good Wi-Fi network is a prerequisite for good communication. A major drawback is that there are very few consumer devices that use MQTT.

Why I picked Z-Wave

In our apartment, my girlfriend and I have lots of exposed lightbulbs. Smart (and therefore ugly) light bulbs such as Philips Hue are therefore out of the question. Instead, over the years we have installed a handful of 433 MHz enabled dimmers that work well enough for our uses. If I was to change to another protocol, there would therefore have to be dimmers available, especially models that can be embedded behind light switches.

During my market survey, I found that only Z-Wave had dimmers that could be embedded, and thus I decided to use Z-Wave.

Home Assistant

A home automation system is not complete if it does not enable automation. My old system supported some automation by running Python scripts on certain times of the day. I'm very proud of what I managed to hack together, but have realised that there are better solutions available. The one I chose is Home Assistant, which is an open source solution with a thriving developer community. I chose it since a friend of mine and a colleague both use it and unbeknownst of eachother have praised it to the skies. During my pre-studies I also found that there was an abundance of tutorials, which is always nice.

What I bought

My old system used the original Raspberry Pi, an Arduino UNO and a noname 433 MHz transmitter that I bought from China. My original idea was to repurpose the Raspberry Pi and run Home Assistant on it. I followed the installation guide for the operating system Hass.io, which was the only solution available for the original Raspberry Pi. Unfortunately though, the experince was not very pleasant with connection issues and long waiting times. Therefore, I decided to bite the bullet and aquire a brand new Raspberry Pi 3+.

Before going wild and changing all of my control units to Z-Wave, I thought it would be a good idea to buy only one unit and figure out how to control it. Since I had no preference, I bought the cheapest I could find, which happened to be a Telldus Z-Wave plus certified wall outlet switch. The switch has a built-in energy meter, which is a nice feature.

To control the switch, I needed a controller unit. The one I chose was the Aeotec Z-Stick Gen 5, since it was available at my local store. Before buying it, I verified that it was listed as a supported Z-Wave controller in Home Assistant

All in all, the devices that I bought were:

  • Raspberry Pi 3B+
  • Aeotec Z-Stick Gen 5
  • A SanDisk 32 GB Speed Class 10 micro-SD card
  • A Telldus Z-Wave Plus certified wall outlet switch

© 2024