I recently wrote my first SmartApp GroveStreams SmartApp and found that I had to include a lot of capabilities in the preferences just in case the user has them - whether s/he has them or not.
Is there a way of querying which capabilities are available for the location?
Thanks @jody.albritton that looks great for finding the capabilities of a specific device, but what I am really after is the capabilities available across devices at a Location.
I want to only present as inputs those capabilities available so that the user doesn’t have to page through a load that aren’t relevant to them.
I can’t find a way of enumerating Devices or Capabilities that are available.
I don’t know if there is an easier way, but I would create an array of devices for the location. Then, loop through that array and display the capabilities using a method similar to the one above.
Thanks @psfunatyo that’s a shame. I think I should at least be able to enumerate them within the app, even if I can’t interact with them. After all, when you prompt for capabilities the devices with those capabilities are listed, so being able to ask what capabilities a location has would seem reasonable.
With ST you are able to build your own API. You should take a look at some of the api endpoint examples. You could configure a smartapp api endpoint that would allow users to authorize their devices, and then you could enumerate the capabilities of all authorized devices.
Thanks @jodypeterson, yes I guess going through the OAuth process would list the available devices. I was hoping to do it within the SmartApp though and can’t really see a good reason why this wouldn’t be supported.