Code: Alles auswählen
var Timer WindowTimer = null
rule "Balkontür Büro Status"
when
Item OF_CD_01_STATE changed
then
if(OF_CD_01_STATE.state != CLOSED) {
WindowTimer = createTimer(now.plusMinutes(10), [ |
sendBroadcastNotification("Balkontür im Büro seit 10 min offen!")
])
} else {
if(WindowTimer !== null) {
WindowTimer.cancel
WindowTimer = null
sendBroadcastNotification("Balkontür im Büro wurde geschlossen!")
}
}
end
Es ist halt die Frage, welches Verhalten erwünscht ist.