From c0a712012340b62ed4eb6b2cecd7eb869151b53f Mon Sep 17 00:00:00 2001 From: Tony Stork Date: Sun, 19 Feb 2023 14:05:52 -0500 Subject: [PATCH] Add new condition for basement door sensor closed --- packages/lighting_and_scenes.yaml | 44 ++++++++++++++++++++++++++----- 1 file changed, 37 insertions(+), 7 deletions(-) diff --git a/packages/lighting_and_scenes.yaml b/packages/lighting_and_scenes.yaml index 4af7a03..87e4422 100644 --- a/packages/lighting_and_scenes.yaml +++ b/packages/lighting_and_scenes.yaml @@ -549,19 +549,49 @@ automation: from: 'off' to: 'on' id: door-open + - platform: state + entity_id: binary_sensor.basement_studio_door + from: 'on' + to: 'off' + for: + minutes: 10 + id: door-closed condition: - condition: state entity_id: input_boolean.studio_quiet state: 'off' action: - - if: - - condition: state - entity_id: light.basement_studio_lights - state: 'off' - then: - - service: light.turn_on - target: + choose: + - conditions: + - condition: trigger + id: door-open + sequence: + - if: + - condition: state entity_id: light.basement_studio_lights + state: 'off' + then: + - service: light.turn_on + target: + entity_id: light.basement_studio_lights + - conditions: + - condition: trigger + id: door-closed + sequence: + - if: + - condition: and + conditions: + - condition: state + entity_id: binary_sensor.tony_desktop_on + state: 'off' + - condition: state + entity_id: binary_sensor.kallen_desktop_on + state: 'off' + then: + - service: light.turn_off + target: + entity_id: light.basement_studio_lights + script: adaptive_on_first_floor: