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

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

Aw, this is terrible, terrible news.

I know the Google Assistant addon itself recently needed to update…
https://github.com/home-assistant/hassio-addons/tree/master/google_assistant

…anything related? I don’t know what I’m looking at.

Yeah, looks like the framework got bumped a major version. So yeah, the repo needs to be updated for this add on to use the most recent python package most likely.

Good to know you’re aware of this. I’m already starting to miss that smooth TTS voice. Back to robot woman for now.

I believe your addon uses Google Assistant Service (grpc). Am I correct ?

I think Google just disabled the broadcast feature :frowning:
https://developers.google.com/assistant/sdk/overview#features

Same issue here.

Google My activity shows that the answer was “Sorry, it looks like I can’t broadcast right now. You might want to try again later.”

People on smart things forums seem to have the same problem.

Has anyone that has this issue tried using the Google Assistant app for the phone to see if broadcasting there works?

I also get an error just using the phone app.

This is interesting. It’s working for me if I use the voice command but not if I type in the command on my phone’s assistant!

I don’t know why I didn’t think to try that before. It causes Assistant to hang for me.

So yes, I did try it when it first started happening and it did work. However now it also just hangs for me.