- Platform information:
- Win10 - Intel Core i3, 16 GB Ram
- Zulu 8.26
- openHAB version: 2.5
I monitor our Frontdoor with the following little script:
// var timer
var Timer eingangstuerTimer = null
// rule
rule "Eingangstuer seit 10 min offen"
when
Item Eingangstuer changed
then
if(Eingangstuer.state===CLOSED) {
if (eingangstuerTimer!==null) {
eingangstuerTimer.cancel
eingangstuerTimer=null
}
}
else if (Eingangstuer.state===OPEN) {
if (eingangstuerTimer===null) {
eingangstuerTimer=createTimer(now.plusMinutes(10)) [
sendTelegram("botben","Eingangstuer seit 10 min offen")
]
}
}
end
I found the script here > /Rule optimization: Window OPEN reminder
It worked like it should for some month, but since a few days, i get 2 or 3 times a day the message, Door is open, but the Door is still closed, when i check it.
How could i check the State in the script again, before it sends a message?
Thank you!
Ben