Hello,
I have a bunch of xiaomi/aqara motion sensors all around my house. They are wireless, very cheap and small, they’re fantastic
I have them connected through the zigbee2Mqtt integration.
If I recall correctly, this is how they work:
- When they detect motion, they report it and they went to sleep for a minute
- After a minute they become active again, and the cycle starts
Knowing that,this is how I setup my node-red logic to have lights that turn on automatically and turn off automatically:
- Detected motion light turns on and starts a 61 seconds timer
- If motion is detected again, the input is sent to the timer and it is extended by additional 61 seconds
- After the timer ends, the light turns off
The problem is that in practice this does not works reliably. Some times it works, and I am able to turn the light on as soon as it turns off, and other times it needs a long cooldown period before I can turn it on again.
Previously what I had was as simple as reading the motion state: if it is detected, turn light on, if it reports not detected, turn light off. That somewhat worked, but does not gives you the ability to “extend” the on period, and I don’t like having the feeling that I’m not in control…
1 post - 1 participant