Hi all,
I’m probably just missing something silly. I have an August lock on my front door, stairs to my door, and then a door sensor at the top entrance. The lights turn on fine, but when it’s running my script to turn off something whacky happens (I’m not positive where). The idea is when either the august is locked or the top door is closed to wait 10 minutes and check to see if both the lock is still locked and the door is still closed and if so, turn off the lights. It seems to work sometimes, but others not. I have a feeling it’s in my if/then but I can’t figure out where. Help? Thank you!
alias: Stairway Lights OFF
description: ""
trigger:
- platform: device
device_id: 13268d8ad9898c7ac224996908fce4bf
domain: lock
entity_id: lock.front_door
type: locked
for:
hours: 0
minutes: 0
seconds: 0
- platform: state
entity_id:
- binary_sensor.entryway_sensor_contact
from: "on"
to: "off"
for:
hours: 0
minutes: 0
seconds: 0
condition: []
action:
- delay:
hours: 0
minutes: 10
seconds: 0
milliseconds: 0
- if:
- condition: state
entity_id: lock.front_door
state: locked
- condition: and
conditions:
- condition: state
entity_id: binary_sensor.entryway_sensor_contact
state: "off"
then:
- service: notify.mobile_app_iphone
data:
message: >-
Stairway lights will turn off in 5 minutes without further
interaction
- delay:
hours: 0
minutes: 5
seconds: 0
milliseconds: 0
- service: scene.turn_on
target:
entity_id: scene.stairway_lights_off
metadata: {}
else:
- repeat:
until:
- condition: state
entity_id: lock.front_door
state: locked
- condition: and
conditions:
- condition: state
entity_id: binary_sensor.entryway_sensor_contact
state: "off"
sequence: []
mode: single