Rework E's bedroom scenes

This commit is contained in:
2023-02-02 12:38:24 -05:00
parent 1f27d30054
commit e3595c0b10
2 changed files with 102 additions and 80 deletions

View File

@ -262,69 +262,4 @@ automation:
who: "parents"
title: "Emma Climate Schedule"
message: "No option selected for Emma's climate mode. No devices will be activated."
mode: restart
script:
emma_wakeup:
alias: "Emma Wakeup"
mode: restart
sequence:
- choose:
- conditions:
- condition: state
entity_id: binary_sensor.early_night_mode
state: 'on'
sequence:
- service: input_select.select_option
target:
entity_id: input_select.emma_bedroom_scenes
data:
option: Nightlight
- service: light.turn_on
target:
entity_id: light.hallway_overhead
- delay:
seconds: 2
- service: input_select.select_option
target:
entity_id:
- input_select.upstairs_hallway_scenes
- input_select.master_bedroom_scenes
data:
option: Adaptive
- conditions:
- condition: or
conditions:
- condition: state
entity_id: binary_sensor.morning
state: 'on'
- condition: state
entity_id: binary_sensor.late_morning
state: 'on'
sequence:
- service: light.turn_on
target:
entity_id: light.emma_bedroom_light
- service: input_select.select_option
target:
entity_id: input_select.emma_bedroom_scenes
data:
option: Adaptive
- delay:
minutes: 5
- service: input_boolean.turn_off
target:
entity_id: input_boolean.white_noise_emma_bedroom
- if:
- condition: template
value_template: >-
{% set ct = ((now().hour * 60 + now().minute) * 60 ) %}
{% if is_state('input_boolean.hot_day','off') and ct < state_attr('input_datetime.emma_bedtime','timestamp') and ct >= state_attr('input_datetime.emma_wakeup','timestamp') %}
true
{% else %}
false
{% endif %}
then:
- service: fan.turn_off
target:
entity_id: fan.emma_air_conditioner
mode: restart