Connecting microphone to container(s) (HomeAssistant, Wyoming)

If you want an offline voice assistant in HomeAssistant, you would usually install the wyoming-whisper, wyoming-piper and wyoming-openwakeword addons. Since on TrueNAS HomeAssistant runs in a container rather than directly on a host, you can’t install addons inside of HA. Instead you have to run these service somewhere else and then connect them to HA over the network.

So I tried to do that by creating 3 custom apps from those images:

which is working fine and I can successfully add them to HomeAssistant using the Wyoming-Protocol Integration.

But now I somehow have to connect my microphone to it and that is where I’m stuck. Has anyone here done this before and can give me some advice?

I’m using a USB mic btw.

“Solved” the issue by adding another container based on:

Since there is no way to pass through a specific device in a custom app, I had to check the Privileged option. I got it to work by adding these arguments:

  • –vad
  • –vad-trigger-level
  • 1
  • –vad-threshold
  • 0.6
  • –debug
  • –mic-command
  • arecord -D plughw:0,0 -r 16000 -c 1 -f S16_LE -t raw
  • –snd-command
  • aplay -D plughw:1,0 -r 22050 -c 1 -f S16_LE -t raw

I am just now starting this project and have come to the conclusion that this approach is the best setup for my environment. I have HA setup and got the 3 containers setup for whipser, piper, and OWW. I am creating the last container for the mic/speakers but how did you integrate that into HA so it could use them?

To connect it you have to add the IP of the server and port in the Wyoming protocol integration in home assistant.

How did you deploy the containers that is the part I’m having problems with do you use a custom app or portainer?