Set the color picker control to my light's current color value

I’m working on a custom device type that controls the color of a LED. I’m using the new multiAttributeTile with the color picker to get a hex color number for example red is “hex.#FF0000” and send to my device. All is working extreamly well.

Now if my LED color is changed by a local switch I would like to set the color picker to the new value of my LED. My LED will report this change so I get the new color value in my custom device type this works well. I now want to update the color picker so the little dot is over the color that is being displayed on my device. I’m doing this with the brightness level and it works great. The level slider jumps to the new position as the LED’s brightness changes.

Is it possible to set the color value of the color picker? If so can someone point me in the right direction. I have tried this send event and nothing happens but no errors either.

resutlMap.value is a string "#FF0000"
color is the name of my color picker in the multiAttributeTile.

sendEvent(name: “color”, value: “hex.${resultMap.value}”, displayed: false)

Solved: I needed to add the Color Control capability so the “color” attribute would be available. Works like a champ! I really like the new color control and multiAttributeTile!

1 Like