Help for creating a rule

Hi,

I would like to create the following rule:

If the status of the motion detector changes from ON to OFF, then a command should be executed after 30 minutes.
If, however, the status changes back to ON within these 30 minutes, the rule should be interrupted and then start again when the status changes back to OFF.

Can someone help me there?

Thank you.
greeting
Hermann

Switch MotionDetector
Switch Dummy {expire="30m,OFF"}
rule "MotionDetector"
when
    Item MotionDetector changed to OFF
then
    Dummy.postUpdate(ON)
end

rule "Dummy"
when
    Item Dummy changed to OFF
then
    if (MotionDetector.state == OFF) {
// ...        
    }
end

You can also use a timer like

You need to reset the expire binding with
You also need to install the expire binding

rule “MotionDetector”
when
Item MotionDetector changed to ON
then
Dummy.postUpdate(OFF)
end

I don’t think so.

Yes you do or the timer will expire after 30 minutes.
It’s in the docs

Yes, but for that is this line

if (MotionDetector.state == OFF) {

I’ll rephrase that. The timer will expire after 30 minutes unless you turn it off manually

I know, but it makes no odds. I both cases I have to check MotionDetector.state.So I can save this part.
It’s only one example of many. @hermann1514 has to decide himself, how to do.

We can philosophise hours about that. Lets solve major problems.

@hr3
Yeah
I read the rule and his requirements the other way around.
It will work anyways