Skip to content
Discussion options

You must be logged in to vote

With a bit of Math-Foo it works (for me with my hue lights):
Service Data for "Turn On" Service:

{% set min = 2200 %}
{% set max = 6535 %}
{
"kelvin": {{ min + rotationAbsolute * ((max - min) / 255) }}
}

min = Minimum color temp supported by bulb
max = Maximum color temp supported by bulb

You can validate all values and the outcome with custom labels:



{{min_color_temp_kelvin}}-{{max_color_temp_kelvin}}
{{color_temp_kelvin}}


Bonus:
You can create nice "bright cold to dim warm" effects, too:

{% set min = 2200 %}
{% set max = 4000 %}
{
"kelvin": {{ min + rotationAbsolute * ((max - min) / 255) }},
"brightness": {{ rotationAbsolute }}
}

Replies: 3 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Answer selected by cgiesche
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@alexwhelan1997
Comment options

@cgiesche
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Support Support issue. Nothing to do in code.
4 participants
Converted from issue

This discussion was converted from issue #186 on December 10, 2023 12:32.