Disable PIR rule for certain amount of time after it's been executed

Total newbie question here. I’ve looked into implementing timer rules but I can’t quite decipher how to implement one into a currently working rule of mine. I have a PIR set up that when tripped plays an mp3 file. I would like to add to the rule that it be disabled for a certain amount of time after it has been tripped. I want the mp3 file to play once, and then ignore any motion the PIR picks up for say 15 seconds.

Here is my rule as it stands now.

import org.openhab.core.library.types.*
import org.openhab.core.persistence.*
import org.openhab.model.script.actions.*

rule "Motion"
    when
        Item PIR changed from CLOSED to OPEN
    then
        playSound("gtfo.mp3")
end

Any pointers would be much appreciated.

You want to create the countdown timer in the then clause of the rule.

The then clause needs to begin with checking for the existence of said timer and/or whether it has timed out. If it does not exist, then create it. If timed out, reset it or destroy and recreate it. (some people have issues with resetting existing timers) In either of those cases you play your file. If the timer exists and has NOT expired, then you skip playing your file.

Search for my post on Orchestration Design Patterns for some rules implementing a similar issue. Automation/Orchestration Design Patterns

That post you listed was very helpful and I was able to implement it. Still getting my bearings on all of this but it’s starting to come together. It seems like part of the challenge is I’m picking up little bits of information from several different sources and it gets a little scattered at times. The post you wrote helped link a lot of it together and clarify some things as well as introduce some new info. I appreciate the help.