Delay before motion retrigger

Hi,

In my garden I have a motion sensor, everytime it sees a movement it will trigger (CLOSE -->OPEN) and plays a sound.
Now I want to add a delay so it doesn’t play a sound every movement but (example) only after 5 minutes again.
So the ‘retrigger’ should be disabled for 5 minutes, I tried several things with createTimer but cannot get it done.

Any idea’s ?
-ben

See the following:

The short of it is use a lock or a Timer and in the rule check to see if the lock is locked or the Timer is running and if it is skip the rule.

Hi Rich,

With your link i’ve created the following :

var Timer timer1 = null

rule "Motion detection backyard"
    when
        Item pirSensor1 changed to OPEN
    then
        if(timer1 == null) {
            playSound("doorbell.mp3")
            timer1 = createTimer(now.plusMinutes(1)) [|
                timer1 = null
            ]
        }
    end

After 1st trigger (change to open), it won’t trigger until timer1 ( +1 minute) expires.

-ben