kitchen-nightlight-on-pm.yaml 819 Bytes
Newer Older
Erick Hitter's avatar
Erick Hitter committed
1
alias: Turn kitchen nightlight on PM
Erick Hitter's avatar
Erick Hitter committed
2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
trigger:
  - platform: state
    entity_id: switch.kitchen
  - platform: state
    entity_id: light.ceiling_fan_1
  - platform: state
    entity_id: light.ceiling_fan_2
  - platform: state
    entity_id: binary_sensor.kitchen
  - platform: state
    entity_id: binary_sensor.lr_motion_sensor_over_utility_closet
condition:
  condition: and
  conditions:
    - condition: state
      entity_id: sun.sun
      state: 'below_horizon'
    - condition: time
Erick Hitter's avatar
Erick Hitter committed
20
      after: '21:30:00'
Erick Hitter's avatar
Erick Hitter committed
21 22 23 24 25 26 27 28 29 30 31 32
    - condition: state
      entity_id: light.ceiling_fan_1
      state: 'off'
    - condition: state
      entity_id: light.ceiling_fan_2
      state: 'off'
    - condition: state
      entity_id: switch.kitchen
      state: 'off'
action:
  service: switch.turn_on
  entity_id: switch.kitchen_nightlight