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: