Skip to content

[Core] ZHA USB discovery shows up even when running Thread or Multi PAN firmware #71

@TheJulianJES

Description

@TheJulianJES

Problem

At the moment, discovery entries created for ZHA are based on the USB descriptors.
But it's possible to install non-Zigbee firmware on basically all (Zigbee) adapters these days. In that case, we still show a discovery entry for ZHA, as we cannot know the installed firmware without probing the device, which could potentially disrupt other applications.

Note: If you try to configure ZHA when the adapter has wrong firmware installed, it will tell you that.

Remove descriptors entirely?

It has been brought up to remove the USB descriptors from ZHA entirely, as the Zigbee adapters could have custom/Thread firmware installed.
We’d essentially have to remove all USB descriptors from ZHA then, since you can install Thread/RCP firmware on anything these days.

IMO, we should search for a better solution than completely removing the USB descriptors for basically all Zigbee adapters from ZHA.

Impact

The impact of completely removing the USB descriptors for ZHA would likely be substantial:

  • Only HA Connect ZBT-1 and ZBT-2 would provide a good out-of-the-box setup experience with discovery-based setup, possibly making users think we did this intentionally to only offer the best experience for OHF partner products.
  • It could also lead to users throwing away working Zigbee adapters, as ZHA wouldn't show up for auto-discovery anymore, like it did for the past four years, making the user think the adapter is non-functional (e.g. after it has been in the drawer for an extended amount of time, since that's when you'd plug in the the adapter and see/use the ZHA discovery).

Other solutions

There may be other solutions to consider:

  • Try probing the device for the correct firmware, aborting the flow if incorrect firmware is installed
    • Z2M should lock the port, so we shouldn't break that
    • We should be sure that Z2M has started up, so we don't potentially block Z2M from starting up whilst we probe the device
  • In the ZHA config flow dialog where we tell the user they have the wrong firmware installed, it might be possible to add a note along the lines of "If you don't want to use this adapter for Zigbee, you can ignore the config entry".
    • This is a bit awkward, but there are still people who incorrectly installed Multi-PAN firmware, but just want to use Zigbee now
    • Some ZBT-1 users might have accidentally flashed RCP firmware on their ZBT-1 due the OTBR addon auto-flashing, though this has since been removed
    • But this would avoid the case of "Why isn't this Zigbee adapter I have in my drawer showing up for ZHA discovery? It must be broken.", even if they installed Thread/MultiPAN firmware in the past, but now want to use it for Zigbee (again)

Really an issue?

I'm not sure if this is really a big issue in the first place. From what I can tell, the vast majority of users never flash their USB Zigbee adapter with RCP firmware. From what we found, Sonoff doesn't even have instructions on how to install pure Thread firmware, though they do provide that firmware in their web-flasher.

Similarly, it might also be possible that other network-connected smart home devices are flashed with third-party firmware, breaking MAC based integration discovery, since they're not running the firmware they shipped with (assuming the integration doesn't probe the device further).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    Triage

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions