diff --git a/binary_sensor.yaml b/binary_sensor.yaml index d0d1429..5874ca1 100644 --- a/binary_sensor.yaml +++ b/binary_sensor.yaml @@ -23,6 +23,11 @@ after: '07:30' before: '09:00' +- platform: tod + name: Late Morning + after: '09:00' + before: '12:00' + - platform: tod name: Midday after: '09:00' diff --git a/packages/climate.yaml b/packages/climate.yaml index 4bf54bb..cb97ea8 100644 --- a/packages/climate.yaml +++ b/packages/climate.yaml @@ -242,37 +242,47 @@ script: alias: "Emma Wakeup" mode: restart sequence: - - if: - - condition: state - entity_id: input_boolean.early_night_mode - state: 'on' - then: - - 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 - else: - - 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 + - choose: + - conditions: + - condition: state + entity_id: input_boolean.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