Get specific item on group change

  • Platform information:
    • Hardware: _CPUArchitecture/RAM/storage_Raspberry pi
    • OS: _what OS is used and which version_Raspbian
    • Java Runtime Environment: which java platform is used and what version
    • openHAB version:2.5.0

this is my rule

rule “Buttons Call”
when
Member of Buttons changed from OFF to ON
then

in the log i can read ‘Buttons changed from OFF to ON through Button2’

I want to get the item who fired the rule, how do i get it?

Read what @rlkoshak suggested. I’ll give you a hint: triggeringItem

1 Like

it did not work

rule “Buttons Call”
when
Member of Buttons changed from OFF to ON
then
logInfo(‘INFO’, triggeringItem)

output log:

21:34:43.961 [ERROR] [untime.internal.engine.RuleEngineImpl] - Rule ‘Buttons Call’: An error occurred during the script execution: Could not invoke method: org.eclipse.smarthome.model.script.actions.LogAction.logInfo(java.lang.String,java.lang.String,java.lang.Object[]) on instance: null

Well, it’s an Item. What property of it are you interested in? I suppose it would be the name here?

logInfo("INFO", "Triggered by " + triggeringItem.name)

it works !! thanks a lot!!

Please tick the solution, thanks