Not sure what you want to achieve - send a notification maybe to let you know the window is still open?
There is no need to trigger after a certain time (not sure if this is possible at all), just trigger window Item changed, start a timer when the window is changed to open. Do what ever you want when the timer expires (send notification, play a sound, power on a light,…). And just stop the timer when the window is closed before the timer expires.
Please find a rule for sendening me notifications when the yard gate is opened an remember me to close it after 5, 10 and 15 minutes:
var Timer tTor5 = null //5min
var Timer tTor10 = null //10min
var Timer tTor15 = null //15min
rule "Hoftor Erinnerungen"
when
Item HoftorReedZU_OpenClose changed
then
if (HoftorReedZU_OpenClose.state==OPEN) {
sendBroadcastNotification("Hoftor ist nun geöffnet!")
if(webOSTV_Power.state == ON) {
webOSTV_Toast.sendCommand("Hoftor ist nun geöffnet!")
}
tTor5?.cancel
tTor5 = createTimer(now.plusMinutes(5), [ |
sendBroadcastNotification("Hoftor ist seit 5min offen, bitte schliessen!")
if(webOSTV_Power.state == ON) {
webOSTV_Toast.sendCommand("Hoftor ist seit 5min offen, bitte schliessen!")
}
tTor10 = null
tTor10?.cancel
tTor10 = createTimer(now.plusMinutes(5), [ |
sendBroadcastNotification("Hoftor ist seit 10min offen, bitte schliessen!")
if(webOSTV_Power.state == ON) {
webOSTV_Toast.sendCommand("Hoftor ist seit 10min offen, bitte schliessen!")
}
tTor15 = null
tTor15?.cancel
tTor15 = createTimer(now.plusMinutes(5), [ |
sendBroadcastNotification("Letzte Warnung! Hoftor ist seit 15min offen, bitte schliessen!")
if(webOSTV_Power.state == ON) {
webOSTV_Toast.sendCommand("Letzte Warnung! Hoftor ist seit 15min offen, bitte schliessen!")
}
tTor15 = null
])
])
])
}
else if (HoftorReedZU_OpenClose.state==CLOSED) {
sendBroadcastNotification("Hoftor ist nun geschlossen!")
if(webOSTV_Power.state == ON) {
webOSTV_Toast.sendCommand("Hoftor ist nun geschlossen!")
}
if (tTor5 !== null) {
tTor5.cancel()
tTor5 = null
}
if (tTor10 !== null) {
tTor10.cancel()
tTor10 = null
}
if (tTor15 !== null) {
tTor15.cancel()
tTor15 = null
}
}
end
The answer to your specific question is no. There is no trigger for a rule when an Item is in the same state for a certain time.
However, what you are after can be achieved with rules. If you don’t really want to mess with coding it, see Open Reminder which is a rule template that you can install and configure. It will call a rule of your choice when an Item is in the OPEN state for a configured amount of time. You can even set do not disturb periods and repeat the call to the rule until the window is CLOSED.