Insert all the things that are attached to the hub in to one input

I’m building a SmartApp with one section.
I was warning if there is a basic capability that is common to all the things so I can gather them all into one input.
At the moment what I do is:

section() {
input “devices”, “capability.mediaPlayback”, title: “Devices”, multiple: true
input “devices”, “capability.thermostat”, title: “Devices”, multiple: true
input “devices”, “capability.switch”, title: “Devices”, multiple: true
input “devices”, “capability.actuator”, title: “Devices”, multiple: true

Another problem I have is that I see duplicated devices when I use this arraignment.


Probably not, and it depends. The one I can think of is “capability “Health Check”” as one you may be able to look for, but that may not exist for all devices, especially if they’ve been added to the hub a long time ago before health check was introduced and the user is using a custom dth. Maybe Sensor as well. You can poke around in ST’s github repo to look at their DTH code to see if that’s a common one.

That’s expected behavior because a device, like a switch, can have more than one capability. If you look at a typical DTH from ST, like “ZigBee Switch Power”, you’ll see the capabilities being made available to any device using that DTH:

	capability "Actuator"
	capability "Configuration"
	capability "Refresh"
	capability "Power Meter"
	capability "Sensor"
	capability "Switch"
	capability "Health Check"
	capability "Light"