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.
- Part 1 - Sonoff/Tasmota S20 outlets
- Part 2 - Node-RED, Broadlink IR (since discontinued) and security
- Part 3 - debugging and Xiaomi/Aqara ZigBee sensors
- Part 3.5 - a detour through Azure IoT (since discontinued, but fun)
- Part 4 - old Docker setup, Node-RED wizardry and HomeKit accessory spoofing
- Part 4.5 - the recent switch to a Pi 4 and away from Docker
My core setup is still based on HomeKit (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 Node-RED 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 EndOn On Rules#Timer=1 do Power1 off EndOn
Don’t forget to also issue the
Rule1 On command to actually enable the rule.
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:
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 Node-RED equivalent).
There have been a few quirks (sometimes HomeKit 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.
I have also done a few software updates to
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 Node-Red‘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 HomeKit completely fails to trigger them when temperature crosses those thresholds, which is… disappointing, and completely outside my control (unless I hack some Node-RED 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.