Pi4b, OH2.5.12
In the rule below I switch multiple items and start a timer per item when the state =! ON
So I am able to “not” switch items which might be activated manually before and should stay untouched.
When now another trigger switches during the timers are running I would like to restart exactly the running timers only.
How can I do that?
var Timer LED_Nachbar_Timer = null
var Timer LED_GVorne_Timer = null
var Timer LED_GWald_Timer = null
rule "Einfahrt_Licht"
when
Item DW2_TOR received update ON or
Item S_Touch90_1 received update ON or
Item zwave_device_6c898019_node8_scene_number received update 4
then
if(Nacht.state != OFF) {
if(LED_Nachbar.state != ON) {
LED_Nachbar.sendCommand(ON)
LED_Nachbar_Timer = createTimer(now.plusSeconds(240), [|
LED_Nachbar.sendCommand(OFF)
])
}
if(LED_GVorne.state != ON) {
LED_GVorne.sendCommand(ON)
LED_GVorne_Timer = createTimer(now.plusSeconds(240), [|
LED_GVorne.sendCommand(OFF)
])
}
if(LED_GWald.state != ON) {
LED_GWald.sendCommand(ON)
LED_GWald_Timer = createTimer(now.plusSeconds(240), [|
LED_GWald.sendCommand(OFF)
])
}
}
end