ZHA integration UI options to apply OTA firmware update (OTAU) per Zigbee device?

Request Home Assistant frontend devs add UI options to ZHA integration for OTA firmware update(s).

Please see related zigpy development discussion → https://github.com/zigpy/zigpy/discussions/951

Back-story; This feature request for ZHA’s UI to feature “Update Device Firmware” function for OTA firmware updates of Zigbee devices is a continuation of the ZHA OTA updates notification idea related to “zha-toolkit” discussion with @le_top here → [Feature] Notify OTA updates · Issue #24 · mdeweerd/zha-toolkit · GitHub in regards to ota_notify in feature zigpy GitHub - mdeweerd/zha-toolkit: 🧰 Zigbee Home Assistant Toolkit - service for "rare" Zigbee operations using ZHA on Home Assistant (also related to mdeweerd’s script zha-toolkit/fetchOTAfw.sh at 7ed030fa51ea18c79e2e592d2252695cc528d42f · mdeweerd/zha-toolkit · GitHub which download additional Zigbee OTA images from GitHub - Koenkk/zigbee-OTA: A collection of Zigbee OTA files).

While the ZHA integration already does support Zigbee OTA updates it currently simply applies all available Zigbee OTA updates as soon as it finds any OTAU files are available, without any UI options for individual Zigbee devices.

So firstly, would it be possible for ZHA users to only get notifications about Zigbee OTA updates and have UI options to update per device?

Secondly, would it be possible for ZHA users to get UI options to just select which specific Zigbee devices they would like to OTA update?

Could ZHA integration and its UI frontend utilize Home Assistant’s new update entity type to notify about ZHA OTA updates availability?

https://www.home-assistant.io/integrations/update

https://www.home-assistant.io/integrations/#updates

What does ZHA component + Home Assistant core and frontend UI developers think?

(I guess that if something like that was implemented then it could be reused for Z-Wave JS as well as possibly Matter/Thread in the future?).

Read news in Home Assistant 2022.4 release that introduced update as a brand new entity type which seams made for features like these?

https://www.home-assistant.io/blog/2022/04/06/release-20224/#introducing-update-entities

You can now upgrade your devices from inside of Home Assistant just as you would for Home Assistant Releases. You will also notice the number of updates pending in the sidebar by the indicator badge on your configuration cog icon. It’s now possible to read the release notes, skip or even install the upgrade to your device in one convenient place.

Introducing update entities

Say “hi!” to a brand new entity type: update.

Update entities can tell you if an update is available for your device and service and, in some cases, allow you to install the update straight from Home Assistant!

And the beautiful thing is: They show up in your configuration Dashboard, just like a Home Assistant, Home Assistant OS, or add-on update. As a matter of fact, those are now update entities too!

Now updates are entities, other integrations can provide them too! For example, a WLED firmware update for your LED strip will show up and installs with a single click.

Screen recording showing a WLED firmware update can be installed with a clickA WLED firmware update can now be installed just like any other update.

These update entities can be provided by integrations and provide more information about the update, like: Version information, links to release notes, and the possibility to skip that specific version offered.

The blue number indicator on the configuration cog icon in your sidebar tells you how many updates are pending.

The Home Assistant Supervisor (providing Core, OS, and add-on updates), WLED, Pi-hole, and Synology DSM integrations have implemented these brand new update entities in this release.

And because they are all entities, it means you can automate with them. For example, you could send a notification when a new add-on update is available for installation.

FYI, Home Assistant and Z-Wave JS integration devs exposed OTA updates for Z-Wave devices in UI from Home Assistant 2022.7 release,

https://www.home-assistant.io/blog/2022/07/06/release-20227/#update-z-wave-devices-directly-from-home-assistant

and they also created a new Firmware Update Service (web service with an API) to power semi-automatic firmware updates in Z-Wave JS:

https://github.com/zwave-js/firmware-updates

https://www.home-assistant.io/blog/2022/07/06/release-20227/#update-z-wave-devices-directly-from-home-assistant

Z-Wave JS Firmware Update Service

This is the web service powering semi-automatic firmware updates in Z-Wave JS.

How it works

Firmware upgrades are defined in the files in the firmware directory. This information is parsed by the web service and used to respond to requests.

Z-Wave JS will query the web service on demand, providing the device identification of the device to be updated. If an update is available, the web service will respond with the necessary information to display to the user.

When desired, Z-Wave JS will download the update(s) from the provided URL, verify their integrity and install them

Update Z-Wave devices directly from Home Assistant

All software has bugs, including the software on your Z-Wave devices. But how to update those? Have no fear! As of today, we have a solution for this!

Thanks to the hard work and collaboration between @AlCalzone from Z-Wave JS and @raman325 from Home Assistant, you can now install updates on your Z-Wave devices directly from the Home Assistant interface!

