The 2022.9 release of Home Assistant add a much-anticipated integration for doing firmware updates on z-wave devices. I immediately rushed to update the 36 devices it said there were updates available for. Then I woke up the next morning to find it telling me about updates for 35 of those devices...
It's a brand new feature, so I'm not too worried about it being a little rough around the edges at the moment, for now here is what I've found:
- It does work, you just have to be careful about it
- When you start the update from the UI it will show as being updated immediately. Don't be fooled! It's started, but it's nowhere near done.
- Z-wave has it's benefits, but bandwidth is not one of them. It takes quite some time to send a firmware update over the z-wave network to a device (around 20 minutes or the ones where I've timed it).
- If you start multiple updates they will all try to send update packets at the same time and flood your z-wave network, and very likely all fail, so you should only do one at a time.
- Doing one at a time isn't as easy as you would hope, because I suspect the progress monitoring for this kind of update doesn't actually work (at least the "in_progress" attribute on the update entity stays false the entire time the update is being sent to the device.
Below are two scripts I threw together to solve this problem for me, hopefully they help somebody else out too.
The update-zwave-firmware
script requires hass-cli to find available updates and to start the install process. After starting one it attempts to run the monitor-zwave-firmware-upgrade
script to monitor the progress and wait for it to complete.
For the monitor-zwave-firmware-update
script to work it has to run on your Home Assistant instance (or somewhere else that it can run the docker logs
command in order to get the zwave-js logs to see the progress
- SSH access to your Home Assistant instance in order to run
docker logs
(which is the only way I've found to determine when the install is complete0
When you run it with no arguments it will just give you a list of the update.*_firmware
entities that are currently in an on
state. When run with one of those entities as an argument it will start the update process then watch the logs and output progress information as the install happens. When it gets a log indicating the the install is complete (or failed) then it will exit.
NOTE: It doesn't do any validation on the update entity you give it. If you try to use it with an entity that is going to start an update on something that isn't handled by zwave-js, then it will start the update fine, but it won't get any log messages that it recognizes so it will just seem to hang forever after that.