mirror of
https://github.com/CeeWeasel/fresh-home.git
synced 2026-08-09 10:30:14 -04:00
37 lines
1.4 KiB
YAML
37 lines
1.4 KiB
YAML
alias: House alert
|
|
sequence:
|
|
- action: media_player.turn_on
|
|
data:
|
|
entity_id: media_player.master_bedroom_clock
|
|
- action: media_player.volume_set
|
|
data:
|
|
entity_id: media_player.master_bedroom_clock
|
|
volume_level: 0.5
|
|
- action: media_player.play_media
|
|
data:
|
|
entity_id: media_player.master_bedroom_clock
|
|
media_content_id: http://192.168.1.11:8123/local/audio/alarms/Alarm_Clock.mp3
|
|
media_content_type: music
|
|
- delay: "00:00:10"
|
|
# Wait for it to stop playing (5 second audio clip)
|
|
- wait_template: "{{ is_state('media_player.master_bedroom_clock','idle') }}"
|
|
timeout: "00:00:06"
|
|
continue_on_timeout: "true"
|
|
# Send an audio alert
|
|
- action: tts.speak
|
|
target:
|
|
entity_id: tts.google_translate_en_com
|
|
data:
|
|
media_player_entity_id: media_player.master_bedroom_clock
|
|
message: >-
|
|
The following are open: {{ dict((states|selectattr('entity_id', 'in', state_attr('group.my_exterior_doors', 'entity_id'))|list)|groupby('state'))['on']|map(attribute='name')|list|join(', ') }}
|
|
- delay: "00:00:02"
|
|
# Wait for it to stop playing (2 minute timeout)
|
|
- wait_template: "{{ is_state('media_player.master_bedroom_clock','idle') }}"
|
|
timeout: "00:02:00"
|
|
continue_on_timeout: "true"
|
|
# Turn off the media players
|
|
- action: media_player.turn_off
|
|
data:
|
|
entity_id: media_player.master_bedroom_clock
|