mirror of
https://github.com/CeeWeasel/fresh-home.git
synced 2026-08-09 18:40:14 -04:00
37 lines
1.2 KiB
YAML
37 lines
1.2 KiB
YAML
alias: House alert
|
|
sequence:
|
|
- action: media_player.turn_on
|
|
data:
|
|
entity_id: media_player.bedroom_hub
|
|
- action: media_player.volume_set
|
|
data:
|
|
entity_id: media_player.bedroom_hub
|
|
volume_level: 0.5
|
|
- action: media_player.play_media
|
|
data:
|
|
entity_id: media_player.bedroom_hub
|
|
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.bedroom_hub','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.bedroom_hub
|
|
message: >-
|
|
{{ (expand('binary_sensor.exterior_doors') | selectattr('state', 'eq', 'off')) | map(attribute='name') | list }}
|
|
- delay: "00:00:02"
|
|
# Wait for it to stop playing (2 minute timeout)
|
|
- wait_template: "{{ is_state('media_player.bedroom_hub','idle') }}"
|
|
timeout: "00:02:00"
|
|
continue_on_timeout: "true"
|
|
# Turn off the media players
|
|
- action: media_player.turn_off
|
|
data:
|
|
entity_id: media_player.bedroom_hub
|