Preference input: Filter by Device Type

I have written a SmartApp that turns on Wemo Switches/Sockets/Insights via the use of ST Virtual on/off button Switches. My input statement in preference looks like:

section(“Wemo Switches to Control”){
input “switches”, “capability.switch”, title: “Wemo Switches”, multiple: true, required: true, refreshAfterSelection:true

The problem is that every switch including those not handled by this app will show up when selecting switches from the list. So my question is:

Is there a way I can modify the above section/input so that only the Virtual on/off button switches I use to control Wemos appear in the selection list within the apps preferences??**

This is a way to ask for particular device type. See if you can figure out the name of your Wemo device type. Should be camel case.

input "weatherDevices", "device.smartweatherStationTile"

Thank you for your reply. From your example it looks like lowercase for the first word then the spaces are stripped from the name. The device type am using is a simple “On/Off Button Tile” type. Does device.onOffButtonTile sound right

Dang… It worked.
Again… Thank you very much.

1 Like

I think you’re looking for "capability.momentary"

Actually device.onOffButtonTile works like a charm. Only (potential) problem is that this button device could be used for more than just virtual wemo devices. Selecting such switch from within the prefs of my smartapp could create havoc :frowning: