Elelabs / elelabs-zigbee-ezsp-utility

Elelabs Zigbee EZSP Utility to perform firmware update on a range of Elelabs EZSP products as well as other generic EZSP adapters.
Apache License 2.0
126 stars 26 forks source link

[REQUEST] OpenThread firmware to have out-of-the-box compatbility support for Home Assistant Add-on: OpenThread Border Router Add-on? #36

Open Hedda opened 1 year ago

Hedda commented 1 year ago

@NilsBohr Suggest you look into out-of-the-box compatibility with Home Assistant Add-on: OpenThread Border Router Add-on:

https://github.com/home-assistant/addons/tree/master/openthread_border_router

https://github.com/home-assistant/addons-development/tree/master/openthread_border_router

See their official integrations for Thread and OpenThread Border Router:

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

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

Thread-based consumer devices use one of the two Home Automation standards: Matter or HomeKit. So in the future using this OpenThread RCP firmware on a ConBee 2 or RaspBee 2 adapter will allow adding Thread-based device directly to Home Assistant, using the respective Home Assistant integration. Home Assistant as such depends on that addon for its Matter (formerly "Project CHIP") integration and HomeKit integration when devices use Thread, and the idea is that users should be able to use other OTBR adapters than the official Home Assistant SkyConnect USB adapter than was recently made available:

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

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

https://www.home-assistant.io/blog/2023/02/08/state-of-matter-and-thread/

https://community.home-assistant.io/t/chip-matter-support-including-thread/305633

See the related discussion here about support for other OTBR adapters than their official Home Assistant SkyConnect adapter:

https://github.com/home-assistant/addons-development/issues/38

There are also some indirect discussions about Thread radio hardware adapter compatibility here:

https://github.com/zigpy/zigpy/discussions/894

PPS: Also recommend follow developer (@agners) development on GitHub + posts on Twitter + activity on HA community forums:

https://community.home-assistant.io/u/agners/activity

https://github.com/agners

https://twitter.com/falstaff_ch

Hedda commented 1 year ago

By the way, want to raise a slightly off-topic related feature in Home Assistant OS to consider, especially when Elelabs release future USB adapters;

FYI, for enhanced out-of-the-box user experience when using the same radio USB dongle with different types of firmware images (e.g. pure Zigbee NCP firmware image versus OpenThread RCP firmware image) in Home Assistant you should also keep in mind that "Home Assistant Operating System" (appliance OS distribution) + integrations can and do support a feature for "USB discovery" which has white-listings for some USB dongles which it then can discover and recommend to the end-user which integration(s) which that specific USB dongle is compatible with (and thus offer an easy option for end-users to quick start setup of the installation config flow for compatible integration).

So far it supports detecting newly connected USB devices and showing up in the discovered section on the integrations page in the configuration panel, and today it already does that for the native ZHA (Zigbee Home Automation) integration and the Z-Wave integration, so I would suspect that the same "USB discovery" feature will also be used for OpenThread USB radio dongles.

ConBee II is one of those USB dongles that is already whitelisted for the ZHA integration so suspect that from an end user's point-of-view that might conflict in the future if it is instead flashed with OpenThread firmware and want to use Thread for Matter(?).

https://www.home-assistant.io/blog/2021/09/01/release-20219/#usb-discovery

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

https://community.home-assistant.io/t/community-help-wanted-to-whitelist-all-compatible-zigbee-and-z-wave-usb-adapters-for-automatic-discovery-in-home-assistant-os/344412

https://www.home-assistant.io/integrations/zha/#discovery-via-usb-or-zeroconf

https://www.home-assistant.io/integrations/zwave_js/#discovery-via-usb

Note that it does not matter if VID and PID are the same or not for USB as long as the USB "Product Description String" field value for the device is different, (VID and PID alone in combunation are normally not enough to be sure it is a unique product, as usually also need "description" as well).

That is, the USB discovery feature uses a combination of VID/PID + "description" to identify the device it as a unique product.

In the end is actually the "Product Description String" field value that is the most important of those as other devices from others can use the same VID and PID if the manufacturer does not pay for unique USB ID but instead just uses the default from the USB-to-seriel convrter vendor, just as as long as the "Product Description String" field value is changed to something unqiue then the VID or PID does not need to be unqiue.

So the key thing to remember is to add a unqieue "description" for USB:

https://community.home-assistant.io/t/unique-friendly-name-description-for-automatic-zigbee-usb-adapter-discovery-in-home-assistant-zha-using-dongle-vendor-product-ids/337077

See manifest for ZHA:

https://github.com/home-assistant/core/blob/dev/homeassistant/components/zha/manifest.json

Also check out this pull request example for adding a unique USB device product for ZHA (Zigbee):

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

Not sure if this "matter" will be the correct component / domain which will need to use USB discovery for quick start setup to initiate the installation config flow for Matter over Thread using an OTBR (OpenThread Border Router) radio USB dongles(?):

https://github.com/home-assistant/core/blob/dev/homeassistant/components/matter/manifest.json

If so then you/they will add "usb" to that component's manifest in Home Assistant for USB discovery, similar to the ZHA manifest:

https://github.com/home-assistant/core/blob/dev/homeassistant/components/zha/manifest.json

Hedda commented 1 year ago

@NilsBohr FYI, for reference, dresden-elektronik is developing an official OpenThread RCP firmware for ConBee II and RaspBee II:

https://github.com/dresden-elektronik/openthread-r21

It will not make it support multi-protocol like Nabu Casa's Silicon Lab s Multi-PAN RCP firmware images for Home Assistant SkyConnect (and Home Assistant Yellow built-in 802.15.4 radio), but it will at least allow you to repurpose your existing old ConBee II or RaspBee II by reflashing it into a dedicated OpenThread Border Router (OTBR).

This alternative ConBee II or RaspBee II firmware is still in very early development, however, dresden-elektronik's developers have stated their goal is to make this new OpenThread firmware image compatible with Home Assistant's Thread and OTBR integrations/add-ons, e.i. allow you to form or join a Thread network and make Home Assistant a Thread Border Router:

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

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

https://github.com/home-assistant/addons/tree/master/openthread_border_router