I’ve got a light template and I cannot (from the documentation) figure out how to change the color mode. In my light template, if i change the color temperature, the color/temperature will correctly change but the color mode will stay at “HS”. If I change an actual light’s color temperature, the color mode will go to “color_temp”. Is there any way to fix my template?
- platform: template
lights:
fish_light_3:
friendly_name: "Fish Light 3"
level_template: "{{ state_attr('light.gledopto_gl_c_008_1a140f15_11', 'brightness')|int }}"
#value_template: "{{ state_attr('light.gledopto_gl_c_008_1a140f15_11', 'brightness')|int > 0 }}"
value_template: "{{ states.light.gledopto_gl_c_008_1a140f15_11.state }}"
temperature_template: "{{state_attr('light.gledopto_gl_c_008_1a140f15_11', 'color_temp') | int}}"
color_template: "{{state_attr('light.gledopto_gl_c_008_1a140f15_11', 'hs_color')}}" #"({{states('input_number.h_input') | int}}, {{states('input_number.s_input') | int}})"
#effect_list_template: "{{ state_attr('light.gledopto_gl_c_008_1a140f15_11', 'effect_list') }}"
turn_on:
- service: light.turn_on
entity_id: light.gledopto_gl_c_008_1a140f15_11
turn_off:
- delay: 00:00:05
- service: light.turn_off
entity_id: light.gledopto_gl_c_008_1a140f15_11
set_level:
service: light.turn_on
data:
entity_id: light.gledopto_gl_c_008_1a140f15_11
brightness: "{{ brightness }}"
set_temperature:
#- service: input_text.set_value
# data_template:
# entity_id: input_text.broadcast_message_to_office
# value: "{{ color_temp }}"
- service: light.turn_on
data:
entity_id: light.gledopto_gl_c_008_1a140f15_11
color_temp: "{{ color_temp }}"
#set_white_value:
# service: light.turn_on
# data:
# entity_id: light.gledopto_gl_c_008_1a140f15_11
# white: "{{ white_value }}"
set_color:
- service: light.turn_on
data_template:
entity_id: light.gledopto_gl_c_008_1a140f15_11
hs_color: "[{{h}}, {{s}}]"
#set_effect:
# - service: light.turn_on
# data_template:
# entity_id:
# - light.ledvance_a19_rgbw_e1e40500_level_light_color_on_off
# effect: "{{ effect }}"
supports_transition_template: "{{ true }}"
- platform: template
lights:
kitchen_led:
friendly_name: "Kitchen LED"
level_template: "{{ state_attr('light.gledopto_gl_c_008_c19f431d_level_light_color_on_off', 'brightness')|int }}"
#value_template: "{{ state_attr('light.gledopto_gl_c_008_c19f431d_level_light_color_on_off', 'brightness')|int > 0 }}"
value_template: "{{ states.light.gledopto_gl_c_008_c19f431d_level_light_color_on_off.state }}"
temperature_template: "{{state_attr('light.gledopto_gl_c_008_c19f431d_level_light_color_on_off', 'color_temp') | int}}"
color_template: "{{state_attr('light.gledopto_gl_c_008_c19f431d_level_light_color_on_off', 'hs_color')}}" #"({{states('input_number.h_input') | int}}, {{states('input_number.s_input') | int}})"
#effect_list_template: "{{ state_attr('light.gledopto_gl_c_008_c19f431d_level_light_color_on_off', 'effect_list') }}"
turn_on:
- service: light.turn_on
entity_id: light.gledopto_gl_c_008_c19f431d_level_light_color_on_off
turn_off:
- delay: 00:00:05
- service: light.turn_off
entity_id: light.gledopto_gl_c_008_c19f431d_level_light_color_on_off
set_level:
service: light.turn_on
data:
entity_id: light.gledopto_gl_c_008_c19f431d_level_light_color_on_off
brightness: "{{ brightness }}"
set_temperature:
service: light.turn_on
data:
entity_id: light.gledopto_gl_c_008_c19f431d_level_light_color_on_off
color_temp: "{{ color_temp }}"
#set_white_value:
# service: light.turn_on
# data:
# entity_id: light.gledopto_gl_c_008_c19f431d_level_light_color_on_off
# white: "{{ white_value }}"
set_color:
- service: light.turn_on
data_template:
entity_id: light.gledopto_gl_c_008_c19f431d_level_light_color_on_off
hs_color: "[{{h}}, {{s}}]"
#set_effect:
# - service: light.turn_on
# data_template:
# entity_id:
# - light.ledvance_a19_rgbw_e1e40500_level_light_color_on_off
# effect: "{{ effect }}"
supports_transition_template: "{{ true }}"