Where to find "color_temp" in entity state value?

Before I temporary store a new color_temp in an lkea light I like to store the current color_temp in a var, to place it back after a handling.
But I don’t know where to find this value?
In states it is not shown?
Brightness is there, but color_temp not.
Any ideas?

Knipsel

It might be there…but they don’t (can’t?) show every single thing.

You can tell by looking at the supported features bitmask. (Well, software can tell what’s supported. It’s annoying for humans to parse this)

supported_features: 43 = 0010 1011

SUPPORT_BRIGHTNESS = 1
SUPPORT_COLOR_TEMP = 2
SUPPORT_EFFECT = 4
SUPPORT_FLASH = 8
SUPPORT_COLOR = 16
SUPPORT_TRANSITION = 32
SUPPORT_WHITE_VALUE = 128

So we can see this light supports

BRIGHTNESS, COLOR_TEMP, FLASH, TRANSITION.

But, just because it supports color_temp doesn’t mean it reports it. Not sure what kind of like you have…I could look in the code if you list it here. By default, lights do not report color_temp, so it’s up to the integration to overwrite that value.

If it did report it, you’d get it with:

state_attr('light.ikea_1_lamp_bank', 'color_temp')

You could see if a scene.create would store the light.

Keep in mind, this would store the entire state, but it could be useful…

1 Like

Thanks this is educative.
It is more easy to store the last setting in a var and use that.
Thanks for the very clear explanation