Untitled

 avatar
unknown
yaml
2 years ago
1.1 kB
0
No Index
description: >-
  Turns Upstairs Hallway Fan Light on/off based on presence detection and
  illumination level.
mode: single
trigger:
  - platform: state
    entity_id:
      - binary_sensor.upstairs_hallway_motion_sensor_occupancy
    for:
      hours: 0
      minutes: 0
      seconds: 0
    id: DETECTED
    to: "on"
  - platform: state
    entity_id:
      - binary_sensor.upstairs_hallway_motion_sensor_occupancy
    for:
      hours: 0
      minutes: 0
      seconds: 1
    id: CLEAR
    to: "off"
condition: []
action:
  - choose:
      - conditions:
          - condition: trigger
            id:
              - DETECTED
          - condition: numeric_state
            entity_id: sensor.upstairs_hallway_motion_sensor_illuminance_lux
            below: 50
        sequence:
          - service: light.turn_on
            data: {}
            target:
              entity_id: light.upstairs_hallway_fan
      - conditions:
          - condition: trigger
            id:
              - CLEAR
        sequence:
          - service: light.turn_off
            data: {}
            target:
              entity_id: light.upstairs_hallway_fan
Editor is loading...
Leave a Comment