Query for Device Details from SmartApp

Can device definition details be queried from a SmartApp? All of the SmartApp documentation is focused on querying for current values and events.

My use case is this… I have an Arduino that is hooked up to my Alarm panel and I have all of my zones defined as tiles in my custom device handler (device.zone1, device.zone2, etc). What I would to do is have a SmartApp create virtual devices automatically for each zone, which I know is doable. However instead of hard coding the number of virtual devices and even labels of these virtual devices in my SmartApp, I would like to query the device handler for this information since it is already stored there.

In the device handler tiles method, there is the details string which defines the order and tiles that should appear on device when viewing it. I would really like to query for the details string from a SmartApp so I can parse through it to create the virtual devices. I would also like to query for the tile label so I can then set the label of the virtual device as I am creating it.

Is this doable? I really dislike hard coding things when I have the same data available in other places. Define once and leverage!

Perhaps, look at using custom attributes in your device type. You can query those from a SmartApp, and they can be set in the device type. How does your device type know how many zones you have? Or is that hard coded?

I had a similar problem in my Lutron integration. What I ended up doing was having the smartapp query me at install how many devices I was setting up (which the device type doesn’t know), and then I just iterated through setting them up. That included giving the devices names, but it doesn’t sound like that’s your issue. Those names in your case could be device attributes. A typical device type doesn’t have this naming problem.