ZHA: setup error for ConBee 2 ZigBee dongle (VM on UGREEN NAS)
The problem
I moved my Home Assistant installation from a mini PC (also running HA-OS in a VM) to my UGREEN NAS. USB passthroug is possible and Home Assistant is recognizing the dongle in general, but when re-configuring the ZHA integration it shows the following error: "Setup error, trying again: The serial port is locked by another application".
I was not able to find any application which is accessing the usb dongle.
I didn't know where else I could get help, so please dont be mad with me. If this is not the right place, let me know who I should contact.
What version of Home Assistant Core has the issue?
2025.6.0
What was the last working version of Home Assistant Core?
No response
What type of installation are you running?
Home Assistant OS
Integration causing the issue
ZHA
Link to integration documentation on our website
https://www.home-assistant.io/integrations/zha/
Diagnostics information
No response
Example YAML snippet
Anything in the logs that might be useful for us?
2025-06-14 18:31:21.300 DEBUG (MainThread) [zigpy.backups] Adding a new backup NetworkBackup(version=1, backup_time=datetime.datetime(2025, 6, 13, 16, 12, 49, 848017, tzinfo=datetime.timezone.utc), network_info=NetworkInfo(extended_pan_id=00:21:2e:ff:ff:07:35:72, pan_id=0x31C6, nwk_update_id=1, nwk_manager_id=0x0000, channel=11, channel_mask=<Channels.CHANNEL_11: 2048>, security_level=5, network_key=Key(key=fd:02:a1:f5:d2:4a:43:87:2c:54:d2:6e:f7:73:08:04, tx_counter=34711053, rx_counter=0, seq=0, partner_ieee=ff:ff:ff:ff:ff:ff:ff:ff), tc_link_key=Key(key=5a:69:67:42:65:65:41:6c:6c:69:61:6e:63:65:30:39, tx_counter=0, rx_counter=0, seq=0, partner_ieee=00:21:2e:ff:ff:07:35:72), key_table=[], children=[], nwk_addresses={}, stack_specific={}, metadata={'deconz': {'version': '0x26780700'}}, source='[email protected]'), node_info=NodeInfo(nwk=0x0000, ieee=00:21:2e:ff:ff:07:35:72, logical_type=<LogicalType.Coordinator: 0>, model='Conbee II', manufacturer='dresden elektronik', version='0x26780700'))
2025-06-14 18:31:21.302 DEBUG (MainThread) [zigpy_deconz.uart] Connecting to /dev/serial/by-id/usb-dresden_elektronik_ingenieurtechnik_GmbH_ConBee_II_DE2431299-if00
2025-06-14 18:31:21.302 DEBUG (MainThread) [zigpy.serial] Opening a serial connection to '/dev/serial/by-id/usb-dresden_elektronik_ingenieurtechnik_GmbH_ConBee_II_DE2431299-if00' (baudrate=38400, xonxoff=False, rtscts=False)
2025-06-14 18:31:21.302 DEBUG (MainThread) [zha.application.helpers] stopping global updater
2025-06-14 18:31:21.302 DEBUG (MainThread) [zha.application.helpers] global updater stopped
2025-06-14 18:31:21.302 DEBUG (MainThread) [zha.application.helpers] stopping device availability checker
2025-06-14 18:31:21.302 DEBUG (MainThread) [zha.application.helpers] device availability checker stopped
2025-06-14 18:31:21.302 DEBUG (MainThread) [zha.application.gateway] Shutting down ZHA ControllerApplication
2025-06-14 18:31:21.302 DEBUG (Thread-44) [aiosqlite] executing functools.partial(<function PersistingListener._set_isolation_level.<locals>.<lambda> at 0x7f9aafb5f240>)
2025-06-14 18:31:21.302 DEBUG (Thread-44) [aiosqlite] operation functools.partial(<function PersistingListener._set_isolation_level.<locals>.<lambda> at 0x7f9aafb5f240>) completed
2025-06-14 18:31:21.303 DEBUG (Thread-44) [aiosqlite] executing functools.partial(<built-in method execute of sqlite3.Connection object at 0x7f9ad3fde5c0>, 'PRAGMA wal_checkpoint;', [])
2025-06-14 18:31:21.303 DEBUG (Thread-44) [aiosqlite] operation functools.partial(<built-in method execute of sqlite3.Connection object at 0x7f9ad3fde5c0>, 'PRAGMA wal_checkpoint;', []) completed
2025-06-14 18:31:21.303 DEBUG (Thread-44) [aiosqlite] executing functools.partial(<function PersistingListener._set_isolation_level.<locals>.<lambda> at 0x7f9aafb5f240>)
2025-06-14 18:31:21.303 DEBUG (Thread-44) [aiosqlite] operation functools.partial(<function PersistingListener._set_isolation_level.<locals>.<lambda> at 0x7f9aafb5f240>) completed
2025-06-14 18:31:21.303 DEBUG (Thread-44) [aiosqlite] executing functools.partial(<built-in method close of sqlite3.Connection object at 0x7f9ad3fde5c0>)
2025-06-14 18:31:21.303 DEBUG (Thread-44) [aiosqlite] operation functools.partial(<built-in method close of sqlite3.Connection object at 0x7f9ad3fde5c0>) completed
2025-06-14 18:31:21.407 DEBUG (MainThread) [homeassistant.components.zha] Failed to set up ZHA
Traceback (most recent call last):
File "/usr/local/lib/python3.13/site-packages/zigpy/serial.py", line 138, in create_serial_connection
raise exc.__context__ from None
File "/usr/local/lib/python3.13/site-packages/serial/serialposix.py", line 385, in _reconfigure_port
fcntl.flock(self.fd, fcntl.LOCK_EX | fcntl.LOCK_NB)
~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
BlockingIOError: [Errno 11] Resource temporarily unavailable
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/zha/__init__.py", line 156, in async_setup_entry
await zha_gateway.async_initialize()
File "/usr/local/lib/python3.13/site-packages/zha/application/gateway.py", line 271, in async_initialize
await self._async_initialize()
File "/usr/local/lib/python3.13/site-packages/zha/application/gateway.py", line 254, in _async_initialize
await self.application_controller.startup(auto_form=True)
File "/usr/local/lib/python3.13/site-packages/zigpy/application.py", line 220, in startup
await self.connect()
File "/usr/local/lib/python3.13/site-packages/zigpy_deconz/zigbee/application.py", line 98, in connect
await api.connect()
File "/usr/local/lib/python3.13/site-packages/zigpy_deconz/api.py", line 463, in connect
self._uart = await zigpy_deconz.uart.connect(self._config, self)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.13/site-packages/zigpy_deconz/uart.py", line 120, in connect
_, protocol = await zigpy.serial.create_serial_connection(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
...<5 lines>...
)
^
File "/usr/local/lib/python3.13/site-packages/zigpy/serial.py", line 143, in create_serial_connection
raise PermissionError(
"The serial port is locked by another application"
) from exc
PermissionError: The serial port is locked by another application
Additional information
lsusb output:
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub Bus 003 Device 004: ID 1cf1:0030 Dresden Elektronik ZigBee gateway [ConBee II] Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Hey there @dmulcahey, @adminiuga, @puddly, @thejulianjes, mind taking a look at this issue as it has been labeled with an integration (zha) you are listed as a code owner for? Thanks!
Code owner commands
Code owners of zha can trigger bot actions by commenting:
-
@home-assistant closeCloses the issue. -
@home-assistant rename Awesome new titleRenames the issue. -
@home-assistant reopenReopen the issue. -
@home-assistant unassign zhaRemoves the current integration label and assignees on the issue, add the integration domain after the command. -
@home-assistant add-label needs-more-informationAdd a label (needs-more-information, problem in dependency, problem in custom component) to the issue. -
@home-assistant remove-label needs-more-informationRemove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.
(message by CodeOwnersMention)
zha documentation zha source (message by IssueLinks)
I have the same problem. The Conbee II stick is connected to a USB extension on a USB2 port of the Ugreen NAS. In the settings of the VM in which HA is running, the stick is passed through. HA recognizes the stick and offers me a setup. This fails with “The serial port is locked by another application”. The stick is displayed correctly in the HA hardware overview. The manual setup of ZHA also fails.
I can confirm. I also have this issue with my UGREEN NAS (DXP2800). My Setup:
- The ConBee 2 is connected to the NAS via USB
- HomeAssistant OS runs via VM
- The ConBee2 is forwarded to the VM and detected by HA
- When trying to install the suggested ZHA integration it fails
- When trying to setup Zigbee2MQTT it crashes on start
I tried using both the USB Passthrough of the UGOS VM GUI and using virsh attach-device VM_ID usb-device.xml approach. Updating the firmware to the latest one (0x26780700 from 15-May-2022) does not help as well.
This happens usually because the USB device is passed through but the serial port is unusable, either due to permission issues or due to passthrough issues.
Conbee2 works fine in plain HAOS. So VM USB settings related as suggested by puddly
It seems to be the Conbee stick itself. I have tested it with a SONOFF ZBDongle-E. I simply plugged it in, passed it through the VM, started the VM and I was able to use it immediately in ZHA.
Later I saw that my Conbee stick was not running the latest firmware. Perhaps it would have been enough to update it.
It seems to be the Conbee stick itself. I have tested it with a SONOFF ZBDongle-E. I simply plugged it in, passed it through the VM, started the VM and I was able to use it immediately in ZHA.
Later I saw that my Conbee stick was not running the latest firmware. Perhaps it would have been enough to update it.
That could be possible, thanks for investigating. I just saw the PR linked above, maybe it fixes this issue. I'll wait with the firmware update until 2025.6.2 and see if it is fixed. Otherwise I'll test the firmware update and let you know!
The linked PR allows ZHA to retry communicating with the radio a second time, right now there's a bug that leaves a connection open that shouldn't be if ZHA exhausts all possible combinations to try to talk to your radio.
The fact that it gets to that point means that ZHA has no way to talk to your stick, so it's likely the serial port half of the USB passthrough (not the USB part!) is not working. This is a configuration issue with the VM and not something ZHA can fix.
I understand what your saying from a hardware perspective, but using another stick (referring to @ttarzan01 ) is working then with the same passthrough configuration, does that make sense when the passthrough in general is potentially the problem? Dont get me wrong, when opened this issue I already guessed that its an issue somewhere between the host and stick, but I already read some forums and reddits that people are using the passthrough option of the NAS successfully with different types of sticks, so I wasnt sure.
I'll update the firmware later and see what happens.
The Conbee II and the Sonoff-E sticks have different USB to serial converter chips (with the Conbee actually having a firmware USB implementation) and will use different kernel drivers. It's very possible that the CP2102 or the CH340 used by the Sonoff-E is passed through "untouched" to HA OS but the hypervisor mangles the Conbee's USB CDC ACM data when passing it through, breaking just the Conbee.
Sorry for late answer on this topic. In between I updated the firmware of the Conbee II stick, it was indeed on a very old level, but it didnt solve the problem. I migrated to another zigbee stick and that one worked immediately after passing it through to the VM.
I reached out to UGREEN with this issue, but I think it will have a prio near 0, so I stay with the other zigbee stick for now.
Thanks for help!