USB Passthrough: Zigbee/Z-Wave/Matter for Home Assistant

Hello, I’m trying to figure this out and I’ve only found one tutorial/guide/forum post with good info anywhere about this after hours of searching. To start I will give specs:

Intel i5 12600K
ASRock H670M-ITX mobo
32GB RAM (Teamgroup T-Create)
3x 4TB IronWolf drives in RAIDZ1
SONOFF Zigbee 3.0 USB Dongle Plus-E

I am trying to get the Zigbee USB hub to work with the Home Assistant app (or even a VM running HA). The ONLY guide I’ve found, including searching the several existing Reddit posts with unclear answers and TrueNAS documentation, is this video:

How to Install Home Assistant Supervised on TrueNAS Scale with working ConBee II/SONOFF Zigbee Stick

In his video, he creates a VM running Debian to install HA on, instead of using the app. I would like to keep this simple as possible as I’m obviously not good at much of this. Is this the best known way of doing this? If there is a way to pass only my Sonoff USB hub to the App version of HA that would be nice, though I’m not opposed to creating a VM if that’s the best way. I have also found that several people just gave up and purchased a PCIe device for this… which is not an option for me (I do not have any free PCIe slots).

I need to know if it’s even possible to pass through a SINGLE USB device rather than the controller or a PCIe device. I can’t sacrifice every single USB port on my system to Home Assistant if I won’t be able to pass any through to other VM’s/apps.

I see the option in the app settings for “devices,” however I cannot find info on exactly how to figure out what to type in those fields, or if that’s even the correct way to do it:

Can anyone help me with a solution, perhaps how to figure out exactly what to put in those fields, and if there’s anything else I need to do to pass through a single USB dongle? I find it hard to believe that there isn’t more info I could find about this process, given how many people in the home lab/home server hobby are also into home automation and HA, and therefore Zigbee/Z-Wave/Matter devices…

I apologize if I’ve missed something on the forums, I have searched. Thank you!

-Jacob

I was able to install HAOS in a Linux VM and successfully pass through my Sonoff Zigbee USB 3.0 Hub. The only setting that was confusing was the “controller type” box in the Devices menu, for which I selected qemu-xhci. I don’t have a clue what this option means or does, but it worked for me.

This solution is actually better than the app because the app version wasn’t able to make use of all of my backup file, addons and a few other things would not transfer over. This isn’t an issue with the VM install. Here is the guide I followed:

Installing HAOS in a VM on TrueNAS SCALE

This is certainly possible when using a VM, or running in Docker. But I do not use, and I do not recommend the TrueNAS “app” for Home Assistant.

If you’re going to use a VM, I’d run HAOS. There’s no longer a need for using a VM to run docker. Just so you are aware, if you want the convenience of using add-ons, HAOS is the only option.

If you do not want to use HAOS, use docker-compose. You can set Home Assistant up as a custom app or run dockage and drop your compose file in there. You can pass a single USB device to Home Assistant using the standard docker-compose passthrough method.

1 Like

But I do not use, and I do not recommend the TrueNAS “app” for Home Assistant.

@troy , what are the downsides to using the built-in TrueNAS app besides missing out on the “convenience of using add-ons”?

Is there an up-to-date tutorial on creating a VM with HAOS and migrating the Home Assistant app’s settings?

Regarding a ZigBee hub,

  1. Is it even possible to connect the USB to a TrueNAS app?
  2. You mention the option of using Docker Compose as an option to connect the ZigBee dongle. How does this option compare to the HAOS VM?
  3. Are there ZigBee USB hubs which are recommended? Known to work with Home Assistant on TrueNAS?

There’s nothing wrong with the app. I don’t like that it is opinionated, and they don’t document that fact. What I’ve observed on multiple occasions is that a new user starts using the app, then later decides they want to switch to HAOS or move away from the app for various reasons. So, they make a backup using Home Assistant’s built-in function, but when they go to restore the backup, it fails. Then they blame Home Assistant, but in reality, the backup fails to restore because the Home Assistant App is configured to use a third-party database out of the box. It’s all well and good if you stick with the app, but if you want to restore a backup in any other Home Assistant instance, you must manually edit the configuration before it will work. I dislike the fact that the app maintainers don’t document the changes they’ve made or provide instructions on how to undo them. When the backup/restore process doesn’t work as expected, it’s Home Assistant that gets blamed for not functioning correctly.

There is a guide in the Home Assistant forums that covers the installation of HAOS in a VM for both libvirt and Incus methods. There’s no specific information on editing the app configuration; however, you just need to remove or comment out the portion that sets up the third-party database.

  1. Yes
  2. Using Docker Compose means no add-ons. The App is basically the same as using Docker Compose, except the app is using a third-party database.
  3. It’s better to ask this question in the Home Assistant forums. I think it depends on whether you use the built-in ZigBee or one of the ZigBee add-ons. I don’t use ZigBee, so I’m not familiar with its details. The only thing I know for sure is that the Conbee ZigBee hubs do not work with USB device passthrough to a TrueNAS VM. You can use them, but they require using PCI passthrough of the USB controller to which they are connected.

Thanks @troy
I want to make sure I understand correctly that the main drawback to the native app, other than the absence of HAOS add-ons, is the difficulty in migrating the DB settings.
When I migrated from the TrueCharts app to the TrueNAS app, I had a similar issue, but it was rather straightforward: I had to make sure that the app’s UI settings matched and then unpack the HA backup.

Since my server does not have a powerful CPU, I’m concerned about the resources required to run a VM compared to a native app. Isn’t a native app more efficient in terms of the resources it uses?

Using Docker (either straight Docker Compose or the App) consumes fewer resources. However, in my experience, using a VM consumes a negligible amount of resources. The 4GB of RAM I assigned is lost to TrueNAS, but my CPU usage is only 0-2% while HAOS is running (unless I’m updating something)

I agree with troy. HAOS is very efficient. Another advantage of not using the app is I get to pick my database, in my case mariadb not postgres. And, I can update that on a separate schedule if I wish. Updates are simpler too, trivial even.

HAOS makes things so much simpler, including the network aspect.

My VM CPU usage is under 1% and I have a lot of addons and integrations.