I am trying to have a cycle timer be activated with a switch. Here is my rules code
// If 1 hour switch is on door is locked for 1 hour
rule "1 Hour Lock"
when
item doorlock received update ON
then
channel1.sendCommand(ON)
myTimer = createTimer(now.plusMinutes(60))[|
channel1.sendCommand(OFF)
]
doorlock.sendCommand(OFF)
end
Guessing, but maybe Item ‘doorlock’ can get updates while the timer is running. You could kick start many off-timers in that case.
It is quite common to need to set your rule up so that only one copy of the timer is running at a time. i.e. check to see if there is already a timer before starting a new one.