Hi,
First post here, but I’ve learn so much from lurking and reading for some time. So thanks, to everyone here for your wisdom.
I’ve been setting up my first OpenHab project; a raspberry pi based garage door monitor and controller. Everything is going well, but I’m just having some trouble getting an expire timer/broadcastnotification to work.
I have the following items:
Rollershutter GarageDoorLeft “” <“none”> {http=">[:GET:http://“blahbah”/clk?id=left]"}
Rollershutter GarageDoorRight “” <“none”> {http=">[:GET:http://“blahblah”/clk?id=right]"}
String GarageDoorLeftStatus “[%s]” {http="<[http://“blahblah”/st?id=right:1000:REGEX((.))]"}
String GarageDoorRightStatus “[%s]” {http="<[http://“blahblah”/st?id=left:1000:REGEX((.))]"}
Switch GarageDoorLeftTimer { expire=“5m,command=OFF” }
Switch GarageDoorRightTimer { expire=“5m,command=OFF” }
and the following rules:
rule “Left Garage Door Opened”
when
Item GarageDoorLeftStatus changed
then
if (GarageDoorLeftStatus.state == “open”) GarageDoorLeftTimer.sendCommand(ON)
else GarageDoorLeftTimer.PostUpdate(OFF)
end
rule “Left Garage Door Timer”
when
Item GarageDoorLeftTimer received command OFF
then
sendBroadcastNotification (“Bill’s garage door has been open for 5 minutes”)
end
rule “Right Garage Door Opened”
when
Item GarageDoorRightStatus changed
then
if (GarageDoorRightStatus.state == “open”) GarageDoorRightTimer.sendCommand(ON)
else GarageDoorRightTimer.PostUpdate(OFF)
end
rule “Right Garage Door Timer”
when
Item GarageDoorRightTimer received command OFF
then
sendBroadcastNotification (“Janes’s garage door has been open for 5 minutes”)
end
What I’m trying to do is sendbroadcastnotification when a garage door has remained opened for 5 minutes. When the garage doors open, the sendbroadcastnotifcation triggers 5min after the status change.
The error log indicates the logic might be skipping the PostUpdate as it shows the following error:
$
2018-09-03 21:02:36.282 [ERROR] [ntime.internal.engine.RuleEngineImpl] - Rule ‘Right Garage Door Opened’: ‘PostUpdate’ is not a member of 'org.$
$‘org.eclipse.smarthome.core.library.items.SwitchItem’; line 6, column 7, length 35
If anyone has any tips it would be enormously appreciated.