Thanks for inspiring me with this discussion! I added some Thing monitoring to my rules and optimized logging to suppress some unavailable or unhelpful strings from getThingStatusInfo():
rule "TV"
when
Thing 'samsungtv:tv:14dc9380_XXX' changed
then
val ThingStatusInfo = getThingStatusInfo("samsungtv:tv:14dc9380_XXX")
if(ThingStatusInfo===null) return;
var String thingStatusInfo_Msg = ""
if(ThingStatusInfo.statusDetail.toString!="NONE") thingStatusInfo_Msg = thingStatusInfo_Msg + ThingStatusInfo.statusDetail
if(ThingStatusInfo.description!==null) thingStatusInfo_Msg = thingStatusInfo_Msg + ThingStatusInfo.description
if(thingStatusInfo_Msg!="") logInfo("RULE","@R TV: {} [{}]", ThingStatusInfo.status, thingStatusInfo_Msg)
else logInfo("RULE","@R TV: {}", ThingStatusInfo.status)
end
I agree with @rlkoshak that adding a rule for each Thing is suboptimal.
It would be easier if something like triggeringItem exists for Things as you may find in this non-working example:
rule "TV"
when
Thing 'samsungtv:tv:livingroom' changed or
Thing 'samsungtv:tv:bedroom' changed or
Thing 'samsungtv:tv:kitchen' changed
then
val TriggeredThing = triggeringThing
val ThingStatusInfo = getThingStatusInfo(TriggeredThing)
Would it make sense to open an issue for this?
Cheers,
Alex