SmartThings Community

Better Dimmer Device

(Andrew Urman) #21

ya its awesome!

(Todd Wackford) #22


I’m having a little trouble getting the up/down buttons to fire the event correctly. But, it’s close. I’ll post it when I get that fixed.



(Huntb) #23

@twack yeah I tried putting it together last night for a couple hours and had everything working but the up/down buttons. I have them firing and the dimming level updates but nothing happens with the physical lights. When I hit refresh the app goes back to the original dimming level. I also may have broke the slider getting the up/down buttons to fire

(Huntb) #24

K, I fixed the slider, up/down buttons are firing and updating in app but up/down buttons do not change physical lights. I’m a C guy, this Java stuff and lack of documentation makes for a LOT of trial and error

(Coolcatiger) #25

@huntb, great, can you publish your code please ?

(Jeff DeWolfe) #26

You are using it in conjunction with the app correct? If so, the only config I had to change was to make the virtual dimmer the “master” and my real physical adapter the dimmer to follow or “slave” dimmer. As long as you put in the correct and not fat fingered attributes on the device type it should work.

(Huntb) #27

@chevyman142000 no, I am trying to create a new device type with twack’s interface so that I don’t have to use it with an app

(Jeff DeWolfe) #28

It is a virtual device and from what I can tell will not control a device directly. See Twack’s post here:

(Huntb) #29

@surajt like I said, the up/down buttons will not work. I have not been home to see it working with my own eyes, but the response from the light switch in my log is telling me that the slider does in fact work. Capabilities and Commands are in the header.

@twack I borrowed your header, if there is anything you want me to change or remove, let me know. I’m not much of a dev so I don’t know all the rules to this kinda thing


(Todd Wackford) #30

Looks fine. Your code is exactly as I have mine and I am at the same Wall. Buttons fire but setlevel method seems to go off to la-la land.

Try setting the slider value from the up/down methods and have that drive the chain. I think it’s settable.


(Huntb) #31

I figure the physical message is being sent to the dimmer switch, but it doesn’t understand what is being sent to it. I wish I could find a definition for the slider to see how it is initialized. It could be as simple as changing the data type

(Todd Wackford) #32

@huntb et al,

Finally figured it out. Sometimes the simplest answer tends to be the correct one. Anyway, here it is:

Happy Hacking!


(Todd Wackford) #33


Check out this link to get your t-stat question answered:

Happy Hacking!

(Todd Wackford) #34

I added one more little thing to this better dimmer device type. Should I rename it to the “Even Better Dimmer Device”? Nah…

You can now use a photo or picture as a background. Especially nice if you have a lot of dimmers because you can take a picture of the actual light(s) that you have. Beats shaking your phone for sure. I have about 10+ dimmers and the icons just weren’t cutting it. I was still finding that I was going into the device detail tiles to see the device label to know which light I was changing.

Let me know what you all think.


Still the same link:


Wow, very nice - thanks!

I would love to have pictures instead of those limited icons for my devices, all my devices…

I’m going to have to reuse your code to make my own device types that can use pictures.

(Todd Wackford) #36


Please post some screen shots of how you’re using it now. I’m sure others would like to see them.



I will. I just created a new device type for my switches, so I’ll update those once I install the latest beta. I just got an email for the newest release, so I’m going to play around with that for a while.

I can’t believe this was the only line I needed in standardTile:

canChangeBackground: true

I was expecting something a little more.

Thanks so much for all you’re doing.


Pictures for my devices will have to wait just a bit, darn… It got too dark for decent pictures because I want to avoid using the flash, but all my devices are now capable of using pics.

I showed this to my wife, and it got her approval factor too! That’s good enough for buying two more outlets from Lowes on the way home from work tomorrow…

(Todd Wackford) #39

My wife won’t let me put pictures of my office lamp on the phone. Wonder why?


(Todd Wackford) #40

What, no comment on my office lamp? :grin: