Best method for creating virtual devices now?

I’ve been wondering: should we be creating virtual switches using community drivers, or using something that’s ST provided for futureproofing? Why not use something Samsung-provided / e.g. ST Schema Virtual Device Manager for a simple switch?

I’ve opened Alexa on one device and smartthings app on another. Can confirm that the virtual switch status is updated both ways within about a second or two of it being pressed in either app. Interestingly though Alexa shows the switch turning off or on, looking at routine history for the corresponding routine that should be triggered shows it is not being triggered each time. So to me this feels like it could be an Alexa issue… As though the Alexa routines are not fully monitoring all device state changes.

1 Like

I’m not familiar with this. How can non-developers use these?

Probably the easiest way is with a community-created UI to the REST API. it is called “API browser plus“ and all you need is a web browser, it doesn’t require a laptop or a hub. You can create simple virtual devices with it, although with nowhere near the number of features and options, available with the hub-based virtual devices. But you won’t need to be a Developer.

SmartThings API Browser+ ... Now Available to All

There is also an FAQ on creating virtual devices using the 2023 architecture that you might find interesting:

Virtual Switches After Groovy FAQ

1 Like

Several of the existing community-created edge Drivers offer a lot more features than the Samsung provided ones. One of the most popular is the ability to create a device which is both a switch and a Contact Sensor so you can turn it on and off easily in automations or by voice, but it will also trigger an Alexa routine (which at the time of this post could not be triggered by just a simple switch).

So I think it just comes down to the details of what you need. :thinking:


Remember that the switch part of the virtual device is not what is used to trigger the Alexa routine. It’s the sensor part of the device that does that. So you want to have the smartthings app open to the switch, but the Alexa app open to the sensor and watch to see if it opens and closes as the switch is turned on and off. :thinking:

Would it be a reasonable strategy to use a community virtual switch driver just for contact sensor when needed (for Alexa), and use a “stock” ST driver just for a state toggle (for Routines)?

Thanks. I don’t think Alexa allows users to view the sensor state for devices that are both switch and sensor, unless I missed this?