Hi all, I am searching for a way to determine what item has triggered a rule.
The “when” part of the rule could be an “or” of conditions, or it could be a group of items.
For example this piece of code that is supposed to output which motion sensor triggered a burglary alarm:
rule "burglary alarm" when Item Alarm_Burglary_State_Toggle changed from OFF to ON or /* Panic */ Item Fibaro_1_Motion changed from OFF to ON or Item Fibaro_2_Motion changed from OFF to ON or Item Aeotec_1_Motion changed from OFF to ON then // if armed, trigger alarm // needs to know which item has triggered it for logging, updating a descriptive String item, etc.) end
There are the implicit object receivedCommand and previousState (ON/OFF), but I cannot figure out how to navigate to an object reference.
An answer probably lies within https://github.com/openhab/openhab/wiki/Taking-Rules-to-New-Heights (“The Mother-of-All Light-Off Rules”), but I don’t get it.