I would like to automatically switch off the lights in my living room if no one is detected for 30 minutes.
I’m using a Aqara Motion Sensor to detect presence.
I tried to use a Poll State component, setting it to interval of 30 minutes and checking if the sensor returns off… but I see it doesn’t work. My guess is that the « update interval » is actually the time that Node Red waits before polling the sensor, and not the time the sensor is off.
So, how could I do? I was thinking about setting an interval of 2 minutes, and use a counter or persiste somewhere the status, but there may be a simpler solution ?
You can use the join node.
There probably are other nodes that work too, but I use that for my remote receiver.
It joins button presses of my remote, like 1…2 => 12.
If you use that at the sensor event node then each new presence detection should reset the timer and make it wait.