Security Lighting - Night

View All Rules

alias: Security Lighting - Night
trigger:
- entity_id: sensor.light_scene
  platform: state
  to: Night
- entity_id: sensor.family_family_state_raw
  platform: state
condition:
  condition: and
  conditions:
    - condition: time
      before: '23:30:00'
    - condition: numeric_state
      entity_id: sensor.family_family_state_raw
      below: 4
    - condition: state
      entity_id: sensor.light_scene
      state: Night
action:
- delay: '00:{{ range(0,2) | random | int }}{{ range(0,9) | random | int }}:00'
- service: scene.turn_on
  data:
    entity_id: scene.light_security_ff
- service: scene.turn_on
  data:
    entity_id: scene.light_security_gf

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