Is your feature request related to a problem? Please describe.
Supporting this format would be a good preparation before template support will be added.
The marked lamp glows blue. The problem is that the light body itself is not colored in blue. Just for this reason it would be important that this body shines in the corresponding color. This would be possible with colorconditiontemplates.
Something like this could be possible to adjust the color dynamically with a Jinja2 Template when template support is added:
{{ state_attr("light.wled_light", "rgb_color") | regex_replace('[()]+', '') }}
Describe the solution you'd like
Adding colorcondition to light. Adding the (r, g, b) support for colorcondition.
Describe alternatives you've considered
NaN
Additional context
Configuration with (r, g, b) support:
- entity: light.wled_light
type3d: color
object_id: mylightobjectid
colorcondition:
- color: "100, 255, 20"
state: on
Configuration with (r, g, b) and template support:
- entity: light.wled_light
type3d: color
object_id: mylightobjectid
colorcondition:
- colorrgbtemplate: "{{ state_attr("light.wled_light", "rgb_color") | regex_replace('[()]+', '') }}"
state: on
Typescript example to convert rgb to hex:
function componentToHex(c: number) {
var hex = c.toString(16)
return hex.length == 1 ? "0" + hex : hex
}
function rgbToHex(r: number, g: number, b: number) {
return "#" + componentToHex(r) + componentToHex(g) + componentToHex(b)
}
console.log(rgbToHex(100, 51, 255)); // #6433ff