dusty-nv / jetson-containers

Machine Learning Containers for NVIDIA Jetson and JetPack-L4T
MIT License
1.89k stars 416 forks source link

Add `wyoming-openwakeword` addon for `homeassistant-core` container #471

Closed ms1design closed 2 months ago

ms1design commented 2 months ago

Hi @dusty-nv 👋

Just small a WIP status update from my side – I am currently working on below jetson-containers:

So far I have working:

dusty-nv commented 2 months ago

OK cool!, thanks @ms1design - sounds great! Should I go ahead and build/push your previous homeassistant-core dockerfile, or wait for your refactored one?

ms1design commented 2 months ago

@dusty-nv I don't want to block dev branch, so you can go with current, merged version which still works. This one I plan to finish in 1-2 days, before my bday trip to AMS.

Here I hope to get ha-core working with example add-on over wyoming and native auto-discovery in HA. Later I can describe it in docs, there are some caveats which we could discuss with HA Team.

dusty-nv commented 2 months ago

OK, will do! I also ordered some z-wave stuff today to try it with. Hope you have fun on your birthday trip, perhaps the orin we sent will make an aptly time bday present! 😄

dusty-nv commented 2 months ago

OK it built!, these images are now up:

dustynv/homeassistant-core:r36.2.0
dustynv/homeassistant-core:r35.4.1

dustynv/homeassistant-core:2024.4.2-r36.2.0
dustynv/homeassistant-core:2024.4.2-r35.4.1
ms1design commented 2 months ago

Definitely @dusty-nv! 🙌 I saw the delivery receipt and the whole thing makes me happy ;) TY! you know how it is - no man could ever say NO to more compute 😂🤓

ms1design commented 2 months ago

Ok @dusty-nv it seems that everything is done here. Please treat that wyoming-openwakeword as example how to add other HA add-ons here as a compatible Jetson containers. I started with this one, because I'm using it in my Assist Pipeline configuration in Home Assistant.

wyoming-openwakeword

Here's the output from the add-on after pairing with Home Assistant Instance:

wyoming-openwakeword console output
s6-rc: info: service s6rc-oneshot-runner: starting
s6-rc: info: service s6rc-oneshot-runner successfully started
s6-rc: info: service fix-attrs: starting
s6-rc: info: service fix-attrs successfully started
s6-rc: info: service legacy-cont-init: starting
s6-rc: info: service legacy-cont-init successfully started
s6-rc: info: service openwakeword: starting
s6-rc: info: service openwakeword successfully started
s6-rc: info: service discovery: starting
DEBUG:root:Namespace(uri='tcp://0.0.0.0:10400', models_dir=PosixPath('/usr/local/lib/python3.11/dist-packages/wyoming_openwakeword/models'), custom_model_dir=['/share/openwakeword'], preload_model=['ok_nabu'], threshold=0.5, trigger_level=1, output_dir=None, debug=True, log_format='%(levelname)s:%(name)s:%(message)s', debug_probability=False, version=False, model=[])
DEBUG:root:Loading ok_nabu_v0.1 from /usr/local/lib/python3.11/dist-packages/wyoming_openwakeword/models/ok_nabu_v0.1.tflite
DEBUG:wyoming_openwakeword.handler:Started thread for ok_nabu_v0.1
DEBUG:root:Loading /usr/local/lib/python3.11/dist-packages/wyoming_openwakeword/models/melspectrogram.tflite
DEBUG:root:Loading /usr/local/lib/python3.11/dist-packages/wyoming_openwakeword/models/embedding_model.tflite
INFO:root:Ready
DEBUG:wyoming_openwakeword.handler:Client connected: 1264218602132616
DEBUG:wyoming_openwakeword.handler:Client disconnected: 1264218602132616
s6-rc: info: service discovery successfully started
s6-rc: info: service legacy-services: starting
s6-rc: info: service legacy-services successfully started
DEBUG:wyoming_openwakeword.handler:Client connected: 1264222638735951
DEBUG:wyoming_openwakeword.handler:Sent info to client: 1264222638735951
DEBUG:wyoming_openwakeword.handler:Client disconnected: 1264222638735951
DEBUG:wyoming_openwakeword.handler:Client connected: 1264271132755228
DEBUG:wyoming_openwakeword.handler:Sent info to client: 1264271132755228
DEBUG:wyoming_openwakeword.handler:Client disconnected: 1264271132755228
DEBUG:wyoming_openwakeword.handler:Client connected: 1264431284147158
DEBUG:wyoming_openwakeword.handler:Sent info to client: 1264431284147158
DEBUG:wyoming_openwakeword.handler:Client disconnected: 1264431284147158

Later, probably after our second Jetson AI Research Group online meeting I plan to add more add-on's to connect everything in a working Assist Pipeline:

Have fun everyone!

dusty-nv commented 2 months ago

Awesome stuff @ms1design, I appreciate the level of detail required that you did here and got us started off in a good direction on this project 👍

dustynv/wyoming-openwakeword:r36.2.0 and dustynv/wyoming-openwakeword:r35.4.1 are now up, and dustynv/homeassistant-core was updated. I made some minor tweaks but mostly kept everything the same as possible out of fear of breaking things 🤣

ms1design commented 2 months ago

Thanks @dusty-nv, for update to keep this PR with the new approach:)

I noticed that you are linking: RUN ln -s /data/homeassistant /config and also added a new command to jetson containers. Is that something like adding a volume using —build-arg?

dusty-nv commented 2 months ago

@ms1design basically that sets the default config to be mounted under jetson-containers/data/homeassistant (the /data dir is mounted by default by jetson-containers run aka run.sh) this is consistent with all the other jetson-containers caching their data by default under there, then each user doesn't need to know the specifics.

However you can still override this of course by specifying --volume /my/homeassistant/config:/config when you start homeassistant-core (or like in your docker-compose)

And if user doesn't use jetson-containers run and doesn't manually specify the /config mount, then it will fall back to just creating the config inside the container.

ms1design commented 2 months ago

Sounds reasonable, thanks for explanation @dusty-nv!