Background

I think I wrote about this in some earlier blog post too, but I have used various home automation solutions for awhile now. I started out with very, very early Home Assistant builds, not quite sure when, but I contributed little in 2014 to it at least (based on git log). Later in 2014 I started developing my own solution with somewhat different decentralized model ( GitHub - fingon/kodin-henki: ‘Spirit of home’ - my home automation project written in Python 2/3. ), which I used about 5 years and then switched to much less featureful but also less maintenance requiring Philips Hue system.

We used to have lots of mixed hardware (many different vendors’ wifi smart stuff, Hue zigbee, probably something bluetooth too), but gradually everything without its own wifi component got tossed, and zigbee was the main home automation backbone. This facilitated the 2019 switch to just using Hue for automation.

Home Assistant in the 2023 Frankenrouter

I introduced Home Assistant to the frankenrouter around year ago, mostly to gather long-term statistics from different sensors I have at home. The integrations in it were cool and e.g. ability to autodiscover our smart TVs was nice. I think I used the Home Assistant app infrequently to turn on or off some smart devices or lights, but there was only one automation in it ( visual doorbell - when we had people outside, lights changed where there were people indoors ), and only one custom dashboard:

All it shows is the current weather, weather forecast, and various temperatures (frankenrouter, living room, my study, outdoor) as well as history graph of indoor+outdoor temperature.

I turned off most of battery consuming stuff in the app, so neither our tablets or phones were used for presence detection nor were e.g. their battery graphs particularly useful.

Still, I was quite content with Home Assistant during the 2024, but as I spent time mostly working on some startups, and to lesser extent tinkering with some other hobby projects, I did not get around to doing much more with it despite having a large stockpile of home automation parts in the closet that I had stockpiled but had not found the time or motivation to use yet.

’We want you to have an account’

A bit over year ago, in late 2023, Philips Hue announced plans to require an account to use its app (e.g. Philips Hue will soon require an account to use its app — here’s what that means ). At least during the last year (2024) the app has been also prompting about account creation, and while I do not technically mind having accounts for some things, I found forced sudden addition of accounts distasteful so I decided to get out while getting out was good.

So, about two weeks ago I dusted off the hardware I had in my closet and started to think about how to get off the Hue ship. I had earlier ordered Sonoff zigbee USB dongle ( SONOFF Zigbee 3.0 USB Dongle Plus, Zigbee Gateway TI CC2652P + CP2102N Zigbee USB Stick, Zigbee Hub for ZHA in Home Assistant or Zigbee2MQTT, Open HAB etc. ) , and after finding it in the stockpile, and plugging it to the frankenrouter (using USB extension cord as having an antenna right next to noisy hardware is not great), I was off to the (software) races.

Home Assistant - ZHA or Z2M tribe?

For zigbee use, two different projects are available - https://www.home-assistant.io/integrations/zha/ and zigbee2mqtt and its HA plugin. Both seem relatively popular. The difference is in architecture:

  • ZHA is tightly coupled with HA
  • Z2M actually interacts only with MQTT broker, and then Home Assistant communicates with the broker as well

As I had already Mosquitto MQTT broker running (For use with Frigate NVR), Z2M seemed more tempting as it is also potentially a way to hack things if I feel like integrating with the zigbee devices using some future custom automization approach of my own.

There were also some random Reddit posts about Z2M device support being better, but without personal experience I did not put much stock to those.

I went with Z2M. I figured that if it works much worse than Hue, I could try ZHA or just stay with Hue going forward.

Z2M experience

I started the experiment by switching the devices in my study from Hue bridge to the Z2M ( + MQTT + HA plugin ) + HA. For most part device pairing ‘just worked’, and also setting up primitive automations was quite easy in HA.

Week later, I did the full migration for the rest of the devices. In our whole place, there was only one device I could not use, that had worked with the Hue bridge: Hue Tap (battery-less ‘green zigbee’ device) is not apparently supported in Z2M. Luckily toy closet to the rescue - I found a Hue Dimmer, which worked fine, but the firmware was ‘bit’ old:

The firmware upgrade was pretty straightforward though (for some reason it first upgraded to 2019 firmware, and then to the 2024 one).

The only problem I had with HA during this exercise is that setting up automations that actually matched what Hue did was not actually trivial:

  • delayed power-off of lights based on motion
  • different schedules based on time of day
  • different scenes based on time of day
  • ambient light sensitivity

Combining these with the weirdness of HA configuration, I spent actually more time than I like to think (mostly) replicating what I had in the Hue setup. On the other hand, I also gained extra functionality:

  • I connected the lights staying on logic also to 3D printer - occasionally I got quite dark 3D printing videos in the past when the lights automatically powered off eventually during the long print
  • https://github.com/basnijholt/adaptive-lighting provided quite cool way to auto-adjust light coolness based on time of day (unfortunately not much partner approval there - I had to turn it to really low level in shared spaces but my study is quite bright during the (dark) day, and then much warmer colored and darker when the sun is down)
    • I could also configure some buttons to turn it off selectively - colder (and brighter) light is much nicer for reading paper books, and I enjoy it now that I can with Hue Dimmer switch just select reading/cozy mode for our living room
  • A lot more visibility to what is going on and why

One of these days I will write a rant about why I am still not a fan of HA automation system, and how I implemented some of the details in the automations, but this is not that day. For now, I am content with the change even if I had to spend more time than I liked fiddling with it. After couple of evenings (over two weeks), it ‘just works’ though, and that is basically hard requirement here.