home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
72.87k stars 30.52k forks source link

(<class 'homeassistant.components.template.light.LightTemplate'>) set to unsupported color mode hs #129287

Open basslet opened 6 hours ago

basslet commented 6 hours ago

The problem

Log errors about light templates set to unsupported color mode hs. See yaml code below.

What version of Home Assistant Core has the issue?

2024.10.4

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant Supervised

Integration causing the issue

template light

Link to integration documentation on our website

https://www.home-assistant.io/integrations/light.template/

Diagnostics information

Logger: homeassistant.components.light
Source: components/light/__init__.py:1114
integration: Light (documentation, issues)
First occurred: 20:56:24 (3 occurrences)
Last logged: 20:57:16

light.living_room_lights (<class 'homeassistant.components.template.light.LightTemplate'>) set to unsupported color mode hs, expected one of {<ColorMode.COLOR_TEMP: 'color_temp'>}, this will stop working in Home Assistant Core 2025.3, please create a bug report at https://github.com/home-assistant/core/issues?q=is%3Aopen+is%3Aissue+label%3A%22integration%3A+template%22
light.entrance_lights (<class 'homeassistant.components.template.light.LightTemplate'>) set to unsupported color mode hs, expected one of {<ColorMode.COLOR_TEMP: 'color_temp'>}, this will stop working in Home Assistant Core 2025.3, please create a bug report at https://github.com/home-assistant/core/issues?q=is%3Aopen+is%3Aissue+label%3A%22integration%3A+template%22
light.bedroom_lights (<class 'homeassistant.components.template.light.LightTemplate'>) set to unsupported color mode hs, expected one of {<ColorMode.COLOR_TEMP: 'color_temp'>}, this will stop working in Home Assistant Core 2025.3, please create a bug report at https://github.com/home-assistant/core/issues?q=is%3Aopen+is%3Aissue+label%3A%22integration%3A+template%22

Example YAML snippet

light:
  - platform: template
    lights:
      # ------------------------------------------------------------------------------
      living_room_lights:
        friendly_name: "Wohnzimmer Licht"
        unique_id: 60d8a92c-e508-11ed-b5ea-0242ac120002
        value_template: "{{ is_state(this.entity_id.replace('_lights','_group'), 'on') }}"
        temperature_template: "{{state_attr(this.entity_id.replace('_lights','_group'), 'color_temp')}}"
        hs_template: "{{state_attr(this.entity_id.replace('_lights','_group'), 'hs_color')}}"
        turn_on:
          - service: script.tlight_turn_on
            data_template:
              room_name: "{{this.entity_id.split('.')[1].replace('_lights','') }}"
        turn_off:
          - service: script.tlight_turn_off
            data_template:
              room_name: "{{this.entity_id.split('.')[1].replace('_lights','') }}"
        set_level:
          - service: script.tlight_set_level
            data_template:
              room_name: "{{this.entity_id.split('.')[1].replace('_lights','') }}"
              brightness: "{{ brightness | default(100) | int }}"
              transition: "{{ transition | default(0.5) | float }}"
        set_temperature:
          service: script.tlight_set_temperature
          data_template:
            room_name: "{{this.entity_id.split('.')[1].replace('_lights','') }}"


### Anything in the logs that might be useful for us?

_No response_

### Additional information

_No response_
home-assistant[bot] commented 6 hours ago

Hey there @phracturedblue, @tetienne, @home-assistant/core, mind taking a look at this issue as it has been labeled with an integration (template) you are listed as a code owner for? Thanks!

Code owner commands Code owners of `template` can trigger bot actions by commenting: - `@home-assistant close` Closes the issue. - `@home-assistant rename Awesome new title` Renames the issue. - `@home-assistant reopen` Reopen the issue. - `@home-assistant unassign template` Removes the current integration label and assignees on the issue, add the integration domain after the command. - `@home-assistant add-label needs-more-information` Add a label (needs-more-information, problem in dependency, problem in custom component) to the issue. - `@home-assistant remove-label needs-more-information` Remove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.

(message by CodeOwnersMention)


template documentation template source (message by IssueLinks)