# Color Temperature Control Values

I am quite new to openHAB, and I often found it difficult to get documentation about something. So I will try to ask.

From what I found out, the color temperature in Philips Hue is not set in K but in some kind of reciproke value called Mired. In openHAB, on the other side, the color temperature is of Dimmer type, which goes from 0 to 100 percent. So I looked around, but I did not find documentation, which percentage is which color temperature. Can anyone help?

The color temperature range of the Philips lamps is from 2200K to 6500K, which is from 455 to 154 Mired.

Welcome!

Our developers spend time writing official documentation to address most questions, including this one.

Channel Type ID: color_temperature
Type: Dimmer
Description: This channel supports adjusting the color temperature from cold (0%) to warm (100%).
Thing Types Supported: 0210, 0220

I suppose that the colortemperature has a linear function. Based on this ist is a simple calculation 6500K equals 154 mired equals 0% and 2200k equals 455 mired equals 100%. To develop a formula to calculate from one value to another should be simple.

But i don’t think that is your real problem?

@Bruce_Osborne: I had read that documentation carefully before I posted. And addtionally I had read all the topics related to binding and hue before I posted. Unfortunately I did not find the answer to my question there.

@Dibbler42: From what I found out by now it is not linear. The calculation is:

dimmervalue = ( mired - gu ) / ( go - gu) * 100

mired = 1000000 / colortemperature

If the range of the dimmer value in openHAB is the same as the range of the Philips hue lamp, then the variables gu and go would be:
go = 153.846154
gu = 454.545455

When I tested that calculation it worked quite well. But somewhere I read, that gu could be 500 (which is 2000K). That let me in doubt.

Somewhere deep in the code of the binding they calculate the mired value, that is to send to the hue bridge, from the dimmer value. And I am quite sure they use the reverse of the formula above. But I am not sure, which values they use for what I called gu and go.

Thank you.

I had not heard that term before but this appears to show the calculation?

@Bruce_Osborne: Yes, from all the documentation I read, it seems clear, that the value, the hue binding module sends to the hue bridge, is a mired value. And it is no problem to calculate mired from color temperature and vice versa. That is not the question.

The problem is, which value of the dimmer type (0% cold, 100% warm, as you stated) is the equivalent to which mired value in the hue bridge. Or: what color temperature value means “cold” and “warm” in that case (i.e. hue binding).

One possibility is, that 2200K is 454 mired is 100%, and 6500K is 154 mired is 0%. But that is not sure, and there is doubt. Another possibility is that 2000K is 500 mired is 100%, and whatever K is whatever mired is 0%.

I am not sure who the Dev is for this binding. Filing an issue on Github asking for an option based on mired might be a good starting point on getting your answers.

@Bruce_Osborne: I am not sure I know how to file an issue on github, but I will try my very best. And I will do further investigation. Thank you very much for your answers so far. If I find out something, I will post it here.

I believe you would file it here.

ct

The colour temperature (white only) 154 is the coolest, 500 is the warmest
Thanks to Nathan for observing that this appears to be measured in Mireds, equivilent to 1000000/T (where T is the temperature in Kelvin) corresponding to around 6500K (154) to 2000K (500)

Also see here:

.
.
Kelvin values depending on your Hue bulbs: 2000 K or 2200 K to 6500 K
.

3 Likes

Thanks a lot. That’s the information I was searching for.

I want to add a diagram showing the connection between the dimmer value in openHAB and the color temperature in Kelvin for those who wonder about it like me:

As the diagram shows, it is not linear.

Typical values are then:
warm white: 2700K --> 370 mired --> 62.55%
neutral white: 4000K --> 250 mired --> 27,78%
cold white: 5500K --> 182 mired --> 8,08%

5 Likes

While adding some new Hue light bulbs i found that the dimmer value in Basisc UI give not an intuitive value for the color temperature. From my point of view 2000K or 2700K or 6500K is the better value to display. So i created a small Javascript transformation to display the right value in Kelvin.

Demo item:

``````Dimmer myColorTemperature "Color temperature [JS(i18n_hue0210_colortemp.js):%s <light_led_stripe_rgb> (someGroup) { channel="hue:xxxx:yyyy:color_temperature" }
``````

Transformation:

``````(function(i) {

var dimmervalue = parseFloat(i);

var minmired = 2000.0/13.0 // 6500°K
var maxmired = 500.0  // 2000°K

colortemp=Math.round(100000000/(dimmervalue*maxmired-dimmervalue*minmired+100*minmired))

return colortemp + "K"

})(input)
``````

Real world picture:

5 Likes