I have a widget that displays the result of a thing status monitoring mechanism, where all devices (things) are represented by a dummy item that is ON when the device is operating, and OFF when it is not. The dummy items are set in different rules depending on device functionality etc.
component: f7-card
config:
title: Unavailable Devices
slots:
default:
- component: f7-card-content
slots:
default:
- component: f7-list
config:
mediaList: true
slots:
default:
- component: oh-repeater
config:
filter: loop.item.state == "OFF"
for: item
fragment: true
groupItem: vServiceAvailability
sourceType: itemsInGroup
slots:
default:
- component: oh-list-item
config:
icon: f7:exclamationmark_bubble
iconColor: red
title: =loop.item.label
What I would like to acheive is to filter the results so all Things that are “DISABLED” (uninitialized) are not included in the results. But I haven’t found a way to do this effectively.
I have a rule that can detect the thing status and discover if a Things is disabled:
var vThingStatus = getThingStatusInfo(vThingUID).getStatus()
//logInfo("ThingStatus:", "vThingUID: "+vThingUID+ " Status: "+vThingStatus)
if ((vThingStatus.toString())=="DISABLED")
< do something>
And maybe this can be used - I just haven’t found any good way to make use of this. Also if there is a way in the widgets to do “loop.thing.state” this would be much more effective, but I’ve tried this in all sorts of ways which didn’t work.