Hi,
I am using openHAB 3.0.0 and am trying to do some integration with a Lutron Pico keypad. As I was debugging it, I noticed that my ruled seemed triggered a lot more than I expected. Here is the simplest version of the rule (ignore the spurious variables, they’re used in the longer rule):
rule "Kitchen scene All Bright"
when
Item KitchenLights_Pico_Button1 received update OFF
then
val log = "KitchenSceneAllBright"
val item = KitchenLights_Pico_Button1
logInfo(log, "Item '{}' triggered rule", item.name)
end
Below are the logs. I see a single ItemStateChangedEvent from ON to OFF, which is what should trigger the rule, right? But the rule fires twice. Any ideas why? Shouldn’t the rule only fire once with the received update OFF
trigger?
Also, I tried to log the implicit variables triggeringItem
, previousState
, newState
and they are all null
which doesn’t seem to match the documentation?
==> /opt/openhab/userdata/logs/events.log <==
2020-10-25 01:27:29.958 [ome.event.RuleRemovedEvent] - Rule 'double_taps-2' has been removed.
2020-10-25 01:27:29.965 [ome.event.RuleRemovedEvent] - Rule 'double_taps-1' has been removed.
2020-10-25 01:27:30.002 [thome.event.RuleAddedEvent] - Rule 'double_taps-1' has been added.
2020-10-25 01:27:30.004 [.event.RuleStatusInfoEvent] - double_taps-1 updated: UNINITIALIZED
2020-10-25 01:27:30.008 [.event.RuleStatusInfoEvent] - double_taps-1 updated: INITIALIZING
2020-10-25 01:27:30.021 [.event.RuleStatusInfoEvent] - double_taps-1 updated: IDLE
2020-10-25 01:27:30.024 [thome.event.RuleAddedEvent] - Rule 'double_taps-2' has been added.
2020-10-25 01:27:30.040 [.event.RuleStatusInfoEvent] - double_taps-2 updated: UNINITIALIZED
2020-10-25 01:27:30.049 [.event.RuleStatusInfoEvent] - double_taps-2 updated: INITIALIZING
2020-10-25 01:27:30.054 [.event.RuleStatusInfoEvent] - double_taps-2 updated: IDLE
2020-10-25 01:27:31.055 [vent.ItemStateChangedEvent] - Item 'KitchenLights_Pico_Button1' changed from OFF to ON
2020-10-25 01:27:31.059 [vent.ItemStateChangedEvent] - Item 'KitchenLights_Pico_Button1' changed from ON to OFF
2020-10-25 01:27:31.062 [.event.RuleStatusInfoEvent] - double_taps-1 updated: RUNNING
==> /opt/openhab/userdata/logs/openhab.log <==
2020-10-25 01:27:32.001 [INFO ] [e.model.script.KitchenSceneAllBright] - Item 'KitchenLights_Pico_Button1' triggered rule
==> /opt/openhab/userdata/logs/events.log <==
2020-10-25 01:27:32.011 [.event.RuleStatusInfoEvent] - double_taps-1 updated: IDLE
2020-10-25 01:27:32.014 [.event.RuleStatusInfoEvent] - double_taps-1 updated: RUNNING
==> /opt/openhab/userdata/logs/openhab.log <==
2020-10-25 01:27:32.016 [INFO ] [e.model.script.KitchenSceneAllBright] - Item 'KitchenLights_Pico_Button1' triggered rule
==> /opt/openhab/userdata/logs/events.log <==
2020-10-25 01:27:32.022 [.event.RuleStatusInfoEvent] - double_taps-1 updated: IDLE```