Persistent USB Path for Zigbee Dongle (ZHA)

Some background:

I have Home Assistant (2022.11.4) running in a Docker container on my Unraid (6.11.5) server. I have both Z-Wave and Zigbee USB sticks connected to the server. Z-Wave is configured via zwavejsUI (zwavejs2mqtt) and Zigbee is configured via ZHA directly.

The issue: I cannot establish a persistent path to the Zigbee USB stick that works in Home Assistant via ZHA.

For a while, Unraid was consistently assigning the two USB sticks to the same path each time: /dev/ttyACM0 for Z-Wave and /dev/ttyACM1 for Zigbee. After updating Unraid, however, they’re now switched. Of course, I could just swap the two in my Docker configurations and call it good for now, but I suspect they could flip again.

I created udev rules to try to assign persistent paths of /dev/zwave and /dev/zigbee. For some reason, the zwave symlink doesn’t get created but zigbee does, which I can confirm with ls -al /dev/.

But, when I update Home Assistant’s Docker configuration to pass through /dev/zigbee, ZHA does not initialize. Here’s the log:

2022-11-30 22:19:17.238 WARNING (MainThread) [homeassistant.components.zha.core.gateway] Couldn't start EZSP = Silicon Labs EmberZNet protocol: Elelabs, HUSBZB-1, Telegesis coordinator (attempt 1 of 3)
File "/usr/src/homeassistant/homeassistant/components/zha/core/gateway.py", line 172, in async_initialize
2022-11-30 22:19:20.262 WARNING (MainThread) [homeassistant.components.zha.core.gateway] Couldn't start EZSP = Silicon Labs EmberZNet protocol: Elelabs, HUSBZB-1, Telegesis coordinator (attempt 2 of 3)
File "/usr/src/homeassistant/homeassistant/components/zha/core/gateway.py", line 172, in async_initialize
2022-11-30 22:19:23.281 WARNING (MainThread) [homeassistant.components.zha.core.gateway] Couldn't start EZSP = Silicon Labs EmberZNet protocol: Elelabs, HUSBZB-1, Telegesis coordinator (attempt 3 of 3)
File "/usr/src/homeassistant/homeassistant/components/zha/core/gateway.py", line 172, in async_initialize
2022-11-30 22:19:23.282 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry SONOFF Zigbee 3.0 USB Dongle Plus V2 for zha
File "/usr/src/homeassistant/homeassistant/components/zha/__init__.py", line 112, in async_setup_entry
await zha_gateway.async_initialize()
File "/usr/src/homeassistant/homeassistant/components/zha/core/gateway.py", line 185, in async_initialize
File "/usr/src/homeassistant/homeassistant/components/zha/core/gateway.py", line 172, in async_initialize

I’ve also tried using the “by-id” path to the Zigbee stick: /dev/serial/by-id/usb-ITEAD_SONOFF_Zigbee_3.0_USB_Dongle_Plus_V2_20220706170149-if00
This results in the same ZHA error. This method does work for zwavejs2mqtt if I specify the same path in both zwavejs2mqtt and in zwavejs2mqtt’s Docker config.

Any ideas on how I can establish a persistent path to the Zigbee USB stick in Home Assistant? Obviously, I can specify which device to pass through in the Docker config, but I don’t see anywhere in Home Assistant / ZHA to specify the path. I presume it must be looking at all devices available and trying to determine which is the Zigbee stick it is looking for.

To get Home Assistant to recognize the new symlink to my zigbee stick, I had to modify the configuration:

  1. Navigate to config/.storate/core.config_entries
  2. Find the entry for ZHA (search the file for “zha”)
  3. Modify “path” to what I set up in the symlink (/dev/zigbee)

Restarted HA and it now ZHA works.

If this was what I had to do to get it to recognize /dev/zigbee, I’m not really sure why it handled the change from /dev/ttyACM1 to /dev/ttyACM0 without any issues.

…

Well, after poking around the ZHA configuration in the UI, I realized you need to click “Migrate Radio” to change the serial path. I hadn’t realized that’s where that setting would be.

I switched back to /dev/ttyACM0 in the Docker config and HA using this method, and tested using this method to switch to /dev/zigbee. It works, you just have to manually type /dev/zigbee when configuring the new path instead of HA detecting a zigbee device at that path.

1 Like

doesnt work for me