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
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