Cannot passthrough Conbee II with KVM (host debian, guest haos)

I just bought a new Conbee II stick and I am trying to add it to my Home assistant instance. But unfortunately, looks like I cannot pass through this USB stick from host to guest properly.

Systems and setup:

  • Conbee II with flashed latest firmware (26780700), successfully flashed from CLI on debian
  • Host: Debian bullseye, latest updates, running on standard desktop computer
  • Virtualization: KVM 7.0
  • Guest: HAOS, latest version: Home Assistant 2022.9.6, Supervisor 2022.09.1, Operating System 9.0
  • Conbee II is on 2m USB cable to avoid interferences, no SSD nearby, only USB2 ports

What works:

  • I can see stick in my notebook (debian) and in deConz it looks it is alive
  • I can see stick in host (debian) and in deConz it looks it is alive

What does not work:
If I pass USB to KVM as

<hostdev mode='subsystem' type='usb' managed='yes'>
    <source>
    <vendor id='0x1cf1'/>
    <product id='0x0030'/>
    </source>
</hostdev>

(or using virt-manager and GUI, does not matter), HA can see Conbee, but cannot use it (deConz addon cannot connect to stick), and on host is KVM filling the syslog with

usb 5-1: usbfs: process 2016 (qemu-system-x86) did not claim interface 1 before use

message (at least 1 message pers second)

If i try to pass it as serial

<serial type='dev'>
      <source path='/dev/serial/by-id/usb-dresden_elektronik_ingenieurtechnik_GmbH_ConBee_II_DEXXXXXXX-if00'/>
      <target type='usb-serial' port='1'>
        <model name='usb-serial'/>
      </target>
      <alias name='serial0'/>
      <address type='usb' bus='0' port='4'/>
</serial> 

HA cannot see Conbee II. I have checked System/Hardware/All for anything like Conbee, but no luck.

I tried to stop any deConz services on host not to interfere with passing the stick through KVM, but no luck.

Any other ideas? :slight_smile:

I’m successfully doing it this way:

<serial type="dev">
  <source path="/dev/ttyACM0"/>
  <target type="usb-serial" port="1">
    <model name="usb-serial"/>
  </target>
  <alias name="serial1"/>
  <address type="usb" bus="0" port="4"/>
</serial>

It appears as:
/dev/serial/by-id/usb-QEMU_QEMU_USB_SERIAL_1-0000:00:04.7-4-if00-port0

in the deconz addon. Not a lot different to your second way though.

1 Like

Thanks for reply and your config example. My Conbee II is also on /dev/ttyACM0 on my host, so I have copied and pasted this into KVM XML as is. Restart KVM guest. Unfortunately, I cannot see any serial device in HA (settings/system/hardware/all hardware, type “serial”).
Also in Terminal addon on HA if I write

ls /dev/serial/*

the response is

zsh: no matches found /dev/serial/*

I don’t know if this will help, but here is another (older) thread on this topic…

Thanks all for your support. Finally it works. The config was described many times in several posts here in forum:

    <serial type="dev">
      <source path="/dev/serial/by-id/usb-dresden_elektronik_ingenieurtechnik_GmbH_ConBee_II_DEXXXXXXX-if00"/>
      <target type="usb-serial" port="1">
        <model name="usb-serial"/>
      </target>
      <address type="usb" bus="0" port="4"/>
    </serial>

BUT

the very important part was not to only restart KVM instance, but power off and then start it. I was only restarting it before and the usb-serial was not visible even it was present in KVM XML config. It must be properly shut down and then started and after that it was visible in HAOS. Maybe some glitch in KVM.

Stick is then visible as

/dev/serial/by-id/usb-QEMU_QEMU_USB_SERIAL_1-0000:00:03.7-4-if00-port0

in HA as mentioned earlier here.

3 Likes

I ran into this problem and the solution provided doesn’t work for me. After adding the entry to xml and restarting OMV, there is still /dev/serial/by-id/usb-dresden_elektronik_ingenieurtechnik_GmbH_ConBee_II_DEXXXXXXX-if00 in HA hardware section.
Does anyone have an idea what could be the cause? Hardware is x86.

Thanks for this thread!

Try changing the port from 4 to 5. It’s what made it work for my NUC. I don’t know the logic behind this so please fill me in, people.

This Conbee 2 mess was one of the more frustrating debugging sessions I’ve had… :sweat_smile:

Found out that the firmware flasher v4 doesn’t work (at least not on Ubuntu 22), but managed to flash using the flasher in deConz apt packages. Probably didn’t have to flash though, because this serial port forwarding trick is was what worked in the end. After trying a myriad of different ports.

Oh, and make sure to remove the USB Conbee device in kvm while using the serial port forward XML. Otherwise, I got no dice.

Thanks for the help!

I’ve got it working, using the method above, however the deCONZ add-on recognizes my ConBee II as a regular ConBee. Do you have the same?
It’s working fine by the way…

I also got it to work! What a headache… I used the following config:

<serial type="dev">
  <source path="/dev/ttyACM0"/>
  <target type="usb-serial" port="1">
    <model name="usb-serial"/>
  </target>
  <alias name="serial1"/>
  <address type="usb" bus="0" port="4"/>
</serial>

2 things I wanted to add,

  • you can figure out what to put in your source by using dmesg | grep tty
  • you can add such XML to virt-manager by changing the preferences to allow you to directly edit XML when adding hardware.

Good luck everyone!

1 Like

Just to confirm the solution:

  • Fresh Ubuntu 22.04
  • Using KVM and libvirt ( virt-install and virsh )
  • Home Asisstant OS from qcow2 image
  • Conbee II stick is on host at /dev/ttyACM0
  • Copied @tlamadon 's code to conbee2-usb-to-serial.xml
  • Attached device to a running hass OS with:
    virsh attach-device hass-os conbee2-usb-to-serial.xml
  • Everything gucci and the conbee is found by HaOS as:
    /dev/ttyUSB0 - QEMU USB SERIAL, s/n: xxx QEMU

Thanks and hope this helps.

2 Likes

the crucial point for me was to identifying the correct port for the source, thanks for the dmesg | grep tty command!
I also added the xml snippet by using virt-manager.
Thanks!