Hyper-V doesn’t natively support USB passthrough but you can easily passthrough your dongles by using one of the many Serial to Network Solutions. The easiest software to setup is NetBurner Virtual Comm Port. It can be configured from the GUI and runs as a windows service so it always works even after a reboot.
How to Setup NetBurner
- Make sure you have the latest windows drivers. If your drivers are not installed NetBurner won’t detect your devices. My Zooz 700 Series stick and ZBDongle-P use the CP2102 Driver while my Zooz ZST39 and ZBDongle-E use the CH9102 Driver.
- Download NetBurner from HERE.
- Install NetBurner using the default settings then run the program. It will be named NBVirtualCommPort
- Click ADD to add a new entry and use the following settings:
a. For connection type select SERVER CONNECTION
b. Select the COM Port you want to share
c. Give your connection an easy to remember name. I will name mine Z-Wave and Zigbee
d. Uncheck CREATE AS VIRTUAL PORT
e. Make sure your TCP Port is different for each device that you want to share
f. Click Apply
How to Connect Your Windows Devices to HA
- For Zigbee2MQTT go to settings > addons > zigbee2mqtt > configuration tab > in the serial section enter
port: tcp://192.168.1.2:5002
192.168.1.2 is the IP address you are running NetBurner on and 5002 is the port you selected.
- For ZHA go to settings > devices and services > add integration > add zigbee device > click proceed > under select serial port port click enter manually > select your radio type and click submint > enter
tcp://192.168.1.2:5002
for the serial device path > click submit
- For Z-Wave JS UI go the UI > Settings > Z-Wave section >
tcp://192.168.1.2:5002
in the serial port box > click save
Troubleshooting
The only issue I’ve had was during setup. I didn’t have the latest driver and it would not connect to my device.
1 Like
Looks like netburner is behind a paywall. I found an alternative which worked for me. see Hyper-V, USBIP & Home Assistant – cardus.com
2 Likes
I tried the Netburner serial over IP approach a few times and it consistently performs WAY worse than directlyl handing the USB dongle to a VM (Hyper-V or VMware or Virtualbox). There are weird random delays in responsiveness. VMware player I think is best for most people and overall, if you really want Hyper-V + DDA can be done but you need to use Windows Server OR spoof your windows version to Windows Server. I did this recentlyl and it works, in fact I’m currently using it. I’ll do a write-up on it at some point for posterity, because otherwise the only other mention of it is in a random Reddit comment thread with very poor explaination.
Also the netburner application that OP shared was stilll available to download, I certainly still have a copy of it if you’d like to try it. This method you linked seems somewhat different, let me know if it performs very well for you (VS handing the USB device directly to a VM).
I set this up yesterday and WOW it seems great so far! Either none or the tiniest bit of increased latency VS directly giving the VM access to the USB device, but with the benefit of efficient (low-resource) Hyper-V virtualization. This might be the solution I’ve been looking for!
I was using USBIP at first but I kept having problems with it disconnecting plus I didn’t like that I had to install the addon and the software on my pc to get it to work. For Z-Wave rather than try to pass my dongle through to hyper-v I just run the standalone version of Z-Wave JS UI. You simply download the exe file and double click on it to run it. From there you simply connect it to home assistant using the websocket service. After this I just used nssm to run Z-Wave JS UI as a windows service then I used a powershell script and windows task scheduler to auto update Z-Wave JS UI from the github page.
Another option to passthrough your dongles is to use Ser2Net for windows. You just install the gensio and ser2net exe files from here, create a ser2net.yaml file, then run the ser2net exe. You can then use nssm to run ser2net.exe as windows service.
Oh no! I hope I don’t run into such disconnection issues with USBIP, because so far I’m really liking this setup.
I would expect the serial to network alternatives (Ser2Net) to run into the same latency issues as I was experiencing with Netburner. It was terrible, more or less how things were when I was using Zigbee on SmartThings - random inconsistent lags when using battery devices.
It started happening
It’s the HA-side of things, the add-on. Restarting the add-on seems to bring everything back to life, so I made an automation that detects my device(s) going offline and restarts the add-on. Hopefully that does the trick.
1 Like
Hi. i read you already have a lot of experience with dongles and hyperV. can you telle me which solution you suggest?
i run windows server 2022 with hyperv and want to use the aerotec z-wave dongle.
thanks in advance.
The best solution is to run the Z-Wave JS UI program on windows then connect it home assistant. You download the zip file from here Releases · zwave-js/zwave-js-ui · GitHub, then extract the contents of the zip, and double click on the exe file to run the program.
If you’re already using windows server, then just pass-through the entire USB controller to the Hyper-V VM. You will need to enable IOMMU and CSM in your BIOS settings, then run a few commands in an administrator power shell while cross-referencing with your device manager (for some device IDs).
It works great, basically your Hyper-V VM will own the entire USB controller (and therefore the USB ports) you assign to it, so windows won’t even detect those devices getting plugged in anymore. This can be motherboard-specific, but you will likely be able to assign it just a single controller, which is usually just 2-4 USB ports, the rest will remain unaffected. Let me know if you need more info (if the keywords I’ve included aren’t enough to google search your way to getting it to work).
1 Like
Hi Cornell,
i do understand what you’re writing, but i don’t understand exactly how i can connect to homeassistant. z-wave JS UI is running on a seperate windows machine. what do i have to setup in the z-wave js ui addon in homeassistant?
i have setup the ws server in the HA addon (server host: http://x.x.x.x and serverport: xxxx). do i have to enable z-wave also in this add-on?
You do not need the addon. You need to setup the integration. Go to settings > devices and services > click z-wave logo > click add hub > uncheck use the Z-Wave Supervisor addon > click submit > in the textbox replace localhost with the ip address of your windows machine running z-wave js ui.
Hi Cornell,
thanks! i managed to get it all working.
1 Like