Here is a device type that I’ve written/copy pasted from other device types, I’m not sure if everything is the way it’s supposed to be but it works as I want it to.
I’ve written it so that it changes the color temperature when dimming the light, it makes it behave a bit more like a traditional bulb.
There is a preference section were users can edit the following
Enable/disable level and color temperature linking
Set a delay between level and color temperature change
Choose whether to show a generic color name such as “Relax” or a kelvin temperature such as “2300 K”
For those that assign this device handler to an already added device and who experience problems with the UI not updating values, try pressing the reload button once. That should then fix the issue and the values should update as expected.
Thanks for this! I’ve tried it out and a couple of things:
The mobile UI doesn’t seem to remember the bulbs state (on/off and dim level) when you go back to it. (same as the stock zigbee DH)
The dimming slider doesn’t seem to consistently work, ie. if I dim up to 100% it doesn’t always fully brighten.
I’d prefer if it didn’t change temperature while dimming, or perhaps you could make that an option.
(I just edited the setlevel function in my local copy to remove colour temp change, and the dimming now works ok. I think it won’t change level and temp at the same time consistently).
Regarding the UI not updating, i have seen this with some other devices and the ikea ones and also with other device handlers, i think it has something to do with the configuration that is sent when adding it so smartthings, in the device handler there is a config thats send some data to the device. I dont know when this is called but i have noticed that these kinds of issues gets solved by pressing the “reload” button in the UI
Also, regarding the dimming, it seems as though the ikea bulb wants to “animate” the dimming meaning it gradually goes to the requested level and if you for some reason where to set the color temperature it will actually stop dimming at what ever % it was on right then
Yes, I’ve found a similar problem with my Innr Colour bulbs. In my core Piston, I add a 5 second delay between setting level and setting colour, and that seems to fix it.
Im not at home right now so i cant test this but if you have the light close by then you could modify the setLevel method so that it add a delay between the level and temperature calls like this
def setLevel(value) {
// this will set the color temperature based on the level, 2200(0%) to 2700(100%)
// it’s a bit more like how a traditional filament bulb behaves
zigbee.setLevel(value) + “delay 500” + zigbee.setColorTemperature(2200 + (5*value))
}
I just updated the device handler so that users can set a delay between level and colour temperature change, give it a try if your devices don’t dim properly.
I noticed this weekend that the Ikea bulbs don’t offer the colour temperature controls inside ActionTiles. I’m not sure if it’s the DTH that would implement this, or something on the ActionTiles side?
Do you mean the one called “ZigBee White Color Temperature Bulb” or " ZLL White Color Temperature Bulb"?
The trådfri dth behaves like “ZigBee White Color Temperature Bulb” in that it shows a “name” instead of a kelvin temp. I don’t think that kelvin temp is all that interesting to know since, at least for me, it means nothing compared to a descriptive name of the color temp. “Soft white” is more understandable than “3239 K”