Trigger alarm when 2 or more motion sensors detects motion within 5 minutes

I have 4 motion sensors located in different rooms of my house. When I’m not home, I use those sensors to trigger my alarm. But the problem is PIR motion sensors sometime (lots of times) produce false positive motion detections. What I want to achieve is this: Whenever motion detected in any of my sensors, wait for 5 minutes to see if any other sensor also detects motion. This way I could eliminate false alarms related to one specific sensor. Is that doable?

Sure.
Make a helper to store a timestamp and the sensor.
Whenever a sensor is activated it will check that sensor and if the sensor is different and the timestamp is less than 5 minutes old, then activate alarm. Otherwise store the sensor and the timestamp.

Hi,

I am looking to do the exactly the same thing, but could you elaborate a little bit on the above? Perhaps have some code example? Seems like a lot of posts on the forum want to tackle the same thing, but this would seem like one of the more elegant solutions…

Many thanks!

Ben