Good Afternoon,
I’ve been trying to configure a timer for a rule that I’m testing and every time I call the function createTimer I get the error message “The method createTimer(DateTime, ()=>Timer) is undefined for the type Class”
Does anyone know what might be causing this error to occur?
Here’s my code:
var Timer timer = null
rule “Motion Alarm”
when
Item MAlarmMotion changed from OFF to ON
then
SwitchBinaryAlarm.sendCommand(ON)
logInfo(“Test”, “Motion Detected”)
if(timer === null){
timer = Timer.createTimer(now.plusMillis(100)) [|
SwitchBinaryAlarm.sendCommand(OFF)
timer = null
]
}
end
Thank you in advance.