All,
Could someone give me some guidance on setting the volume on all of the google home speakers across my home to max volume before playing a audio file (siren). And then after the script is turned off, having the volume set back to the original (not screaming) volume so that the next time someone uses a speaker after the siren has went off, it won’t blow their ear drums out.
Is there a way to do this on a group basis or does this have to be done on a individual basis (both turning the speakers up before the alarm and back down afterwards)
Currently, it looks like I am using an input number helper to set the speaker volume before the siren (don’t really know if it is truly working properly to set all of the speakers to max on the group basis)
And I don’t seem to have anything for setting the speakers back to their pre-alarm condition.
Thank you all ahead of time for any help you can give!!
security_response:
sequence:
- service: script.jarvis_alert
data_template:
who: "everywhere inside"
message: >
{{ [
",You have 60 seconds to disarm the alarm.",
",Please disarm the alarm within 60 seconds."
] | random }}
- delay:
seconds: 15
- service: script.jarvis_alert
data_template:
who: "everywhere inside"
message: >
{{ [
",You have 45 seconds to disarm the alarm.",
",Please disarm the alarm within 45 seconds."
] | random }}
- delay:
seconds: 15
- service: script.jarvis_alert
data_template:
who: "everywhere inside"
message: >
{{ [
",You have 30 seconds to disarm the alarm.",
",Please disarm the alarm within 30 seconds."
] | random }}
- delay:
seconds: 15
- service: script.jarvis_alert
data_template:
who: "everywhere inside"
message: >
{{ [
",Emergency services will be notified in 15 seconds if the alarm is not disarmed",
",Emergency services to be notified in 15 seconds"
] | random }}
- delay:
seconds: 15
- service: script.turn_on
data: {}
target:
entity_id: script.notification_security_alarm_audio_on
- service: script.turn_on
data: {}
target:
entity_id: script.notification_security_alarm_lights_on
notification_security_alarm_audio_on:
sequence:
- service: media_player.volume_set
data_template:
entity_id:
volume_level: |
{{ states('input_number.alarm_siren_volume') | float }}
- repeat:
until:
- condition: state
entity_id: alarm_control_panel.alarmo
state: disarmed
sequence:
- service: media_player.play_media
data:
media_content_id: media-source://media_source/sounds/siren.mp3
media_content_type: music
target:
entity_id: media_player.everywhere_inside
- wait_template: |-
{{ is_state("media_player.everywhere_inside", "idle") or
is_state("media_player.everywhere_inside", "off") or
is_state("media_player.everywhere_inside", "paused") }}
mode: single
notification_security_response_off:
sequence:
- service: script.turn_off
data: {}
target:
entity_id: script.security_response
- service: script.turn_off
data: {}
target:
entity_id: script.notification_security_alarm_audio_on
- service: script.turn_off
data: {}
target:
entity_id: script.notification_security_alarm_lights_on
- service: scene.turn_on
data: {}
target:
entity_id: scene.lights_before_alarm
- service: media_player.media_stop
entity_id: media_player.everywhere_inside