Security Lighting - OFF

View All Rules

alias: Security Lighting - OFF
trigger:
  - platform: time
    at: '23:30:00'
  - entity_id: sensor.family_family_state_raw
    platform: state
condition:
  condition: and
  conditions:
    - condition: time
      after: '23:25:00'
    - condition: numeric_state
      entity_id: sensor.family_family_state_raw
      below: 4
action:
  - delay: '00:{{ range(0,5) | random | int }}{{ range(0,9) | random | int }}:00'
  - service: scene.turn_on
    data:
      entity_id: scene.light_off
  - service: switch.turn_off
    data:
      entity_id: switch.gf_living_light_jar_switch

© 2020. Some rights reserved. The contents of this site is released under a Creative Commons Attribution-Share Alike license.