How To: Automation For OTA Zigbee/Zwave Device Firmware Updates

Hey guys,

I’m trying to create an Automation that will automatically upgrade the firmware on my Zigbee devices (light switches, bulbs, etc). (I think this might actually work for Zwave as well)

I want the automation to check for updates periodically, then queue the devices that have firmware updates available and upgrade them one at a time.

Why?

I have over 200 devices on my Zigbee Network and almost all of them have an update available.

Each of these updates takes anywhere from 30mins to an hour. And if more than of them is trying to upgrade at the same time, it takes even longer and can actually crash the controller.

Currently for both Zwave and Zigbee I’m using MQTT, Zwave2MQTT and Zigbee2MQTT respectively.

Both of these support OTA Updates for device connected to them

I know this is possible, just not with my noob skills.

There are three projects that have the “pieces”, I think.

  1. @CyanAutomation 's Automation for Updating all Shelly device to the latest firmware using MQTT

In spirit this does what I need, except it only applies to Shelly and it doesn’t queue them one device at a time.

  1. @Blacky 's Low Battery Notifications and Actions
    This script looks for all the devices that match a certain criteria and groups them for specific action. In this case it’s about batteries, but I’m assuming the same could be done for if the device has an upgrade available.

  2. Fabian Jackl’s Zigbee2MQTT OTA Updater Script

This script does exactly what I want, it’s just not a home assistant automation.

Has anyone done something like this already? Anyone care to help?

This could be dangerous. HA does not vet firmware. Just because there is ‘newer’ firmware available does not mean it is ‘better’. Jasco has actually been removing functionality to make support easier. I think you’d still want to manually review/approve the updates. The rest could be automated.

I concur with @nmpu , if a zigbee device (I would apply this same philosophy most any home automation firmwares and subsystems) is ‘working’ don’t screw with it and most definitely not in a automation that runs without you first reviewing, testing and watching others experiences.

IMHO, my experiences speaking here.

@nmpu @dproffer thanks, but I’m not asking if I should do it. I’m asking how I can do it. I appreciate y’all’s opinion, but that’s not actually helpful in solving the problem.

To each their own :slight_smile:

When you have over 100 Inovelli switches and over 100 Hue bulbs that all need to be updated, manually clicking a button once every hour is a huge pain and not a scalable solution.

1 Like

I’m not saying I’m going to run the automation all the time without any oversight.

Here’s an example…

Let’s say you have over 100 hue bulbs that all have the older firmware that have the low glow when off bug.

And you’ve already tested the new firmware and everything is fine…

How can you queue all of those devices to upgrade their firmware one by one without you manually pressing the button once an hour?

Ok ok soapbox off :wink:

Not sure where you are with coding. However, it seems like interacting directly with Zigbee2MQTT via MQTT commands would be the best way to do this. I think Home Assistant’s automations are a bit weak to get a robust solution working. Zigbee2MQTT can be controlled and queried pretty extensively via MQTT. It’s just a bit of work to poke around the documentation and browse MQTT to figure out the interactions.

Have a docker python or bash or ? script (any language that can interact with MQTT should work) running nonstop that would grabs all visible devices say at 1 am, then steps thru each to check for an update. Then fire off the update for one device, wait for success or failure, report and the move to next device. Or you could just have it do the check for updates and then publish this to you. Then you would ‘authorize’ the update for one or several or a group, then next cycle it would do the update.

FYI, from the docs:

An update typically takes +- 10 minutes. While a device is updating a lot of
traffic is generated on the network, therefore it is not recommend to 
execute multiple updates at the same time.

Good hunting!