Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- alias: Stair Lights Control
- description: >-
- Turn stair lights on when motion is detected at top or bottom, off after no
- motion. using lux and 2 motion sensors
- triggers:
- - entity_id: binary_sensor.downstairs_motion_sensor
- to: "on"
- trigger: state
- - entity_id: binary_sensor.upstairs_aqara_motion_p2_occupancy
- to: "on"
- trigger: state
- - entity_id: binary_sensor.downstairs_motion_sensor
- to: "off"
- trigger: state
- - entity_id: binary_sensor.upstairs_aqara_motion_p2_occupancy
- to: "off"
- trigger: state
- conditions:
- - condition: numeric_state
- entity_id: sensor.upstairs_aqara_motion_p2_illuminance
- below: 30
- actions:
- - choose:
- - conditions:
- - condition: or
- conditions:
- - condition: state
- entity_id: binary_sensor.motion_sensor
- state: "on"
- - condition: state
- entity_id: binary_sensor.upstairs_aqara_motion_p2_occupancy
- state: "on"
- sequence:
- - action: light.turn_on
- entity_id: light.front_foyer_front_stairs_led_2
- data:
- brightness_pct: 42
- - conditions:
- - condition: state
- entity_id: binary_sensor.motion_sensor
- state: "off"
- - condition: state
- entity_id: binary_sensor.upstairs_aqara_motion_p2_occupancy
- state: "off"
- sequence:
- - delay: "00:01:00"
- - action: light.turn_off
- entity_id: light.front_foyer_front_stairs_led_2
- mode: queued
- max: 5
Advertisement
Add Comment
Please, Sign In to add comment