I’ve just upgraded to openHAB2 and have a couple of rules with code like this:
if (pir_movement_idle != null) {
pir_movement_idle.cancel()
pir_movement_idle = null
}
I’m getting an error “Could not invoke method: java.util.Timer.cancel() on instance: org.eclipse.smarthome.model.script.internal.actions.TimerImpl@b34f33”. I searched for this error in here and found no reference to it.
The timer variable is declared globally outside the rule.