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

You just have to setup one of your device with Google assistant in English then from this device, use the broadcast function. The other devices will receive the broadcasted message even if they are not setup in English.

For example, I have my phone setup in english and my Google Home devices are in french.
From the phone, I type or say “Broadcast Bonjour tout le monde”. The Google Home devices will play or do TTS “Bonjour tout le monde” in french.

Mine too but with bad English pronunciation

Well Google might have changed something then. I haven’t used this recently.
Will try again when I’m back home and let you know.

The broadcast service is working fine for me although not all my speakers play the message synchronized; not a huge deal. The command service got my hopes up for issuing music requests but this didn’t work for me either. This probably wouldn’t work for everyone, but my workaround has been to use TTS on one GH speaker that’s within earshot of another since I haven’t seen a more elegant way to do this. For context, I have a different pandora station play depending on the day of the week when I walk into the bathroom in the morning.

  action:
    - service: tts.google_say
      entity_id: media_player.master_bathroom
      data_template:
        message: >
          {%- if now().strftime("%a") == 'Sun' %}
          Hey Google Play Sublime
          {%- elif now().strftime("%a") == 'Mon' %}
          Hey Google Play Metallica
          {%- elif now().strftime("%a") == 'Tue' %}
          Hey Google Play Stone Temple Pilots
          {%- elif now().strftime("%a") == 'Wed' %}
          Hey Google Play Pearl Jam
          {%- elif now().strftime("%a") == 'Thu' %}
          Hey Google Play My Shuffle
          {%- elif now().strftime("%a") == 'Fri' %}
          Hey Google Play Tupac
          {%- elif now().strftime("%a") == 'Sat' %}
          Hey Google Play My Thumbprint
          {% endif %}

Just tried broadcasting in french, still works on my side :man_shrugging:

is it speaking french french, or french as an english man would do? Is yo9ur GH set with french or english?

excellent addon

My GH is in french, so yes the voice is with the french accent. Only my phone is in english.

Ahh then of course it works. Problem is when GH is in ENglish and you want to broadcast in other language.

In TTS I have the option of using a language prefix (IT for italian) and works perfectly then in Italian (even if GH is ijn English)

Ok so what you’re trying to do is not possible indeed. The broadcast feature only uses the GH language.

Google TTS component uses a totally different method (a hack of google translate API I believe) that’s why it supports different languages. (The sound quality is pretty bad also compared to the real GH TTS)

Beautiful work! Thanks for sharing this!

I’m getting the below error when trying to run in Docker. any ideas?

standard_init_linux.go:189: exec user process caused "exec format error"

Love this component, my favourite

Hi, your addon stopped working, most probably because I set up 2 steps verification from google (perhaps)

YOur log says this

[Info] Install/Update service client_secrets file

can you help? Thanks

I have got this up and running and it works with my lights (eg http://192.168.1.12:5000/command?message=turn%20on%20the%20lounge%20lights works great).

But if I use it with “Turn on Shiled TV” or “Turn on Android TV” in the same way, it doesn’t work. It works when I speak it to my Google Home, but not otherwise. Any suggestions? :slight_smile:
Cheers,

James

mispelled? Check the name and aliases, use aliases that are not common: i.e. turn on samsung TV (shield is a cast device too, maybe that gives problems)

Thanks for the suggestions. The misspelling was just a typo in my comment!

I’ll try those other suggestions out. :slight_smile:

I’m having trouble getting my service to start, the log just says

[Error] You need initialize GoogleAssistant with a client secret json!

However I’ve already copied the google_assistant.json file into my regular home assistant /config folder.

My config looks like this:

{
  "client_secrets": "google_assistant.json"
}

Any ideas?

Never mind, I hadn’t put it in the /share/ directory. Broadcasts work, however I’m having issues with commands like “watch rick and morty on living room tv”, even though this works when typing it into the assistant on my phone. This is using the /command endpoint. Any way to resolve this?

Casting commands don’t seem to work. I also tried using shortcuts entered in to the app and still nothing. Too bad because automating a command to “play news on the family room tv” or music etc would have been really cool.