Rule Help Reading item Label

rule “Security State Sensor”


Item Sensor_Garage changed
Item Sensor_SideDoor changed

logInfo(“what did it”,"" + Items.label) this is wrong :frowning:

with the above code i can see Security_Last_Change and it show up on my phone :slight_smile:
with this
Frame label=“At • [%1$tH:%1$tM:%1$tS %1$td/%1$tm]” item=Security_Last_Change and it outputs
At • [13:30:05 12/06]

Question is:
would like to add the Sensor Name/label to it
final outcome would look like
At • [13:30:05 12/06] Garage Door

the item is Sensor_Garage with the label Garage Door
which manual should i be reading


It is much easier to read code if you use code fences. There are five buttons to the right of the smilie face that will let you preserve the spacing and format of your posted code making it much easier to read.

I’m not 100% positive the label feature is fully implemented. What version of OH are you using?

More importantly, there is currently no straight-forward way to determine which Item triggered a rule. Since we are only dealing with two Items and one rule I would probably just split this into two separate rules. If you want to do it from the same rule there is a hack but it requires your Items to be members of the same group and have persistence configured. See: