Hello to all,
I would like to explain the scenario.
I have a motion sensor and I want to trigger off the light when the motion sensor is off. The difference is that I need different conditions on different sensors and wait time:
if the motion sensor is off for 30sec and the door sensor is off, turn off the light else if the motion sensor is off for 30sec and the door sensor is on wait 2 more min and if door sensor is off, turn off the light.
My idea is to turn the light off quick if door is open but when is closed to allow the motion sensors to allow detect any motion.
Have I got this the right way round? My door contact sensors are “on” when the door is open and “off” when it is closed.
mode: single
triggers:
- trigger: state
entity_id:
- binary_sensor.motion_sensor
to: "off"
for:
hours: 0
minutes: 0
seconds: 30
conditions: []
actions:
- if:
- condition: state
entity_id: binary_sensor.door_open
state: "off"
then:
- delay:
hours: 0
minutes: 2
seconds: 0
milliseconds: 0
- action: light.turn_off
metadata: {}
data: {}
target:
entity_id: light.my_light
else:
- action: light.turn_off
metadata: {}
data: {}
target:
entity_id: light.my_light
Hmmm, not sure. Maybe I didn’t explain it well.
I have in the bathroom two motion sensors and in the door a contact sensor. I want to turn off the lights fast if the door is open but if the door is closed I want to have a big delay which will allow the motion sensors to be updated with motion detected.