Broadcast message on Google Home without interrupting music and without "Incoming broadcast"

I just want to share a “new” easy way of broadcasting notifications from Home Assistant without interrupting music that is playing on the Google home speakers. (tested with Spotify)
This is not a step-by-step tutorial but more like a hint of what to do.
If I posted it in the wrong part of the Forum, please tell me where to move it.

EDIT: Important, you will get rid of the Incoming Broadcast message :wink:

Here we go…

Start by creating a template switch in HA

switch:
  - platform: template
    switches:
      broadcast_switch1:
        friendly_name: "Broadcast Switch 1"
        turn_on:
          service: switch.turn_on
          target:
            entity_id: switch.broadcast_switch1
        turn_off:
          service: switch.turn_off
          target:
            entity_id: switch.broadcast_switch1

Then do a new sync in the Google Home app with Home Assistant to update with the new switch. Go to home.google.com in a web-browser and log in. Create a new automation like this:

metadata:
  name: Broadcast 1
  description: Scripted automation

automations:
  starters:
    - type: device.state.OnOff
      state: on
      is: true
      device: Broadcast Switch 1 - Kitchen #Name of the switch and the location

  actions:
    - type: assistant.command.Broadcast
      message: The dishwasher is ready
      devices:
        - Kitchen - Kitchen    #Name of the google assist and the location
        - Bathroom - Bathroom  #Name of the google assist and the location

Now, when ever you turn the switch on, in an automation or script or whatever, the message will be played and after that the music will continue :slight_smile:

7 Likes

How much have you played with this?
Have you seen a way to play an MP3 at all?

Sorry, no more than what is described above.

Works like a charm :slight_smile:

I was using text commands to make it “Repeat after me”. This is less cumbersome when it comes to the configuration and it only prepends “You said” to the message, but it does stop the music.

Yours doesn’t so I will use it for my most repeated notifications.

Does this need HA Cloud?

Can you clarify what you mean when you say “Then do a new sync in the Google Home app with Home Assistant to update with the new switch.” ?

“Hey Google, sync my devices.”

You can also use a switch instead of a template.
This works well!

I wanted to use this in combination with my doorbell. But there’s a 15s delay. I think the same can be done with this integration: Google Assistant SDK - Home Assistant

I wonder, would it be faster?