[SOLVED] Detect absent of motion from multiple sensors in period of time


Could be possible to describe the following kind of rule in OpenHab?

"Turn the lights off after 5 mins without motion detection in the room?

The rule should consider more than one motion sensor in the room, so the lights should be turned off only if none of the sensors (in my case 3) have detected motion for more than 5 mins.

Thanks in advance,

Can’t test/verify ATM, I’d use a proxy switch item which my expires to OFF after 5 minutes. Each motion sensor should trigger this proxy switch to ON, thereby restarting the 5 minute count.

This is what I do and works…

Thanks for your suggestion :+1:

Hi, could you share your solution?
I just started with OpenHab today, I could save some time if you share it :slightly_smiling_face:

Get something working for one sensor.
Extend your solution to several sensors.

You are allowed this or that triggers in rules.

Install expire binding.

Create an item:

Switch MotionTimer { expire="5m, command=OFF" }

Now create the rule:

rule "Turn the lights off after 5 mins without motion detection"
        Item MotionSensor1 received command or
        Item MotionSensor2 received command // Declare here as many as you want
      if(triggeringItem.state == ON) { // or OPEN

rule "Turn off light when timer is off"
       MotionTimer received command OFF

This should work out of the box (I suppose).

thanks for the reference!