jascoproducts / firmware

Firmware for connected home devices.
346 stars 30 forks source link

[REQUEST] Jasco OTA provider in zigpy and Home Assistant's ZHA integration for Zigbee devices made by Jasco? #125

Open Hedda opened 4 months ago

Hedda commented 4 months ago

This is an open letter feature request Jasco as a company to provide public Zigbee OTA firmware update images + JSON metadata:

Please provide Zigbee firmware images + Jasco OTA URLs for zigpy + Home Assistant's ZHA integration for Jasco's Zigbee devices:

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

https://github.com/zigpy/zigpy/wiki/OTA-Information-for-Manufacturers

Jasco joined "Works with Home Assistant" partner program (device compatibility partnership), but only Z-Wave and not for Zigbee?

https://www.home-assistant.io/blog/2022/10/26/jasco-partner/

Meaning that you now have the right to add "Works with Home Assistant" badges on Jasco devices once they tested compatibility:

https://partner.home-assistant.io/

and there it says "Works with Home Assistant partners are expected to provide firmware updates via user-friendly services provided by Home Assistant" under Responsibilities in a section there called "Provide easy firmware updates".

So that should apply to Zigbee devices as well, should it not? I have at least read about any Zigbee OTA updates from Jasco in ZHA.

Anyway, I missed that while Jasco was actually among one of the first companies to join the "Works with Home Assistant" partner program, it looks like it then solely partnered with Nabu Casa to get the "Works via Z-Wave with Home Assistant" badge, only agreeing to work with Nabu Casa to make sure that their line of Z-Wave series devices will work with Home Assistant, and not also partnered to get the "Works via Zigbee with Home Assistant" badge as well(?). That is, to also make sure that users of existing and future Jasco branded Zigbee devices, such as Zigbee-enabled lighting control products in Jasco’s Enbrighten family (which are Zigbee Certified), will also have a great experience with their Zigbee devices when using Home Assistant's ZHA integration.

"Enbrighten" family from Jasco does include many Zigbee devices which should already be compatible with Home Assistant:

The idea with the program is that manufacturers get rewarded with badges if they agree to work with Nabu Casa on making their devices work fully work out-of-the-box as well as get automatic firmware updates via Home Assistant, for a greater user experince.

"There are manufacturers that are creating products that integrate into Home Assistant using standards like Z-Wave, Zigbee, or Matter (soon). In these cases, the integration is maintained by the Home Assistant community and Nabu Casa. These companies can still become a member of the Works with Home Assistant program but are relieved from integration maintenance." "With Home Assistant we are always working on educating our users about preferring local control and open standards when acquiring new products. This is also reflected in the “Works with Home Assistant” badges."

https://www.home-assistant.io/blog/2022/07/12/partner-program/

New badges:

image

Old badges:

image

The Follow-up question to that or rather an open letter feature request is if Jasco as a company is willing to spare development time to add a publicly available OTA (Over-The-Air) Provider Server or Repository where it publishes/hosts Zigbee firmware update image files for its devices as well as contribute some OTA Provider downloader code for this zigpy library?

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

https://github.com/zigpy/zigpy/blob/dev/README.md#zigbee-device-ota-updates

As Jasco as a company probably might not know, zigpy is the open-source Zigbee framework and hardware radio API/CLI abstraction code library that is used by Home Assistant's ZHA integration as well as a few other popular home automation software as a dependency in their Zigbee implementations and providing a "Jasco Zigbee OTA provider" and matching downloader code support for Zigbee devices from Jasco in this zigpy library could potentially enable much easier OTA firmware upgrades for end-users of those in the future, and include; for Home Assistant's ZHA integration today, as well as probably Zigbee plugin for Domoticz (e.i. the Domoticz-Zigbee project) and the official Zigbee Plugin developed by Jeedom SAS (i.e. the Zigbee plugin for Jeedom) in the future.

FYI, puddly is now working on supporting "Generic OTA providers" for zigpy via this new JSON format schema:

https://github.com/zigpy/zigpy/wiki/OTA-Information-for-Manufacturers

"This allows for new providers to be added to zigpy without extra code. This also allows for manufacturers to distribute test feed URLs to customers without deploying them globally."

This feature will be introduced via this new pull request that is still a work-in-progress -> https://github.com/zigpy/zigpy/pull/1165

If Jasco already provides a publicly available OTA (Over-The-Air) Provider Server or Repository where it publishes/hosts Zigbee firmware update image files then all that should be missing is an OTA provider code with server/repository URL in zigpy.

Please see zigpy's existing OTA provider code (providers.py) in Python which includes the URL links as source and downloader code for Zigbee OTA firmware image files for direct download:

https://github.com/zigpy/zigpy/blob/dev/zigpy/ota/providers.py

https://github.com/zigpy/zigpy/tree/dev/zigpy/ota

That is, this zigpy library would need a new "Jasco OTA Firmware provider" section in that OTA provider code (providers.py) to handle image download for Jasco OTA firmware update image files, (please see the "Skeleton OTA Firmware provider" for reference, as well as for referencing also studying providers.py to also look at the other OTA providers that already have different code sections to handle the download of OTA files, such as; IKEA, INOVELLI, ThirdReality (3reality), SONOFF/ITEAD, SALUS/Computime, and LEDVANCE/OSRAM.

https://github.com/zigpy/zigpy/blob/dev/zigpy/ota/OTA_URLs.md

Hopefully, Jasco management will consider setting up an OTA provider server or creating a dedicated repository for all officially released Zigbee OTA files for Jasco branded Zigbee devices and other Zigbee-based devices made by Jasco.

That way it will be a single trusted and official primary source of official Zigbee OTA files released by Jasco, and that OTA provider source repository with your Zigbee OTA files could not only be used by zigpy as it could also be reused by other Zigbee implementations independently (both other open-source implementations as well as closed source and proprietary implementations).

FYI, zigpy developers has recently added a new feature to the "zigpy-cli" tool that manufacturers can use to produce a skeleton JSON index from a given set of OTA files, and that way make sure manufacturers OTA files are correctly-structured so that they will be compatible with zigpy out-of-the-box. See the README.md for that "zigpy-cli" tool:

https://github.com/zigpy/zigpy-cli/blob/dev/README.md#ota

and

https://github.com/zigpy/zigpy-cli/blob/dev/README.md#generate-ota-index-files

Maybe also consider looking at concept of index.json with metadata on all files like Koenkk repository has to make scripting easier:

https://github.com/Koenkk/zigbee-OTA/blob/master/index.json

While zigpy and ZHA does not yet use this or other OTA Index files but Zigbee2MQTT allows users to use it locally as described here:

https://github.com/Koenkk/zigbee2mqtt.io/blob/develop/docs/guide/usage/ota_updates.md#local-ota-index-and-firmware-files

and discussion in relation to zigpy implementation here:

https://github.com/zigpy/zigpy/issues/535

And of course README.md file which among other things could contain some basic information on how to update those:

https://github.com/Koenkk/zigbee-OTA/blob/master/README.md

Perhaps also as keeping some kind of CHANGELOG.md with changelog release history for each device firmware version:

https://github.com/Koenkk/Z-Stack-firmware/blob/master/coordinator/Z-Stack_3.x.0/CHANGELOG.md

PS: By the way, both Home Assistant and zigpy libraries are now part of the "Open Home Foundation" (which is a big deal):