zigpy / zigpy-deconz

A library which communicates with Deconz radios for zigpy
GNU General Public License v3.0
85 stars 20 forks source link

zigpy-deconz (ConBee/RaspBee adapter) and ZHA support for joining/pairing via install code and qr code? #214

Open Hedda opened 1 year ago

Hedda commented 1 year ago

Some users of Home Assistant’s ZHA integration with ConBee and RaspBee Zigbee Coordinator adapters from dresden elektronik have posted that they could not join/pair their Bosch Smart Home Zigbee devices that required an install code, and then some other users replied to that post saying that install code (and qr code?) support is not implemented in this zigpy-deconz radio library for zigpy which the ZHA integration depends on. Is that true?

https://github.com/zigpy/zigpy-deconz/blob/80041b9dbf334e0224b95081fcd49bb2da3e8c5d/zigpy_deconz/zigbee/application.py#L108

Just reporting this issue reported in the Home Assistant community forum:

https://community.home-assistant.io/t/bosch-thermostat-2/492845/10

https://community.home-assistant.io/t/bosch-thermostat-2/492845/11

The first device in question was the Bosch Thermostat II 230 V (BTH-RA / BTH-RM230Z), however, I understand that some people using deCONZ or Zigbee2MQTT have reported the same issue with a few other Bosch-branded Zigbee devices, like Bosch Smoke Alarm II (BSD-2), Bosch Door/window contact II (RBSH-SWD-ZB), and Bosch BWA-1 water sensor, all of which require adding the install code to pair/join.

https://github.com/dresden-elektronik/deconz-rest-plugin/issues/6476

https://github.com/dresden-elektronik/deconz-rest-plugin/issues/6421

https://github.com/dresden-elektronik/deconz-rest-plugin/issues/5190

I do not have a ConBee or RaspBee setup as Zigbee Coordinator myself any longer so can not replicate to confirm or deny but think this should be tracked if a feature is missing since supported by Silicon Labs and Texas Instruments based Zigbee Coordinator adapters via their respective radio library for zigpy.

PS: Both Silicon Labs (bellows) and Texas Instruments (zigpy-znp) radio libraries for zigpy do support install code (and qr code) or?

https://github.com/zigpy/bellows/blob/8549f277027245f5e63ce1341b7e6c5c75381899/bellows/zigbee/application.py#L845-L866

https://github.com/zigpy/zigpy-znp/blob/c4db8d1151b5a999ead73480faea4ea01b7cb7d7/zigpy_znp/zigbee/application.py#L338-L377

puddly commented 1 year ago

That's correct. There's no documented way to use install codes with the Conbee.

Hedda commented 1 year ago

Reposted to https://github.com/dresden-elektronik/deconz-serial-protocol/issues/20 in hope @manup or someone else from Dresden Elektronik can assist.

Hedda commented 1 year ago

That's correct. There's no documented way to use install codes with the Conbee.

Is zigpy-deconz the only radio library for zigpy that doea not support this? Is there tests for this in the different zigpy radio libraries in order to check and track feature parity between them?

puddly commented 1 year ago

Is zigpy-deconz the only radio library for zigpy that doea not support this?

It's only supported on EZSP and ZNP coordinators. No other firmwares support it (and likely never will, aside from the Conbee).

Hedda commented 1 year ago

FYI, ChrisHae's reply to https://github.com/dresden-elektronik/deconz-serial-protocol/issues/20 indicates this is in their roadmap for future deconz firmware.

Also updated the documentation for Home Assistant's ZHA integration to try to clearify that this is is a manufacturer limitation:

https://www.home-assistant.io/integrations/zha#limitations

"Support for commissioning Zigbee 3.0 devices via “Install Code” or “QR Code” via the ‘zha.permit’ service has so far only been implemented for ‘ezsp’ (Silicon Labs EmberZNet) or ‘znp’ (Texas Instruments) radio type in ZHA. Other radio types are missing support in their respective radio libraries for zigpy or manufacturer’s firmware commands/APIs."

Hedda commented 1 year ago

FYI, it seems deconz firmware support zigbee install codes as dresden-elektronik now implemented support in deconz-rest-plugin:

https://github.com/dresden-elektronik/deconz-rest-plugin/pull/6791

Interestingly @SwoopX mentions in that PR that the code to derive the required hash is ported from the zigpy implementation.

https://github.com/dresden-elektronik/deconz-rest-plugin/commit/24c7ff9d3047b7a6bde698e56d734120b63025ee

https://github.com/dresden-elektronik/deconz-rest-plugin/releases/tag/v2.22.0-beta

Enhancements: Enable usage of zigbee install codes https://github.com/dresden-elektronik/deconz-rest-plugin/pull/6791

https://github.com/dresden-elektronik/deconz-rest-plugin/issues/6476

https://github.com/dresden-elektronik/deconz-rest-plugin/issues/6421