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

hmm, I did get it to broadcast once when I first was setting up. However, I have not retested that part, using it mostly for sending commands. I will try it out later tonight if I remember and let you know.

Thanks !!!

Sorry to bug you, just checking to see if you had a chance to confirm broadcasting works.

Checked last night and wasn’t sure if DND time might be an issue. Tried again just now and broadcast did not work. Looking at myactivity I do see the call come in but it says it doesn’t know what to do or something like that.

ouch. Thanks for letting me know. will start looking for a new solution…

Here is what the error is in myactivity.google.com

As a workaround for broadcasting no longer working I installed Android-x86 in a Hyper-V VM, installed Google Assistant, Tasker, AutoInput, and Tasker Network Event Server.

I followed the guide here to get Tasker/AutoInput set up to send Assistant commands, then just tweaked things a bit so that I could send an HTTP GET to the IP of the VM with the command.

I then added the URL as a rest_command in Home Assistant and use a template in the URL to pass the variables I set everything up with.

So far it’s been working, but this is a huge hack because basically Home Assistant sends the web request, Tasker Network Event Server picks it up and triggers the Tasker task, then AutoInput literally simulates touches in the app to open the manual text entry, type in the command, hit send. The one advantage is that I can send literally any command that can be sent on Google Assistant on a phone, including playing music. I expect it’s not going to be very reliable though…

This should work with really any Android device (that supports all apps required) so anyone who doesn’t want to mess with the VM could use an old phone or buy one and just keep it plugged in at home and accomplish the same thing.

i assume you would be able to set up multiple apps like this in the same VM? i.e. for other “smart” things that can only be controlled by an app

Yes for sure, the Tasker web server can filter based on the parameters sent, so it can trigger different tasks based on what’s being sent.

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

According to “namdoh” (Supposedly a Google Assistant employee) in this thread, a fix is coming soon. Looks like next Friday is the ETA. Fingers crossed.

4 Likes

Did we get a fix for this yet?

I believe the ETA was for next Friday based on the posts in my link.

Hmm cant wait to get this feature back soon. Google tts is horrible comapared to the natural speaking

The broadcast stopped working, how to troubleshoot?

Read the previous posts. It is broken until Google fixes it.

@chocomega have you thought about making a component that doesnt need the webserver ?

Hope they fix it, was one of the coolest feature of HASS.

Shall we revert back to TTS?

Which Friday?

I also get this message, any solution?