def printChildDevices(){
def children = app.getChildDevices()
log.debug "SmartApp with id $app.id has ${children.size()} child devices"
children.each { child ->
log.debug "child device id $child.id with label $child.label"
}
}
Ah, I thinks that was my misunderstanding.
I have an app that I want to be subscribed to all devices, all events and send status changes to my server (REST POST call). If I have a list of devices the app is subscribe to I can check against my complete list of devices to see if any are missing.
I don’t think there is a way for an app to list all devices on the network?
I see there is getSubscriptions() but what are the properties of subscriptions? How can I list names, IDs…?
Take a look at the Influx DB logger SmartApp. The code might give you some good ideas regarding maintaining a list of subscribed devices, getting their attributes, etc.