[RELEASE] custom DTH and webCoRE pistons for grouping like sensors and giving 1 aggregated status for the group

(Michael) #1

I have pulled this together using examples from the smartthings forum, webCoRE forum and other places. I wanted to get this posted and will be adding attribution at a later time, but a general thanks for all who share code/expertise and help us progress.

Utilizing webCoRE (pistons posted below), these DTH and child DTH (in github posted below) allow the grouping of similar sensors, like contact and temperature sensors, to show you an aggregated summary of the group through 1 simulated device like the “All Exterior Doors” and “Ave [group] Temp” things in my favorites below:

Grouped contact sensors:

Grouped temperature sensors:


There is an option below all of the child devices, to “REMOVE CHILDREN”. You can use this to remove all child devices, this can be useful instead of removing the device to force deleting all children. Saves time when adding/removing devices from groups and child devices persist for devices no longer in the group.

NOTE: when clicking on the “REMOVE CHILDREN” button, you will notice the status text (next to the refresh button) change to reflect the command has been issued. It can take a little while for the child devices to be removed from view. You might need to go to the main screen and back into the parent item for the children to be gone.

When first loading the parent (master) devices or after the “REMOVE CHILDREN” command has been used, you can re-populate the child devices by clicking the refresh button. This refresh button also manually forces an update to the group in daily use. The child devices will also be create automatically the next time the webCoRE piston runs.

As with the “REMOVE CHILDREN” function, it can take a little while for the children to appear when they get created as well, so give it a little time to refresh on its own, or go back to the main screen and navigate back to this item to try and force it.


Install Steps:

  1. Install Master and Child DTH from github repo
  2. Create new Device in smartthings ide, assign one of the Master DTH depending on use (contact/temperature)
  3. import/create the webCoRE pistons, and update the variables for the new devices created in 2 above and all the physical items for each group as needed in the pistons
  4. use the refresh button in one of the new devices created in 2 to run the piston and create the child devices.

let me know what you think, or if you need additional help getting it setup. I will update the install steps as needed.

Here is a link to my github with the DTH files in it:

Here are the green images for the webCoRE pistons (the import code is in the master DTH in the github):

Remove child devices in custom device type handler DTH?
(ActionTiles.com co-founder Terry @ActionTiles; GitHub: @cosmicpuppy) #2

This looks great! … Thanks @mbarone!

ActionTiles Customers frequently are looking for a way to create “consolidated sensor” Tile(s), and we prefer to recommend starting at the SmartThings side with either a SmartApp or webCoRE, that way we don’t create a partial solution that is only usable within ActionTiles.

Average Temperature from this Piston can be used as a Thermostat trigger and stuff like that, whereas if it was just done in the front-end, that ability would be lost.

(Tagging @625alex, so he’s aware of this utility.)

(Greg) #3

Got around to trying this out. I’m having an issue with installing the Master DTH for temperature. I’m getting this error when creating the DTH

Org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed: script_dth_metadata_433d24a1_9ba9_48e7_a94d_780e2092712f: 48: expecting ')', found 'backgroundColors' @ line 48, column 6. backgroundColors:[ ^ 1 error

(Michael) #4

sorry about that, i got rid of a comma on the end of line 47 somehow when i was commenting out log lines before i created this thread. I didnt test this one after updating. it has been fixed in github.

let me know if there are any other issues or things that would be helpful to include.