The latest ZwaveJS addon (0.1.46) added soft-resetting the USB stick on startup which causes USB passthrough to be disconnected from the VM for some hypervisors. There’s currently not a configuration option to disable this on the main ZwaveJS addon. You can roll back to the older version to get it working, or you can follow these instructions to tell udev to automatically reattach the USB to the VM.
I’m on Ubuntu Server 20.04 with libvirt (KVM) as the hypervisor. I’d imagine there’s a way to script this on ProxMox as well, but I’m not super familiar with it.
When ZWaveJS soft-resets the USB it triggers removing and re-adding the device on the host. With udev rules we can tell udev to automatically add the device back to the VM. You’ll need to create two files. The examples below are for a VM named “hassos” and the “Aeotec Z-Stick Gen5”. Replace the VM name and USB vendor and product ids with your own.
/opt/zwave-passthrough.xml
(you can place this elsewhere, if you’d like):
<hostdev mode="subsystem" type="usb">
<source>
<vendor id="0x0658"/>
<product id="0x0200"/>
</source>
</hostdev>
This is a libvirt configuration snippet. Replace the vendor and product with your USB stick’s (from lsusb
).
Next, create the rule at /etc/udev/rules.d/10-zwave-passthrough.rules
:
ACTION=="add", \
SUBSYSTEM=="usb", \
ATTRS{idVendor}=="0658", \
ATTRS{idProduct}=="0200", \
RUN+="/usr/bin/virsh attach-device hassos /opt/zwave-passthrough.xml"
ACTION=="remove", \
SUBSYSTEM=="usb", \
ATTRS{idVendor}=="0658", \
ATTRS{idProduct}=="0200", \
RUN+="/usr/bin/virsh detach-device hassos /opt/zwave-passthrough.xml"
Again, replace the VM name (hassos) and vendor and product ids with your own.
Now reload your udev rules (sudo udevadm control --reload-rules).
As the add-on has probably reset your device and removed it from the VM, you’ll either need to reboot the VM or run from the server /usr/bin/virsh attach-device <your-vm> /opt/zwave-passthrough.xml
to reattach it the first time.
Now just start/restart the add-on and it should start successfully. If you run sudo udevadm monitor
on the host, you should see the device get removed and re-added during the process. Good luck!