Screenshot showing the new upload firmware item on the device page of a Z-Wave device page

On the device page of your Z-Wave device, there is now a menu item allowing you to install Z-Wave firmware updates onto your device manually.

Get a software update for your Z-Wave device from the manufacturer, and start an update in Home Assistant, which allows you to upload the update file you got from the manufacturer. The rest is pure magic!

Screenshot showing the a Z-Wave device that has firmware installation in progress

During update installation, you’ll be presented with the update’s progress.

It is that easy :muscle:

@puddly do you have any thoughts of the feature request feasibility of Zigbee OTA in ZHA’s UI?

4 Likes

Are there any plans to integrate this feature to ZHA ? i see some ZHA work been made in 2022.9 but just regarding the backup

Noticed too new Z-Wave JS firmware update service is now available in UI as of HA 2022.9 release:

https://www.home-assistant.io/blog/2022/09/07/release-20229/#z-wave-firmware-updates-now-live

Z-Wave Firmware updates now live

In 2022.7, we added support for updating Z-Wave device firmware, but the catch was that you needed the firmware files from the manufacturer in order to complete the update. @AlCalzone wasn’t satisfied with this approach and began working on a better solution. That better solution is here with the introduction of the Z-Wave JS Firmware Update Service! For supported manufacturers, Z-Wave JS can now automatically detect, download, and install a firmware update if it is available for your device. This will be done the same way you are currently updating Home Assistant. You will see a notification in your settings menu and you can update right from there. Thanks @raman325

For now, only Jasco products are supported. Nabu Casa has been talking to other manufacturers to get more devices supported. To ensure our users can take advantage of this feature, we added update entities for your devices that will check once a day for new firmware updates. Nifty!

Based on puddly’s proof-of-concept synchronous OTA manager posted in the comments in this other pull request for zigpy it sounds as if he maybe has plans for device-specific OTA updates in ZHA(?):

https://github.com/zigpy/zigpy/pull/1102

FYI, looks like dmulcahey begun working on the update platform code for the ZHA integration, see:

https://github.com/home-assistant/core/pull/107612

and

https://github.com/zigpy/zigpy/pull/1321

As requested this should add initial support for Home Assistant’s universal update platform and expose Zigbee OTA updates for devices in the same unified way as other updates are in Home Assistant:

https://www.home-assistant.io/blog/2022/04/06/release-20224/#introducing-update-entities

Backstory if you missed it; Home Assistant core has that relatively new unified update platform and “update” entity type that can be initiated from the same place from UI/GUI by end users:

https://www.home-assistant.io/integrations/update

Again, several other integrations for Home Assistant, (such as the similar Z-Wave integration), are already utilizing thos new update platform to add update entities UI for device OTAU updates:

https://www.home-assistant.io/integrations/#updates

Now updates are entities, other integrations can provide them too! For example, a WLED firmware update for your LED strip will show up and installs with a single click.

These update entities can be provided by integrations and provide more information about the update, like: Version information, links to release notes, and the possibility to skip that specific version offered.

More references:

https://www.home-assistant.io/blog/2022/09/07/release-20229/#z-wave-firmware-updates-now-live

https://www.youtube.com/watch?v=wmYocYd0wts&t=390s&ab_channel=EverythingSmartHome

https://www.home-assistant.io/blog/2022/07/06/release-20227/#update-z-wave-devices-directly-from-home-assistant

Note! Manufacturers must add public URL in zigpy for OTA update images for automatic download, see:

Sadly not many manufacturers are publishing their OTA images publicly yet. If you are a user of their products then consider contacting manufacturers and encourage them to do so for all their products.

Otherwise the end user must manually provide the OTAU files from unofficial sources, if so, check out:

Screenshots from dmulcahey for the above-linked pull requests showing Zigbee OTA update in the UI:

FYI, those pull requests by dmulcahey has now been merged so this should be in Home Assistant 2024.2

https://rc.home-assistant.io/blog/2024/01/31/release-20242/#update-entities-for-zha-devices

Update entities for ZHA devices

ZHA (Zigbee Home Automation, our built-in Zigbee integration) now provides update entities to Home Assistant!

This means you can get notified when a device has a firmware update available, and you can trigger the update from Home Assistant!

Noticed the weird version numbers? Unfortunately, that is how version numbers in the Zigbee standard work and look, we currently have no way to translate them to something more human-readable format.

Currently, it supports updating Inovelli, OSRAM/Ledvance, Sonoff, and ThirdReality devices, and we are looking at adding support for more brands in the future.

1 Like

FYI; puddly is now working on refactoring/rewriting the zigpy code for Zigbee OTA providers and OTA image metadata logic for better OTAU image matching:

FYI, that work is also indirectly related to these two zigpy wiki pages about Zigbee OTA inside zigpy/ZHA: