How to select all input preference device by default?


(Wan Rong Jih) #1

Is there a way to select all input devices by default? I use the following input preference

input( name: "batteries", type: "capability.battery",  title: "Select devices", multiple: true, required: true )

it ask me to select devices myself. If there are 100 devices, I need to click 100 times :scream:

I find some SmartThings Recommends SmartApps can display the enable/disable “use all devices” switches. e.g. SmartThings Recommends -> Smart Home Monitor - Security -> Security, the Armed/Away Intrusion Sensors page will show the enable/disable “Use every open/close and motion sensor”. Is it possible for my SmartApp can have the same function?


(Bruce) #2

This will subscribe to every battery device, so that all battery events go to your handler.

subscribe(subscribe(location, "battery", handler)


(Wan Rong Jih) #3

Thanks @bravenel (your code seems incomplete).
My SmartApp just simply display the device current state and does not use the device subscription. Is there any other way to select all input devices?


(Bruce) #4

Not that I am aware of.


(ActionTiles.com co-founder Terry @ActionTiles; GitHub: @cosmicpuppy) #5

Not at this time, but this is a common feature request.