Unable to pass color_temp_kelvin to template light

Hi,

I have a template that has a set_temperature action defined. However I now keep getting the following error in the log;

Got `color_temp` argument in `turn_on` service, which is deprecated and will break in Home Assistant 2026.1, please use `color_temp_kelvin` argument

In preparation for this I would like to start using color_temp_kelvin in my template light however there does not seem to be a way of getting the kelvin value that is passed into the template

Any ideas please?

The attribute is only available if the light supports it and if the light is on.

{{ state_attr('light.lifx_cinema_left','color_temp_kelvin') }}

Hi Tom,

I don’t think I made myself clear. I would normally set the color_temp in the template light as follows.

action: light.turn_on
data:
  color_temp: 300
target:
  entity_id: light.study_ceiling_template

I could then reference the value of color_temp in the template light by referencing the variable color_temp.

I now wish to use color_temp_kelvin. I would now pass this to the template light as follows:

action: light.turn_on
data:
  color_temp_kelvin: 4010
target:
  entity_id: light.study_ceiling_template

However the value of color_temp_kelvin does not seem to get passed as a variable to the template light.

Yeah the template light integration has not been updated to use color_temp_kelvin yet: https://www.home-assistant.io/integrations/light.template/#considerations
brave_screenshot_www.home-assistant.io

The core team should update it before color_temp is depreciated.

You can open an issue here to move it along if you like: GitHub · Where software is built

I searched and an open issue does not already exist for this. Though a couple have been let go stale and auto-closed.

OK, thanks for that.

Issue raised at color_temp_kelvin not being passed as parameter into template light · Issue #146345 · home-assistant/core · GitHub

1 Like

I was also receiving this error, I solved it by removing the offending code from my scenes:

Default:

name: Test
entities:
  light.bedroom_tv_ambient_light:
    min_color_temp_kelvin: 2000
    max_color_temp_kelvin: 6535
    min_mireds: 153
    max_mireds: 500
    supported_color_modes:
      - color_temp
    color_mode: null
    brightness: null
    color_temp_kelvin: null
    color_temp: null
    hs_color: null
    rgb_color: null
    xy_color: null
    off_with_transition: true
    off_brightness: 38
    icon: mdi:television-ambient-light
    friendly_name: Bedroom TV Ambient Light
    supported_features: 40
    state: "off"
metadata: {}

Modified:

id: "1745702793456"
name: Bed Room TV Ambient Light 15% 2700K
entities:
  light.bedroom_tv_ambient_light:
    min_color_temp_kelvin: 2000
    max_color_temp_kelvin: 6535
    min_mireds: 153
    max_mireds: 500
    supported_color_modes:
      - color_temp
    color_mode: color_temp
    brightness: 38
    color_temp_kelvin: 2700
    color_temp: 446
    off_with_transition: false
    off_brightness: null
    icon: mdi:television-ambient-light
    friendly_name: Bedroom TV Ambient Light
    supported_features: 40
    state: "on"
icon: mdi:led-strip
metadata: {}

You did not remove it:

Also, is that a template light?

If not then you need to open a separate issue for that.

Looks like it will be in this month’s release: Add color_temp_kelvin to set_temperature action variables by Petro31 · Pull Request #146448 · home-assistant/core · GitHub

I’m running the beta release but don’t have a template light to test it on.

That was well timed. Thanks for the update.

Not sure if it’s actually being added to this months release. It was merged into the code base and it will likely make the release, however it could be delayed until next release. FYI. Just check this months release notes to confirm.

Also keep in mind, the warning will still appear because both values are sent to the running script. When the deprecation is over, color_temp will be removed and the warning will go away.

It’s already in 2025.6.0b7

Alright then, that was faster than normal