Subscribing to Virtual Device?

I have virtual devices created by Alexa Virtual Device Creator. I’m not sure how to subscribe to these devices in my SmartApp.
While I can use input to select a virtual device then I get its handle with which I could subscribe to it, I’m looking for a way to subscribe to the device using its name or any other known parameter of it.

you cannot. The smart app has to be authorized to access the device (via explicit setup in settings) in order for the smart app to access the device object.

The one exception is devices that were created by this smartapp, which are available via getChildDevice methods.

So how do I create a virtual device by this smartapp?

There is a method called addChildDevice for that:

You should be able to find some examples in the SmartThingsPublic repo.

1 Like