My Quest for Home Automation, Part 5

We don’t celebrate Thanksgiving here, but it tends to be the time around which I take out our Tasmota-based smart outlets and set up the heaters again, and I guess it’s also a good time to document all the latest changes.

Previous Instalments

  • - Sonoff/Tasmota S20 outlets
  • - , Broadlink IR (since discontinued) and security
  • - debugging and Xiaomi/Aqara Zigbee sensors
  • - a detour through Azure IoT (since discontinued, but fun)
  • - old Docker setup, wizardry and accessory spoofing
  • - the recent switch to a Pi 4 and away from Docker


My core setup is still based on (i.e., homebridge, a few plugins and mosquitto for glue to everything else) and Zigbee for security reasons (no public Internet services to work) and I have progressively cut down on the number of custom flows to a point where I only need to spoof a couple of devices to have them show up on the Home app properly.

The only other protocol in use is WeMo, and that because a few Tasmota devices have WeMo emulation on so I can control them from an Echo Listen (HomePods are not officially available in Portugal and lack support for external speakers, so I can’t use them).

This is only acceptable because the WeMo TCP protocol also works without any outside access (other than Alexa voice recognition, the Echo talks directly to the devices), but I hope to do away with that next year since I haven’t fully given up on rolling my own smart speaker – I just haven’t had the time to fiddle with it, and all the OpenSource projects I was considering using have either stalled or gone cloud-centric/proprietary, which is a bit sad.

Configuring a Tasmota Push-Button Timer

Besides setting up the heaters (which were also reconfigured to use HomeAssistant auto-discovery using SetOption19 on, which is now supported by my homebridge setup), another thing I had to set up (which was not documented elsewhere) was a three-minute push-button timer for one of the outlets, which can be coded into Tasmota itself like this (just paste the whole thing into the Tasmota console in a single line):

Rule1 On Button1#state Do 
    Backlog Power1 %value%; 
    RuleTimer1 180 

On Rules#Timer=1 do 
    Power1 off 

Don’t forget to also issue the Rule1 On command to actually enable the rule.

Flushing Tasmota Devices

Another thing I’ve had to do on occasion is removing from Homekit auto-discovered devices I used for testing, which is done by flushing retained messages from the MQTT broker and then restarting homebridge:

mosquitto_sub -t '#' --remove-retained --retained-only

Going Zigbee 3.0

A month or so ago, in an attempt to improve connectivity with faraway sensors, I replaced the CC2531 dongles with CC2652R ones, which are Zigbee 3.0 compatible:

It pays to label things with firmware update dates, believe me.

I also added a dedicated router to my office to decrease latency when controlling lights (more on that later), and re-paired a couple of recalcitrant devices to their nearest router (something made a lot easier due to the new, built-in zigbee2mqtt web UI, which also replaced my own equivalent).

There have been a few quirks (sometimes door sensor notifications - not all, just a couple - come a full minute after the fact for no reason), but I’ve seen sensors drop off the network much less and things have improved in general – or at least as much as possible given the challenge of getting Zigbee to work through a bunch of walls amidst the cacophony of noise in the 2.4GHz band around these parts.

Better Maintenance

I have also done a few software updates to homebridge, zigbee2mqtt and node-red in the meantime, and they have worked out fine: overall much less hassle than the previous Docker setups, because I can now use their own self-update mechanisms inside piku environments without having to build custom images (or pull them down, which tends to be slow either way).

As always, everything is backed up to Azure using restic, plus I’m using ‘s built-in git support to keep track of (now very infrequent) changes there, so things are pretty stable and all daily interactions are done through the Home app.


There are a few kinks, however – for some reason, the Home app allows me to define automations based on temperature sensors but completely fails to trigger them when temperature crosses those thresholds, which is… disappointing, and completely outside my control (unless I hack some flows to do it, which I would rather not just yet).

But everything else has been rock solid, and I’m still very happy with the results – the base setup has now been working for nearly four years, and just keeps getting simpler to run.

This page is referenced in: