From 7fff2bcd3620cdbc56d59ababc5f8b8214e59428 Mon Sep 17 00:00:00 2001 From: Tony Stork Date: Sat, 18 Mar 2023 16:21:47 -0400 Subject: [PATCH] Rework evening mode on first floor --- packages/lighting_and_scenes.yaml | 54 +++++++++++++++++++++++++------ scripts.yaml | 3 +- 2 files changed, 46 insertions(+), 11 deletions(-) diff --git a/packages/lighting_and_scenes.yaml b/packages/lighting_and_scenes.yaml index 5485b49..324223c 100644 --- a/packages/lighting_and_scenes.yaml +++ b/packages/lighting_and_scenes.yaml @@ -1114,20 +1114,47 @@ script: entity_id: input_boolean.guest_mode state: 'off' sequence: - - service: light.turn_off - target: - area_id: - - living_room - - downstairs_bathroom + - if: + - condition: template + value_template: "{{ give_me_darkness == 1 }}" + then: + - if: + - condition: state + entity_id: timer.downstairs_bathroom_lights_timer + state: idle + then: + - service: light.turn_off + target: + entity_id: + - light.downstairs_bathroom_lights + else: + - service: light.turn_off + target: + entity_id: + - light.living_room_lights + - if: + - condition: state + entity_id: timer.downstairs_bathroom_lights_timer + state: idle + then: + - service: light.turn_off + target: + entity_id: + - light.downstairs_bathroom_lights - conditions: - condition: state entity_id: input_boolean.guest_mode state: 'on' sequence: - - service: light.turn_off - target: - area_id: - - downstairs_bathroom + - if: + - condition: state + entity_id: timer.downstairs_bathroom_lights_timer + state: idle + then: + - service: light.turn_off + target: + entity_id: + - light.downstairs_bathroom_lights - conditions: - condition: state entity_id: input_boolean.give_me_darkness @@ -1137,7 +1164,14 @@ script: target: entity_id: - light.dining_room_lamp - - light.downstairs_bathroom_lights + - if: + - condition: state + entity_id: timer.downstairs_bathroom_lights_timer + state: idle + then: + - service: light.turn_off + target: + entity_id: light.downstairs_bathroom_lights - service: input_boolean.turn_off target: entity_id: input_boolean.tina_desk_lights diff --git a/scripts.yaml b/scripts.yaml index c0fada2..df02deb 100644 --- a/scripts.yaml +++ b/scripts.yaml @@ -53,7 +53,8 @@ give_me_darkness: - service: script.volume_reset data: {} - service: script.evening_on_first_floor - data: {} + data: + give_me_darkness: 1 - service: script.evening_on_second_floor data: {} - service: mqtt.publish