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

It seems so simple.
I wonder if pursuing a way to control an android phone would be easier.
Or putting my Raspberry Pi next to a Google Home device with a speaker…

I can’t get it working either.

Is there anyway we can get some more complete instructions please?

seems overkill. I’ll open an issue on github. Let’s see ig the developer is still intrested.

1 Like

Hi, is it still not possible to give play X music on Y device instruction? This would be so nice!
Tks

Hi, I followed the setup steps and couldn’t get through the authentication. My HA version is 0.99.3 on Raspberry Pi 4. Here are the error messages I got after clicking the “connect” button on the authentication page.

500 Internal Server Error
The server encountered an unexpected condition which prevented it from fulfilling the request.

Traceback (most recent call last):
File “/usr/local/lib/python3.5/dist-packages/cherrypy/_cprequest.py”, line 627, in respond
self._do_respond(path_info)
File “/usr/local/lib/python3.5/dist-packages/cherrypy/_cprequest.py”, line 686, in _do_respond
response.body = self.handler()
File “/usr/local/lib/python3.5/dist-packages/cherrypy/lib/encoding.py”, line 221, in call
self.body = self.oldhandler(*args, **kwargs)
File “/usr/local/lib/python3.5/dist-packages/cherrypy/_cpdispatch.py”, line 54, in call
return self.callable(*self.args, **self.kwargs)
File “/hassio_oauth.py”, line 46, in token
self.oauth2.fetch_token(self.user_data[‘token_uri’], client_secret=self.user_data[‘client_secret’], code=token)
File “/usr/local/lib/python3.5/dist-packages/requests_oauthlib/oauth2_session.py”, line 244, in fetch_token
self._client.parse_request_body_response(r.text, scope=self.scope)
File “/usr/local/lib/python3.5/dist-packages/oauthlib/oauth2/rfc6749/clients/base.py”, line 411, in parse_request_body_response
self.token = parse_token_response(body, scope=scope)
File “/usr/local/lib/python3.5/dist-packages/oauthlib/oauth2/rfc6749/parameters.py”, line 379, in parse_token_response
validate_token_parameters(params)
File “/usr/local/lib/python3.5/dist-packages/oauthlib/oauth2/rfc6749/parameters.py”, line 386, in validate_token_parameters
raise_from_error(params.get(‘error’), params)
File “/usr/local/lib/python3.5/dist-packages/oauthlib/oauth2/rfc6749/errors.py”, line 415, in raise_from_error
raise cls(**kwargs)
oauthlib.oauth2.rfc6749.errors.InvalidGrantError: (invalid_grant) Bad Request
Powered by CherryPy 17.0.0

1 Like

I just tried the setup using HA version 0.100.2 and got the same error after entering the Google auth code. Did you get it sorted out at all?

1 Like

Just tried to install this on HA version 0.101.2, and it seems to have installed successfully but I am unable to start the add-on, does anyone have any ideas as to why this might be?

1 Like

Is it the same as what I get here?

If so I think something changed on Google’s end and the dev has stopped working on the project.
I’m just waiting to see if Google will allow us to trigger routines based on Smart Home devices after the last press event. It seemed like they will.

That will satisfy my needs and the whack-a-mole will be over.

If so I think something changed on Google’s end and the dev has stopped working on the project.

Looks like GitHub - Apipa169/Assistant-Relay-for-Hassio: Send commands (including broadcasts) to the Google Assistant via Home Assistant (based on GitHub - greghesp/assistant-relay: A Node.js server that allows for sending commands to Google Home/Assistant from endpoints) supports broadcasting without interruption and is (currently) being maintained.

Nothing is ever permanent with Google. :disappointed_relieved:

A reminder that if you are using either this add-on - Google Assistant Webserver (GAW) - or the Assistant Relay (AR) Add-On - you might have issues with IPv6.

I have a BT Smarthub and both GAW and AR are working for me with Address Allocation Mode set to “Off” on the IPV6 Address Allocation. You can find this under Advanced Settings - IPv6 - Configuration.

If Address Allocation Mode is set to “Stateful” then no sound will come from any of my Google Homes - although both Add-ons show every indication it is working correctly

The Google Assistant Webserver is working on my Hassio RB4. Broadcasting is ok… and I can turn lights on and off but anything else command seems not to work.
I’d like to use this do skip video playing on one of my 2 Chromecasts and trigger it from a button on Hass. Skipping by voice works but by text through the webserver not.
Am I missing something? Could it be the italian language? I added English as second language but honestly I don’t know why it doesn’t work…
I didn’t try with Assistant Relay for Hassio because if I’m not wrong it’s just for broadcasting and notifications… or not?
please help

Assistant Relay can do more than only sending broadcasts. But I’m afraid it has the same limitation as what you are running now. The Google sdk does not support all types of commands.

Am using Google Assistant Webserver Addon Evertthing was working fine till yesterday,
Now, Suddenly it stopped working I see the following error in HA Addon Logs

"description":"Getting metadata from plugin failed with error: ('invalid_grant: Token has been expired or revoked.', '{\n "error": "invalid_grant",\n "error_description": "Token has been expired or revoked."\n}')","file":"src/core/lib/security/credentials/plugin/plugin_credentials.cc","file_line":82,"grpc_status":14}"

How to resolve it

suggests that the token created when you first installed this has expired - I would suggest (but I’m guessing!) taking a backup of client.json and cred.json and starting again as if you have just installed…

Thanks for this mate, I managed to get it to work by turning off night mode on my Google Home Mini.

Iim very, very new to this, and would just like to know how I can use a contact sensor to trigger a broadcast.
I’ve done it with the TTS plugin, but unsure how to do it with this one,
I don’t mess around too much with the code yet, so I was wondering if it’s achievable via the web interface?

Thanks for the work!

just replace code calling the TTS plugin notifier with a new notifier that calls the broadcast…

notify.yaml

- name: Google Assistant
  platform: rest
  resource: http://localhost:5000/broadcast_message

and then

   - service: tts.google_say
      data:
        entity_id: media_player.rumpas_room
        message: 'Ready to Go!'

becomes

   - service: notify.google_assistant
      data:
        message: 'Ready to Go!'
2 Likes

Thanks, I got it all working.
I’m even using the command function to control some Wiz lights that aren’t directly compatible with HA.

http://192.168.1.xx:5000/broadcast_message?message=hello%20there gives me:

{"status": "OK"}

but unfortunately my Google Home doesn’t say anything.

http://192.168.1.xx:5000/command?message=turn%20on%20tv turns on the TV as it should.

What’s going wrong with the broadcasting. Is there anything I have to set up to broadcast over my Google Home speaker?

no, if commands are working, the assumption is that broadcasts are working.

Can you check the “My Activity” for the google account you are broadcasting from?

In mine (and using a different addon - I managed to break my instances of this one), I get “You asked the Assistant to broadcast a message.” using “google assistant SDK”

(interesting - my activity used to show the actual message as well - doens’t seem to now)

I already found the issue: IPv6. Turned it off in my router and it works.

3 Likes