I am using Google home devices as alarm warnings but I am unsure how to best return the volume to a sensible level after it has emitted the warning message.
action:
- service: alarm_control_panel.alarm_trigger
entity_id: alarm_control_panel.home_alarm
- service: media_player.volume_set
data:
entity_id:
- media_player.kitchen
- media_player.bedroom_speaker
volume_level: '0.8'
- service: tts.google_translate_say
entity_id:
- media_player.kitchen
- media_player.bedroom_speaker
data_template:
message: >
House alarm has been activated. The {{ trigger.to_state.attributes.friendly_name }} has been opened.
The code above works fine but then leaves those Google devices at a loud volume. Is there a way to interrogate each Google home for its volume? How do I return it to the actual volume or just a sensible volume as soon as the message has finished playing. If I just set the volume to 0.3 in the next action it returns straight to 0.3 before the message is read out. Any advice appreciated.