Helly Community,
I am still struggling with some of my rules, this time with an expire-item.
What I am doing: I use two Z-Wave PIRs to switch light in cellar. When a PIR fires, it activates a timer item, this switches on the light, and when expired, light is switched off. First some config:
Items involved:
Switch PIR_Sensor_3 "PIR Sensor 3" {channel="zwave:device:3a7e4c2a:node11:alarm_motion"}
Switch KG_Flur_Licht_Timer {expire="120s,command=OFF" }
Switch KG_Flur_Licht "Licht Flur Keller" <light> (kgLight) ["Lighting"]
Rules:
rule "Bewegungsmelder Keller Flur PIR3 an"
when
Item PIR_Sensor_3 changed from OFF to ON
then
KG_Flur_Licht_Timer.sendCommand(ON)
end
rule "Keller Licht Automatik"
when
Item KG_Flur_Licht_Timer changed
then
KG_Flur_Licht.sendCommand(KG_Flur_Licht_Timer.state.toString)
end
In general the rule works fine, and the log looks like this:
2020-06-22 21:45:04.186 [vent.ItemStateChangedEvent] - PIR_Sensor_3 changed from OFF to ON
2020-06-22 21:45:04.190 [ome.event.ItemCommandEvent] - Item 'KG_Flur_Licht_Timer' received command ON
2020-06-22 21:45:04.197 [vent.ItemStateChangedEvent] - KG_Flur_Licht_Timer changed from OFF to ON
2020-06-22 21:45:04.201 [ome.event.ItemCommandEvent] - Item 'KG_Flur_Licht' received command ON
2020-06-22 21:45:04.222 [nt.ItemStatePredictedEvent] - KG_Flur_Licht predicted to become ON
2020-06-22 21:45:04.239 [vent.ItemStateChangedEvent] - KG_Flur_Licht changed from OFF to ON
2020-06-22 21:45:04.241 [GroupItemStateChangedEvent] - kgLight changed from OFF to ON through KG_Flur_Licht
But sometimes, after OH2 is running for some time, it just stops after the expire item received the command, i.e.the expire item receives the command, but doesn’t change state so the rule to switch light doesn’t fire:
2020-06-22 21:38:30.085 [vent.ItemStateChangedEvent] - PIR_Sensor_3 changed from OFF to ON
2020-06-22 21:38:30.095 [ome.event.ItemCommandEvent] - Item 'KG_Flur_Licht_Timer' received command ON
When I reboot the system, everything works fine again (actually the logs were taken before and after a reboot), until after some time the same thing happens again. No errors in openhab.log when this problem occurs.
At the moment running OH 2.5.6 on a Raspberry Pi4b.