I need help with rule, how to write - WHEN item Door_Status changed *after 1 minute to chech* THEN?

  • Platform information:Ubuntu

    Hi,
    I need help with rule, how to write - WHEN item Door_Status changed after 1 minute to chech THEN ?
    thanks a lot

//Alarm
rule “Alarm”

when
Item Door_Status changed

then
if (Door_Status.state == OPEN && Corridor_Right.state == ON)
{
Kitchen_Left.sendCommand(ON)
Gateway_SoundVolume.sendCommand(20)
Gateway_Sound.sendCommand(1)
}
end

Hi!
Just use the following:

var timer = createTimer(now.plusMinutes(1), [ |
Your code for checks goes here... It will be executed after one minute 
])

First of all, please use code fencing (How to ask a good question / Help Us Help You)

I can’t see what your plan is, but I think you can solve it with a timer:

rule “Alarm”
when
    Item Door_Status changed
then
   createTimer(now.plusMinutes(1), [|
        if (Door_Status.state == OPEN && Corridor_Right.state == ON)
        {
          Kitchen_Left.sendCommand(ON)
          Gateway_SoundVolume.sendCommand(20)
          Gateway_Sound.sendCommand(1)
        }
  ]
end