Sensible connected home

Published on: 2022-01-31

Wew lads, it's been a while since my last post on here. I have been meaning to write more, and this post is a result of a new strategy - whenever I research a new topic, I'll try to document that and post the results here.

So, I wish to dive into the world of home automation. I wish to avoid the buzzword "smart" as much as possible, so I will refer to it as "connected home" instead. Soon, I will be moving into my first house, and so I set off to research. This post will be updated over the course of the next few weeks, as I get my research/prototyping done.

There are a few points which are very important to me:

  • I want to be able to see the current electrical load in Watts on certain wall sockets, and ideally also control their state.
  • Analog to the sockets, I want to be able to see and control light state.
  • It would be very cool to see which windows are open.
  • I have not, do not and will never like the cloud. Whatever I do, I want it locally in my LAN and 100% under my control. No outside communication unless I make it so.
  • I want to use only open source components. If I have to crack open some commercial device to reflash firmware via test points, that's fine too.
  • I have no bus such as KNX built into my house. I would vastly perfer a bus to any RF technology, but I am not sure I can retrofit it easily. I do have empty tubing in the walls though (one per room, down the the power box). If anybody wants to chat about this, shoot me an email!

There seem to be three basic categories that you can buy into: Zigbee, Z-Wave and WLAN. TL;DR, I chose Z-Wave, and the following is my reasoning.

WLAN

+ you probably already have one
o fast, which is useless for sensors since they only send small data amounts
o mostly proprietary, sometimes you can flash your own firmware
- very energy hungry
- many small IP routable devices in your home sounds bad
- 2.4 GHz congestion is bad

This seems like the worst, so I'll get it out of the way first. There are absolute shitloads of "smart" devices that implement connectivity using off-the-shelf chips such as ESP-8266 or BK7231N. They all have in common that they will happily connect to your WLAN and phone home into the cloud. The allure of these is that even people with absolutely no technical abilities can use them. The downside is... everything else. They are privacy invasive, energy hungry and not under your control. Sometimes, you can flash open source firmware on them (see here as an example for a broad range of devices based off ESP-8266 and derivates), but this will still not solve another hard problem: use a dozen of these devices and you'll rapidly congest your 2.4GHz band. You (and your neighbors) won't like that. Finally, WLAN is energy hungry and it's not feasable to deploy small battery powered sensors, such as temperature or water sensors, that can run for years on a battery. So WLAN is out of the race.

Zigbee

+ cheap
+ widespread
+ low energy
- walled gardens by many different manufacturers, no guarantee that devices are compatible
- based on 2.4GHz

Zigbee is a step into the right direction. It's a non-IP low energy protocol unfortunately based on ISM radio bands, which is 2.4GHz in most of the world. Its layers are defined in IEEE 802.15.4. It's a mesh net, meaning that each mesh member uses other members to reach the gateway, which is the root of the mesh network and actually communicates with the outside. Zigbee devices on their own never communicate directly with any device outside of their mesh. There are many different (often proprietary) gateways, but of course we want the open source solutions. Fortunately, there are cheap USB dongles which work just fine and can work with a wide variety of devices. Zigbee is incredibly cheap, very widespread, and free for anybody to implement. Unfortunately, this also leads to large discrepancies in manufacturers and their implementation. Zigbee provides a means to transport data, and nothing else. The application layer is defined by the manufacturer, which implies a lot of walled gardens. In essence, any Zigbee network by a manufacturer will be exclusive to that one manufacturer. It gets more extreme when people buy into multiple manufacturers, and have multiple mesh networks at the same time, further congesting the 2.4 GHz band. The gateways have to do the heavy lifting here and speak many different protocols for each company's devices, in order to expose them in a consistent manner to the gateway host. One product that claims to be able to do this is the Conbee II gateway, and I have ordered one to test.

Z-Wave

+ widespread, but less so than Zigbee
+ very reliable due to mandatory certification and testing
+ low energy
+ certification includes security testing
+ runs on 868MHz in Europe
o standard opened up recently, but too soon to see if that helps with adoption
o around double/triple as expensive as Zigbee devices, but still okay-ish
- could potentially be deplaced at some point due to large companies flocking to Zigbee

Z-Wave is, like Zigbee, also a mesh network which is composed of a bunch of clients (the sensors/actors and whatnot) and a gateway. Z-Wave is a proprietary standard and defined by Sigma Designs, which was then bought by Silicon Labs. In fact, it has quite a convoluted history, starting out as technology using an unlicenced frequency band in 1999. It really was the wild west back then it seems :). From an "how open is the system?" standpoint, it's unfortunate that Z-Wave only has a single vendor producing chips, even though this could change soon. It feels like vendor lockin, but maybe i'm wrong here and rigirous standardization and gatekeeping makes sense from a product perspective. In order to be granted a licence to use Z-Wave, products have to undergo large amounts of certification for interoperability. The upside is that it's supposedly guaranteed that devices will be interoperable with each other and with whatever gateway you want to operate. This is a sore point to me though, and I only accept it at all because I control the gateway and can verify nothing leaves my local mesh into the direction of the internet. Also - only the certification process is the proprietary part, most of the specifiation is open it seems.

Anyhow, the biggest advantage in my opinion is that it uses a 868 MHz frequency in Europe where I live, so no fighting with my computers over frequencies. The maximum device count for Z-Wave is 232, and this could be seen as a drawback, but I actually doubt I'll ever exceed even 50 devices. And maybe the limit is even good - Z-Wave imposes some limitations, such as hop count to gateway (4 hops maximum, Zigbee does not impose limits here, which could lead to a large RTT). A downside is the increased price - due to certification, manufacturers can't outprice Zigbee devices. This may hurt if you plan on using many sensors/actors.

Z-Wave setup

I went with an Aeotec Z-Stick Gen5 as a gateway, and using Domoticz on my little x86_64 server that's sitting in my pantry, running in a Docker container. Still waiting for sensors to arrive for preliminary testing.

...to be continued...

Site generated on 2024-01-29 14:07:12. Changelog on Github.
Subscribe with RSS: https://lpcvoid.com/rss