getChildDevices returns 0

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.