I now have a lot of devices, and putting them in groups does help quickly locate what you’re looking for, especially when a room may have a few sets of similar lights like ceiling cans. My wife really likes to see the name of the device instead of an icon, and shaking the phone kinda wigged her out a bit, so I came up with this process.
I’ll say it isn’t as simple as an attribute you can put in “standardTile” in your own device type, but it isn’t too bad considering it works and now my wife is using ST more and more.
Here’s how I did it:
-
Create your own device type in the IDE modeled exactly from “Z-Wave Switch”
-
Add “canChangeBackground: true” to the standardTile for “switch” to give you the ability to use your own pictures (credit to twack for showing me that!):
// tile definitions
tiles {
standardTile("switch", "device.switch", width: 2, height: 2, canChangeIcon: true, canChangeBackground: true) {
state "on", label: '${name}', action: "switch.off", icon: "st.switches.switch.on", backgroundColor: "#79b821"
state "off", label: '${name}', action: "switch.on", icon: "st.switches.switch.off", backgroundColor: "#ffffff"
}
-
Pick any switch and change the device type to the one you just created via the IDE. Make sure to stop/restart the ST app on your phone.
-
You need a picture/image with a transparent background (PNG format preferred) for all this to work. I’ve included one of mine that can be used as a starter. If the background isn’t transparent, when the state changes (on/off) you will not see a color change, just a quick flash.
-
Using any decent photo editor (I used PaintDotNet - free and easy), create a picture with just text, just like in my attached example. Save it somewhere where can get to it from your phone.
-
In the ST app, go to your device/switch, and tap on the gear to configure it. You should now see an “Appearance” tile enabled by step 2 above. Tap on that, select the picture/image you just created, and you’re done!
Like I said, this isn’t fast, and I’d love for the ST developers to give us the option to select the device name or an icon; but for now this is an acceptable way for me. Hopefully others will find this useful.