Community Hass.io Add-on: Google Assistant Webserver (broadcast messages without interrupting music)

For those who meet the requirements of the Google Assistant Library (i.e. arch linux-armv7l or linux-x86_64, audio capture and playback), feel free to try this workaround:

Disclaimer: this is not an Hassio add-on and I don’t intend to create one as I don’t use Hassio myself.
The following Python script is provided “as is”. With some linux knowledge this script can be run as a system daemon.

  1. You will need first to follow this guide “Embed the Google Assistant”:
    https://developers.google.com/assistant/sdk/guides/library/python/

  2. Once you’ve successfully installed the SDK and run the sample code, install Flask in the same virtual environment:
    pip3 install --upgrade flask flask-restful

  3. You may now run this Python script hotword_webserver.py

I slightly modified the provided sample code to include the web server code from @AndBobsYourUncle add-on. The web server URLs remain the same, so from Home Assistant perspective it can be a drop-in replacement.

N.B: In the Google Assistant settings on your phone, you should now see the new device registered in the previous steps. Make sure to provide an address for this device otherwise broadcasting won’t work. Optionally you can also setup the default media output for remote casting.

Enjoy!

4 Likes