Single Device Type provide Multiple Devices?


(Darryl) #1

Hello Everyone,

Has anyone found a way to develop a single device type, that controls multiple devices? I am playing with my EtherRain irrigation controller. I have successfully cycled a zone on perfectly—but ultimately I am trying to create a zone tester. Click on a “Irrigation folder” and then just be able to tap on the zone I want to turn on for a determined value of time. Can a single device type create multiple device tiles? Is there a way to get SmartThings to prompt me for a time duration, with a default set?

Thanks!


(Todd Wackford) #2

It’s easy if you create a service app. That’s what they’re good at. Then you create a virtual device for the thing interface


(Kent) #3

I have an alarm panel device that has multiple tiles inside of it and each tile can send commands to a remote device if you want.
Currently it shows all my zones from my alarm system and can control 2 garage doors from a single device type (you can make each tile a button if you want instead of just the two I have now). You could probably adapt it to be zones for your irrigation system instead.


(Kent) #4

Actually I don’t have the button code in that repo but here are my 2 garage buttons in that same device.
For each tile you want to be a button just assign it an action, in my case ‘toggleone’ and ‘toggletwo’ are my commands.
You can build as many tiles per single device as you want (I have not found a limit yet but maybe there is one…)

 standardTile("zone15", "device.zone15", canChangeBackground: true, canChangeIcon: true) {
      state("open",   label: 'Garage1', action: 'toggleone', icon: "st.doors.garage.garage-open",   backgroundColor: "#ffa81e", nextState:"closing")
      state("closed", label: 'Garage1', action: 'toggleone', icon: "st.doors.garage.garage-closed", backgroundColor: "#79b821", nextState:"opening")
      state("alarm",  label: 'ALARM', icon: "st.doors.garage.garage-open",    backgroundColor: "#ff0000")
      state("opening",label: 'Opening', icon: "st.doors.garage.garage-opening", backgroundColor:"#ffe71e")
      state("closing",label: 'Closing', icon: "st.doors.garage.garage-closing", backgroundColor:"#ffe71e")
    }
    standardTile("zone16", "device.zone16", canChangeBackground: true, canChangeIcon: true) {
      state("open",   label: 'Garage2', action: 'toggletwo', icon: "st.doors.garage.garage-open",   backgroundColor: "#ffa81e", nextState:"closing")
      state("closed", label: 'Garage2', action: 'toggletwo', icon: "st.doors.garage.garage-closed", backgroundColor: "#79b821", nextState:"opening")
      state("alarm",  label: 'ALARM',   icon: "st.doors.garage.garage-open",    backgroundColor: "#ff0000")
      state("opening",label: 'Opening', icon: "st.doors.garage.garage-opening", backgroundColor:"#ffe71e")
      state("closing",label: 'Closing', icon: "st.doors.garage.garage-closing", backgroundColor:"#ffe71e")
    }

(Darryl) #5

Thanks Kent!! I’ll try this out asap! I think this is exactly what I am looking for. I just wish we had good documentation to help me figure out what options existed.