How to keep light on base on three motion sensors?

Hi all,

I have three motion sensors (wyze sense) in my office to turn on a light (light plugged into smart plug). Due to my office layout i needed three motion sensors. The floor sensor is right by the door for when i walk in, top sensor is mounted up high just to sense motion in the office area, and desk sensor is right in front of my mouse to sense hand movements (for when the top sensor fail to detect minor movements).

With the current flow posted below, when i walk into the office door and top sensor would detect motion and turn on the light. Shortly after the door sensor would clear (sending “off” payload) and start the 5 mins timer for turn off the light. What i want to do is to only start the 5 mins timer only after all three sensors are cleared. I was able to do this in HA automation but not sure how to do it in node red.

Thanks for any helps.

The easiest way is to create a motion group.

That worked. I didn’t know how to make a group so didn’t think of it. Thanks for the suggestion.

another way is adjusting your flow slightly; whenever motion is detected, regardless if the light is already on or not, reset the timer. Basically connect any motion detection to the the input of the 5 min timer. Then every motion will reset the 5 min timer. here is how I do it:

I have 2 RF bridges and 3 sensors in the kitchen. In the switch node I test for all three kitchen sensor payloads, if any of them triggered, I check if its within daylight hours. If its not, I turn on the light and start the timer. Every new motion event of either sensor resets the timer.

I do it a bit differently:

I have a lot of motion sensors and use many inputs per flow. The only fire on true/on and have a few blocks they have to go through for time of day or enable/disable switches, but ultimately, always turn on the light. In parallel with triggering the light, the activate the trigger node which is setup to send nothing, wait X amount, then fire the off command. If you reactivate the motion during this time, it resets this trigger and the light remains on.