@velkrosmaak wrote:
I have a door sensor which turns a light on when the door is opened to a room. There is a PIR sensor in that room.
If the door is opened but the PIR isn’t triggered shortly afterwards, I want the light to go off.
This is what I have so far. I feel like I’m close, but just not quite there.
- alias: Turn off Snug lamp when kitchen door opens and no pir trigger: platform: state entity_id: binary_sensor.kitchen_snug_door to: 'off' for: minutes: 5 condition: - condition: or conditions: - condition: state entity_id: binary_sensor.snug_pir value_template: "((as_timestamp(now()) - as_timestamp(states.binary_sensor.snug_pir.last_changed)) / 60 )| int < 6)" action: - service: homeassistant.turn_off entity_id: group.snug
I’d be really thankful for any help! Cheers!
Posts: 7
Participants: 3