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

I have just installed this addon and created my json file and saved it in the share directory but when I hit the start button for the addon, it doesn’t seem to work. nothing in logs…

any ideas?

I have this working and appreciate that it’ll let me send broadcasts without interrupting music. Excellent!

But I’m having trouble seeing the utility of the ‘command?message=’ feature. Without the ability to cast or play GPM (http://[HASSIO LOCAL IP]:5000/command?message=[play some music]) i’m having trouble coming up with ideas. I can’t even get it to recognize the ifttt commands i’ve set up with Google Assistant.

I understand that it can be used to control lights and set alarms, but I normally do that by voice or regular HA automations so I’m just hoping people can help me explore the realm of the possible :slight_smile:

In the meantime I’m happy with broadcasts!

did you ever get it working? i am getting the same error

Nevermind got it working with IP instead of hassio.local.

Hassio.local works for just typing into the url but not for the Rest notification.

Hi,

I seem to be stuck with authentication? Tried a few things and read this thread but nothings working yet. Maybe I’ve missed something - please point me to it if so.

My setup and steps so far:

  1. Running Hass.io 0.66.1 on RaspPi
  2. Got the google_assistant.json file and copied it to \share.
  3. Google Assistant Webserver installed via ‘AndBobsYourUncle’s Experiments’ add-on (Done several re-installs). It’s “green” and “Running on http://0.0.0.0:5000/” ( this means it’s not authenticated from what I understand)

Symptoms:

  1. When I hit 'Open Web UI" I get “This site can’t be reached. 192.168.1.117 refused to connect.Try: Checking the connection. Checking the proxy and the firewall, ERR_CONNECTION_REFUSED”

Other things I’ve tried:

  1. Changing the Host values (I don’t really get this stuff)
  2. Trying the same steps either via my local or remote hass.io connection (running duckdns & let’s Encrypt via add-on)
  3. Just going to http://[LocalIP]:9324 or new host value (say 9327) to try to authenticate.

Some things that may affect my situation (but I don’t really get a lot of this, so maybe it’s not relevant:

  1. I’ve got port forwarding setup in my router for my remote connection.
  2. I can’t authenticate the Google Assistant add-on either (official one). Same symptoms.
  3. I have my Google Assisstant component up and working (controlling hass.io via Google Home voice commands)

My .json file looks a bit like this ( below:

{“installed”:{
“client_id”:“739###3-4hhvb3faer6###56mm0dv.apps.googleusercontent.com”,
“project_id”:“th###hership-9##3”,
“auth_uri”:“https://accounts.google.com/o/oauth2/auth”,
“token_uri”:“https://accounts.google.com/o/oauth2/token”,
“auth_provider_x509_cert_url”:“https://www.googleapis.com/oauth2/v1/certs”,
“client_secret”:"#######pCtTPc###85",
“redirect_uris”:[“urn:ietf:wg:oauth:2.0:oob”,“http://localhost”]}}

Maybe it’s something dumb. Can anyone help? More info below:

Google Assistant Webserver Log:

[Info] Install/Update service client_secrets file

Google Assistant add-on either (official one) Log:

[Info] Show audio device
**** List of PLAYBACK Hardware Devices ****
card 0: ALSA [bcm2835 ALSA], device 0: bcm2835 ALSA [bcm2835 ALSA]
Subdevices: 8/8
Subdevice #0: subdevice #0
Subdevice #1: subdevice #1
Subdevice #2: subdevice #2
Subdevice #3: subdevice #3
Subdevice #4: subdevice #4
Subdevice #5: subdevice #5
Subdevice #6: subdevice #6
Subdevice #7: subdevice #7
card 0: ALSA [bcm2835 ALSA], device 1: bcm2835 ALSA [bcm2835 IEC958/HDMI]
Subdevices: 1/1
Subdevice #0: subdevice #0
[Info] Setup audio device
[Info] Install/Update service client_secrets file
[10:31:ERROR:audio_input_processor.cc(755)] Input error
[10:33:ERROR:audio_input_processor.cc(755)] Input error

I’m not really sure what I did, but it seems to be working now. I got the add-on to go “green”. I still can’t open the UI, but sending this results in google home talking as expected.

http://192.168.1.117:5000/broadcast_message?message=test message

You could use the Google Home Local API to dynamically set rooms as do not disturb for when you’re sending the current broadcast and then unset them after. Perhaps even poll them first to get current do not disturb settings, so you can reset them after you do a broadcast to a specific device.

I’m going to have to play around with this, because I’m liking my idea a lot now :wink:

Please, help!
I sent command:
http://XXX:5000/broadcast_message?message=test%20does%20it%20play?
See in browser:
{“status”: “OK”}
See at https://console.developers.google.com no errors:


But not hear anything from Google Home :frowning:

In logs:
[Info] Install/Update service client_secrets file

    • [21/Apr/2018 17:37:06] “GET /broadcast_message?message=test%20test%20test%20testtest%20testtest%20testtest%20testtest%20testtest%20test HTTP/1.1” 200 -
    • [21/Apr/2018 17:38:01] “GET /broadcast_message?message=test%20test%20test%20testtest%20testtest%20testtest%20testtest%20testtest%20test HTTP/1.1” 200 -
    • [21/Apr/2018 17:41:13] “GET /broadcast_message?message=test%20does%20it%20play? HTTP/1.1” 200 -
    • [21/Apr/2018 17:41:49] “GET /broadcast_message?message=test HTTP/1.1” 200 -
    • [21/Apr/2018 17:42:47] “GET / HTTP/1.1” 404 -
    • [21/Apr/2018 17:42:48] “GET /favicon.ico HTTP/1.1” 404 -
    • [21/Apr/2018 17:43:02] “GET /broadcast_message?message=test HTTP/1.1” 200 -
    • [21/Apr/2018 17:49:32] “GET /broadcast_message?message=%D1%82%D0%B5%D1%81%D1%82 HTTP/1.1” 200 -
    • [21/Apr/2018 17:51:33] “GET /broadcast_message?message=%D1%82%D0%B5%D1%81%D1%82 HTTP/1.1” 200 -
    • [21/Apr/2018 17:52:38] “GET /broadcast_message?message=test%20does%20it%20play? HTTP/1.1” 200 -
    • [21/Apr/2018 17:56:25] “GET /broadcast_message?message=test%20does%20it%20play? HTTP/1.1” 200 -
    • [21/Apr/2018 18:01:50] “GET /broadcast_message?message=test%20does%20it%20play? HTTP/1.1” 200 -
    • [21/Apr/2018 18:05:18] “GET /broadcast_message?message=test%20does%20it%20play? HTTP/1.1” 200 -
    • [21/Apr/2018 18:09:43] “GET /broadcast_message?message=test%20does%20it%20play? HTTP/1.1” 200 -
    • [21/Apr/2018 18:12:16] “GET /broadcast_message?message=test%20does%20it%20play? HTTP/1.1” 200 -
    • [21/Apr/2018 18:13:15] “GET /broadcast_message?message=test%20does%20it%20play? HTTP/1.1” 200 -

Why???

Did you fix it? How?

Today all is working OK! But only English. Can’t change language of message :frowning:

Has anyone been able to get casting controls to work? I mostly set this up so I could send the command to turn off my TV after HDMI CEC stopped working. Now the command sends properly, but the google home app says “Sorry, something went wrong. When you’re ready, give it another try”

Has anyone else been getting this type of error when trying to do most commands?

@mrneilix do you have multiple google home devices? I haven’t tried setting timers yet but I’m guessing it could be that it doesn’t know what device to set the timer on.

Following the excellent code examples from @anon35356645, I have expanded mine to have a second broadcast function.
I did not want whole house broadcast notifications to be played between the hours of 10:30PM and 8:00AM, so I added a condition statement to the Broadcast Message automation

automation.yaml

- id: broadcast_message
  alias: Broadcast message
  trigger:
    platform: state
    entity_id: input_text.broadcast_message
  condition:
    - condition: time
      after: '08:00:00'
      before: '22:30:00'
    - condition: template
      value_template: '{{ (states.input_text.broadcast_message.state | length) > 0 }}'
  action:
    - service: script.send_broadcast

To still be able to receive priority broadcast messages (eg. alarms, unknown device on network etc) I then added a third notification service, input_text, automation and script to my setup.

configuration.yaml

   - name: Google Assistant Priority
     platform: rest
     resource: http://127.0.0.1:5001/broadcast_message
   broadcast_message_priority:
     name: Broadcast Message Priority

automation.yaml

 - id: broadcast_message_priority
   alias: Broadcast Message Priority 
   trigger:
     platform: state
     entity_id: input_text.broadcast_message_priority
   condition:
     - condition: template
       value_template: '{{ (states.input_text.broadcast_message_priority.state | length) > 0 }}'
   action:
     - service: script.send_broadcast_priority

scripts.yaml

 send_broadcast_priority:
   sequence:
     - service: notify.google_assistant_priority
       data_template:
         message: '{{ states.input_text.broadcast_message_priority.state }}'
     - service: input_text.set_value
       data:
         entity_id: input_text.broadcast_message_priority

I’m sure there is probably a more elegant solution but this works well and has boosted the WAF about getting woken up in the early hours of the morning with random unwanted “welcome home” messages from the google home on the nightstand when a phone drops its wifi connection - while still giving me peace of mind that I’ll be alerted to any messages I’ve set as priority.

2 Likes

You might find some helpful code in my TTS script example to repurpose. One of the things I do there is have a variable that I can pass that overrides quiet hours.

Hello,
Newbe here. I’m really interested in this add-on but i use hassbian on termux and don’t have a clue what i have to do to install this on my system.
I’ve been able to retrive the googlejson as suggested but I’m stuck after that.
What package do i need etc ? How did you manage to do it?

This has been working great for months, but as of some time this afternoon it stopped working. I’ve done the typical troubleshooting and reboots and the server is returning 200, but nothing’s actually broadcasting. I’m starting to wonder if it’s not on my end…Anyone else seeing this?

Same problem here. Haven’t had any issues until yesterday. Server acts and behaves normally but nothing is broadcast. I can still send broadcasts normally by using typing with my phone using Android’s built in assistant and using the voice broadcast command.

Additionally, checking my google cloud account shows no errors and lists all of the Google Assistant API requests the server has sent. Looks like this might be an issue on Google’s end.

I also started having problems today, I have confirmed the add-on is recieving the command but nothing is actually happening.

Can confirm that it has indeed stopped working. Time to start debugging the add-on. I suspect that maybe the version of the Google Assistant api that is being used was finally deprecated? Could be quite a few things.

If anyone figures it out before me, feel free to open a PR on the repo. It’d be greatly appreciated.

1 Like