bettis
(Bettis)
1
Hi,
in a JavaScript (ECMAScript 2022+) UI Script with the trigger
When the state of an item group changes
I can get the triggering item name and state, e.g.
console.debug(event.itemName + " has changed to " + event.itemState);
If the Script is triggered by a thing status change, how do I get the triggering thing name?
event.thingName gives me undefined
Thanks, Markus
Oliver2
(Oliver)
2
event.thingUID
if you need the name of a thing:
things.getThing(event.thingUID.toString()).label
1 Like
rlkoshak
(Rich Koshak)
3
See JavaScript Scripting - Automation | openHAB for all the properties that can be a part of event
and under what circumstances that property will exist.
1 Like
bettis
(Bettis)
4
Works fine, thank you very much for your help!