Zigbee device provisioning by scanning QR Code = QR camera scanner in ZHA's UI config and companion apps to include new Zigbee 3.0 devices to Home Assistant's ZHA integration?

Hi @Quatuor,

Basically, I used CC2531 with z-stack firmware version as- 3.0.x from the link to flash the CC2531.

https://github.com/Koenkk/Z-Stack-firmware/tree/master/coordinator/Z-Stack_3.0.x/bin/CC2531_20190425.zip

After flashing we connected the Home Assistant with CC2531 and followed the same procedure as mentioned above. I am able to see the ZHA.permit service in ZHA. But, not getting any of the allowed attributes as mentioned by you in the above image.
Please let me know if I missed something.

What do you mean by “not getting any of the attributes”??? you don’t get them, you supply them to the service call.

Is there any specific format to supply those attributes. Please let me know the exact format of it by giving an example

Like in the screenshot above??? https://community-assets.home-assistant.io/original/3X/6/3/637579ccb38f0e5f83b6b1868ad475e965ec1764.png

source_ieee: 11:22:33:44:55:66:77:88
install_code: 1234-5678-1234-5678-AABB-CCDD-AABB-CCDD-EEFF

Just following up, any chance some support will be added to Zigbee tuya devices?
I got two of these 2021 Tuya Zigbee 3.0 Smart LED Controller RGB+CCT 6pin Light Strip Controller Support tuya Zigbee and voice control accessories|RGB Controlers| - AliExpress, and I can’t figure out how to get it to work with homeassistant. The QR code scans into this format NB-###############$ZN######, where # is a digit between 0-9 (or this regex pattern ^NB-[\d]{15}\$ZN[\d]{6}$ ).
I tried parsing it manually into ieee and install code, but I may be lacking some knowledge here. Would love to contribute somehow if I could figure it out.

FYI, regardless if any Zigbee device could be joined via install code or not the device still needs to be already be supported by both the zha component’s Zigbee gateway application code as well as the zigpy libraries that it depends on as its underlying Zigbee framework, so a prerequisite question that you may have already answered yourself is if that specific device already works in zha + zigpy. See:

and

Also, the device itself might also need a custom device handler (quirk) before it will expose attributes:

1 Like

I’m confused. Has this been implemented or not? I see that I can add the qr_code parameter for zha.permit (Zigbee Home Automation - Home Assistant). Is this text that I need to add manually to the config file, or can I scan the QR code directly into HA? I don’t see a scanner, but wanted to confirm.

Support for joining via QR code is implemented in ZHA integration’s backend (i.e. the zha component in Home Asssistant’s core and the zigpy libraries that zha depends on), but scanning QR codes with a camera and parsing is not implemented in Home Assistant frontend(s) or in the Android and iOS companion apps for Home Assistant:

That is, the actual frontend UI parts to enable scanning of QR tags and handing over to qr_code for the zha integrations is still missing from the UI frontend for the ZHA integration.

For Z-Wave JS both frontend scanning/parsing and backend is missing for Z-Wave SmartStart inclusion, however the Z-Wave JS integration developers have added it to their roadmap wish list:

Update: FYI, QR-scanning has now also been added for Matter devices but still not yet for ZHA/Zigbee

FYI, it looks like @raman325 has started working on adding Z-Wave SmartStart provisioning support to zwave_js WS API in Home Assistant core. Hopefully, it will also lead to ZHA frontend support later as well:

https://github.com/home-assistant/frontend/pull/10726

home-assistant/core#59037

Also FYI; Z-Wave SmartStart QR scanning has been implemented in ZwaveJS2Mqtt’s as proof-of-concept, (feature in UI is however not named “Z-Wave SmartStart” but instead “Inclusion by QR Code”).

https://github.com/zwave-js/node-zwave-js/discussions/3381

FYI, QR scanning backend and frontend parts now added to the Z-Wave JS integration for SmartStart.

Both promoted in the latest release + also demoed in Home Assistant’s State of the Open Home video:

(Demo of Z-Wave SmartStart QR scanning starts at around 45 minutes and 30 seconds into the video).

https://www.home-assistant.io/blog/#z-wave-js-smartstart-and-entity-categories

"Z-Wave JS SmartStart and entity categories

Setting up your Z-Wave device with Home Assistant is now easier than ever, as Z-Wave JS now supports Z-Wave SmartStart!

When you have a SmartStart capable Z-Wave stick and device, you can now set up the device by simply scanning the QR code on the device, using your webcam, or using your mobile phone with the Home Assistant Companion app.

Including devices to your Z-Wave network has never been easier."

Btw, Home Assistant founders explicitly mention they will prioritize focus on features like these this year:

https://www.home-assistant.io/blog/2022/01/19/streamlining-experiences/

Recommend check out this video at around 11 min 50 sec in where talk about that focus point is about making it easier to get started with integrations and features performing common tasks in fewer steps, etc.

I hope that this QR code smartstart type feature idea will peak the interest of more developers this year.

Does anyone know if there has been any headway made on this?

I would love to be able to add my new Zigbee devices by scanning their barcodes like I can do with Z-Wave.

Not anyone has looked or worked at it as far as I know. I also asked here but not got any respons yet:

and

For reference, some Zigbee 3.0 devices will not pair without QR code or Install Code, see example Bosch Termostat 2 → Bosch Thermostat 2

For reference, the new Matter integration (formerly called Project CHIP) for Home Assistant now also makes use of the QR code scanning feature for device commissioning via the HA companion apps:

Adding Matter devices to Home Assistant

ADD A DEVICE USING THE ANDROID COMPANION APP

This will use the Bluetooth connection of your phone to add the device.

1. Open The Home Assistant app on your phone.
2. Go to Settings, Devices & Services.
3. On the Devices tab, press the Add device button.
4. Choose Add Matter device as the top of the list.
5. Scan the QR-code of the Matter device with your phones camera or press the Setup without QR-code button to manually enter the Commission code.
6. The process will start adding the device which takes up to a few minutes.
7. If you’re adding a test board (e.g. ESP32 running the example apps) and commissioning fails, you might need to take some actions in the Google Developer console, have a look at any instructions for your test device.
8. Once the process is complete and you pressed the Done button, you are redirected to the Device within Home Assistant and its ready for use.

I just bough a Bosch smart radiator thermostat II, it doesn’t show up in ZHA scans, but it has a QR code, a Zig Bee EUI-64 code and an Install code.

Reading the replies here, I am correct that this will not help me in getting this smart knob working in the forseeable future?

Any suggestions perhaps for an alternative that will work? I’ll send this one back. The Bosch Hub is a bit much + it would be my 3rd hub (Hue, ZigBee and then Bosch).

I hope matter will solve all this in the future.

Thanks for keeping at it eveyone!

I believe some people got that one to work by manually entering the install code into ZHA, see this dedicated thread about Bosch Thermostat 2 → Bosch Thermostat 2

Thanx, I tried that method, it gives me an “Can’t call service zha.permit. Unknown error” (I changed some bits in the screenshot below:

Perhaps it is my dongle, it’s a:

ZNP = Texas Instruments Z-Stack ZNP protocol: CC253x, CC26x2, CC13x2
door ZHA

Sorry my UI is set to Dutch so there are some Dutch words here and there.

If it’s my hub, could the SkyConnect solve it? I’m eager to buy it, but is it a good enough hub for a large ZigBee network?

I believe this to be the error:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/decorators.py", line 26, in _handle_async_response
    await func(hass, connection, msg)
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 731, in handle_execute_script
    script_result = await script_obj.async_run(msg.get("variables"), context=context)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 1578, in async_run
    return await asyncio.shield(run.async_run())
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 420, in async_run
    await self._async_step(log_exceptions=False)
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 470, in _async_step
    self._handle_exception(
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 493, in _handle_exception
    raise exception
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 468, in _async_step
    await getattr(self, handler)()
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 704, in _async_call_service_step
    response_data = await self._async_run_long_action(
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 666, in _async_run_long_action
    return long_task.result()
           ^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2035, in async_call
    response_data = await coro
                    ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2072, in _execute_service
    return await target(service_call)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 986, in admin_handler
    await result
  File "/usr/src/homeassistant/homeassistant/components/zha/websocket_api.py", line 1261, in permit
    await application_controller.permit_with_key(
  File "/usr/local/lib/python3.11/site-packages/zigpy_znp/zigbee/application.py", line 395, in permit_with_key
    await self.permit_with_link_key(node=node, link_key=key, time_s=time_s)
  File "/usr/local/lib/python3.11/site-packages/zigpy_znp/zigbee/application.py", line 353, in permit_with_link_key
    await self._znp.request(
  File "/usr/local/lib/python3.11/site-packages/zigpy_znp/api.py", line 1031, in request
    raise CommandNotRecognized(
zigpy_znp.exceptions.CommandNotRecognized: Fatal request error RPCError.CommandNotRecognized.Rsp(ErrorCode=<ErrorCode.InvalidSubsystem: 1>, RequestHeader=CommandHeader(id=0x04, subsystem=Subsystem.APPConfig, type=CommandType.SREQ)) in response to AppConfig.BDBAddInstallCode.Req(InstallCodeFormat=<InstallCodeFormat.KeyDerivedFromInstallCode: 2>, IEEE=18:fc:26:00:00:0f:xx:xx, InstallCode=b'\xE7\x4B\x04\xE6\x48\xA7\xC9\xBF\x1D\x58\x5A\x28\x13\xxx\xE9\xxx')

If I’m not mistaken, this error is due to my dongle not supporting the needed protocol details?

Edit: I just ordered the SkyConnect, will update here if I get it to work with that.

@teekert Pease note that this specific thread is only a feature request asking for the ZHA UI frontend interface to be echanced so this task is easier to perform, (hence this thread specifically posted in the feature requests forum which is not meant for support), so please instead continue asking for help in that other thread that is specifically about the Bosch Thermostat 2 → Bosch Thermostat 2

That is, please separate support/help questions from the “QR code” feature request and post any off-topic questions in new or existing threads in the other forums.

You do need a relative modern Zigbee 3.0 compatible Zigbee Coordinator adapter that is either based on Texas Instruments CC26x2/CC13x2 (e.i. CC2652 or CC1352) or Silicon Labs EFR32MGxx (e.i. Silabs EFR32MG21), the ZHA limitations mention this → 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

Thanx, I’ll continue in that thread. I did get the thing “to work” (that is, to connect) btw, with the SkyConnect. But still having issues. Thanx for the help so far.

Edit, ok, got it to work, see here

I’m willing to help debug, if there’s anything I can do. Thanx for the help.