New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ZHA USB discovery talks on connected serial ports by default #55225
Comments
Hey there @dmulcahey, @Adminiuga, mind taking a look at this issue as it has been labeled with an integration ( zha documentation |
Besides the added USB discovery, it is this PR #55128 that actually does the probing. |
That one just changes what's done with the result of the probing, probing on automatically detected devices (along with the too broad VID/PID filter) was added in #54935.
Agreed. |
Well, the VID/PID I can imaging still... and it should not interfere.
Maybe too broad, yeah... but can be ignored. I guess I try to say: The broadness is debatable... the automatic probing inexcusable. |
yeah, we should not try to probe, unless we know that adapter is a Zigbee adapter, which implies the automatic USB discovery based just on VID/PID is not enough on its own, if using a generic USB-to-Serial bridges, and must take into account something like "description" if it allows unique identification. |
Just peeked at this. I think the issue is specifically here:
Probing has been in ZHA for quite a while and was only ever done on user selected devices. Does this make sense? Maybe we just need a tweak to USB discovery to do the probing after user confirmation. This may have to be reworked to allow users to pick from detected usb devices rather than trying to do the work for them because of how non specific the ids are for the devices. |
We are probably going to have to whitelist known devices and skip the probe. |
that could be middle ground:
|
Ideally we could still probe only after the started event but only if nothing else has the device open since anything that uses it should have opened it during startup. I don't think we have a good way to detect that. |
yeah, no good way to detect that. unless you run |
I think we should modify the I'll work on a PR |
Which ones are you going to filter out though? The two I mentioned aren't the only common serial-to-USB chips, and every once in a while new ones spring up. I think it'd be better to explicitly define devices that will be probed and ignore everything else (i.e. positive identification instead of negative identification). |
whitelisting per my comment above. |
Unfortunately it looks like the we end up dropping discovery support for the Eletrolama zig-a-zig-ah since it uses a generic description
Everything else should be ok though
|
Yep, Kind of expected that. |
I've got an implementation worked out. Its going to take a bit to test it properly though |
The problem
The ZHA USB discovery added in #54935 will talk on serial ports in a default installation (I used a clean config), losing communication with the device for the application that was using it and possibly breaking any devices that are connected. I had an ESPHome device connected that somehow ended up in flash mode.
I think the main problem here is the VID/PID combinations listed in the ZHA manifest are too generic. E.g. the 1A86:7523 combination is for the CH340 USB to serial chip, which is a generic serial-to-USB chip that I bet is used in more non-Zigbee-related products than in Zigbee-dongles. Likewise the 10C4:EA60 device listed is for CP201x, another common serial-to-USB chip.
Personally I would strongly suggest not writing anything to such serial ports by default, but there should at least be an option to disable it.
What is version of Home Assistant Core has the issue?
dev
What was the last working version of Home Assistant Core?
2021.8.8
What type of installation are you running?
Home Assistant Core
Integration causing the issue
zha, usb
Link to integration documentation on our website
https://www.home-assistant.io/integrations/zha/
Example YAML snippet
No response
Anything in the logs that might be useful for us?
Additional information
No response
The text was updated successfully, but these errors were encountered: