-
Notifications
You must be signed in to change notification settings - Fork 505
Conbee USB device passthrough in QEMU KVM
USB passthrough of a Conbee device in a QEMU/KVM context seems to be a hit-and-miss for various people. Issues range from the device outright not connecting to deCONZ, to endless streams of errors in the deCONZ debug log.
A common symptom seems to be device state timeout in state #
errors, where # is 1, 2 or 3, followed by Serial com disconnected reason: 1
22:01:38:184 COM: /dev/serial/by-id/usb-dresden elektronik ingenieurtechnik GmbH ConBee II XXXXXXXXX-if00 / serialno: XXXXXXXXX,
ConBee Il
22:01:38:213 auto connect com /dev/serial/by-id/usb-dresden elektronik ingenieurtechnik GmbH ConBee I XXXXXXXXX-if00
22:01:38:625 failed to reconnect to network try=6
22:01:39:638 Serial com connected
22:01:39:725 void zmMaster::handleStateStatus(zmMaster::MasterEvent) EVENT_TIMEOUT
22:01:39:726 device state timeout ignored in state 2
22:01:39:885 void zmMaster::handleStateStatus(zmMaster::MasterEvent) EVENT_TIMEOUT
22:01:39:885 device state timeout ignored in state 2
22:01:40:045 void zmMaster::handleStateStatus(zmMaster::MasterEvent) EVENT_TIMEOUT
22:01:40:045 device state timeout ignored in state 2
22:01:40:205 void zmMaster::handleStateStatus(zmMaster::MasterEvent) EVENT_TIMEOUT
22:01:40:206 device state timeout ignored in state 2
22:01:40:365 void zmMaster::handleStateStatus(zmMaster::MasterEvent) EVENT_TIMEOUT
22:01:40:366 device state timeout ignored in state 2
22:01:40:525 void zmMaster::handleStateStatus(zmMaster::MasterEvent) EVENT_TIMEOUT
22:01:40:525 device state timeout ignored in state 2
22:01:40:685 void zmMaster::handleStateStatus(zmMaster::MasterEvent) EVENT_TIMEOUT
22:01:40:686 device state timeout ignored in state 2
22:01:40:845 void zmMaster::handleStateStatus(zmMaster::MasterEvent) EVENT_TIMEOUT
22:01:40:846 device state timeout ignored in state 2
22:01:41:005 void zmMaster::handleStateStatus(zmMaster::MasterEvent) EVENT_TIMEOUT
22:01:41:005 device state timeout ignored in state 2
22:01:41:165 void zmMaster::handleStateStatus(zmMaster::MasterEvent) EVENT_TIMEOUT
22:01:41:166 device state timeout ignored in state 2
22:01:41:326 void zmMaster::handleStateStatus(zmMaster::MasterEvent) EVENT_TIMEOUT
22:01:41:326 device state timeout ignored in state 2
22:01:41:485 void zmMaster::handleStateStatus(zmMaster::MasterEvent) EVENT_TIMEOUT
22:01:41:486 device state timeout (handled)
22:01:41:486 Serial com disconnected, reason: 1
22:01:41:506 device disconnected reason: 1, device index: 0
22:01:41:565 void zmMaster::handleStateIdle(zmMaster::MasterEvent) not connected go to OFF state
What seems to work for a lot of people is a fix documented by Home Assistant user danioj.
When using vert-manager, navigate to your VM and open its details pane (with the list of devices). Make sure that under Edit -> Preferences, Enable XML editing is checked. You can uncheck this after you are done with these steps.
In the left sidebar, select Overview, and then open the XML tab. There should be a list of <controller></controller>
XML elements in this view.
Take the following snippet, replace YOUR_CONBEE_PATH_HERE with your device path, and place it in the <devices>
tree, for example under a </controller>
tag:
<serial type="dev">
<source path="/dev/serial/by-id/YOUR_CONBEE_PATH_HERE"/>
<target type="usb-serial" port="1">
<model name="usb-serial"/>
</target>
<address type="usb" bus="0" port="4"/>
</serial>
In order to fill in YOUR_CONBEE_PATH_HERE, you will need the exact path to the device on your host machine. You can find this by running ls /dev/serial/by-id
and copying the directory name from this output.
After clicking Apply in virt-manager, shut down your VM if it was running and you should see a new serial device in the list of devices. This is a virtual QEMU serial device passing through the Conbee to your VM.
You should now be able to select the Conbee device in for example the Home Assistant deCONZ add-on, although it will be listed as a QEMU device, for example /dev/serial/by-id/usb-QEMU_QEMU_USB_SERIAL_1-0000:00:1d.7-4-if00-port0
. This should not impact the functionality of your Conbee USB.
Home Remember : Not all devices listed here are supported by deconz.