Is there a way to use OpenWakeWord when running HA Container?

My Home Assistant instance is running on an Intel NUC within Docker on Ubuntu Server 22.04. I’ve wanted to explore using OpenWakeWord, but I don’t know how to use it without having access to add-ons which requires that your instance was made using HAOS.

Addons on HAOS are nothing more then docker containers.

So, running on Linux, you just have to install the OpenWakeWord (and configure it).

You can install it using Python:
Installing openWakeWord is simple and has minimal dependencies:

pip install openwakeword

But it has a container as well, this is the one I found:

once the docker container is spun up, how do you add to home assistant? It doesnt show up in the add voice assistants form

Hey,

I dont know if you ever figured this out, but I finally got it working with the home assistant docker image in unraid

So piper and whisper both have their own device presets that you can use in HA to hook up external dockers to through ip/port, but openwakeword does not. That said, I found that you can just use the generic Wyoming Protocol device to hook it up and then it works perfectly. In fact, if you go into device settings, you’ll see whisper and piper both registered as generic wyoming protocol devices, so my guess is the piper and whisper devices are both just aliases or presets for the wyoming protocol type device.

In addition, if you’re running on unraid or a docker setup in general and you want to add a custom wake word, you’ll need to add a path to a shared folder (in the case of unraid, I mounted the docker path /share/custom/ to the host path /mnt/user/appdata/openwakeword/ ) and then you add a flag -custom-model-dir /share/custom/ (the path in the docker container, not on the host). after that you just drop the .tflite files in the root of that folder, make sure the permissions allow the container to read the file, rebuild the container, and you should be good.

As a note, in unraid, you have to enable advanced settings on the docker container settings to see the “post commands” option and add the --custom-model-dir to that section.

Heres the final docker command generated from unraid with my settings:

docker run
  -d
  --name='openWakeWord'
  --net='bridge'
  -e TZ="America/Los_Angeles"
  -e HOST_OS="Unraid"
  -e HOST_HOSTNAME="Tower"
  -e HOST_CONTAINERNAME="openWakeWord"
  -l net.unraid.docker.managed=dockerman
  -l net.unraid.docker.icon='https://raw.githubusercontent.com/digiblur/unraid-docker-templates/master/images/openwakeword.png'
  -p '10400:10400/tcp'
  -v '/mnt/user/appdata/openwakeword/':'/share/custom/':'rw' 'rhasspy/wyoming-openwakeword'
  --preload-model 'ok_nabu'
  --custom-model-dir /share/custom/

Hope that helps!