mirror of
https://github.com/CeeWeasel/fresh-home.git
synced 2026-08-09 10:30:14 -04:00
53 lines
1.4 KiB
YAML
53 lines
1.4 KiB
YAML
alias: "Almost Bedtime"
|
|
id: automation_almost_bedtime
|
|
initial_state: on
|
|
trigger:
|
|
platform: time
|
|
at: input_datetime.kids_five_minute_warning_time
|
|
condition:
|
|
- condition: state
|
|
entity_id: input_boolean.announce_bedtime
|
|
state: "on"
|
|
- condition: or
|
|
conditions:
|
|
- condition: state
|
|
entity_id: input_boolean.emmett_home
|
|
state: "on"
|
|
- condition: state
|
|
entity_id: input_boolean.bridget_home
|
|
state: "on"
|
|
- condition: state
|
|
entity_id: input_boolean.ebin_home
|
|
state: "on"
|
|
action:
|
|
- service: input_boolean.turn_on
|
|
target:
|
|
entity_id: input_boolean.kids_bedtime
|
|
|
|
- service: media_player.volume_set
|
|
data:
|
|
volume_level: 0.65
|
|
target:
|
|
entity_id:
|
|
- media_player.bathroom_mini
|
|
- media_player.kitchen
|
|
|
|
- service: script.make_clever_announcement
|
|
data:
|
|
media_content_id: media-source://media_source/local/Sounds/tts/almost_bedtime.mp3
|
|
volume: 0.5
|
|
|
|
# Because of how we're calling the script, the automation won't continue until the script is done, so we don't need a delay here
|
|
#- delay: '00:00:10'
|
|
|
|
- choose:
|
|
- conditions:
|
|
- condition: template
|
|
value_template: "{{states('switch.nursery_bed_lights') == 'off' }}"
|
|
sequence:
|
|
- service: input_select.select_option
|
|
target:
|
|
entity_id: input_select.nursery_wled
|
|
data:
|
|
option: Read
|