Hi!
I´m trying to control color temperature of DALI lights in a scene. It is working fine when manually operating the light cards - but when attempting to create a scene state the lamps will not retain brightness settings.
To make the scene work I have to manually open the scenes.yaml file and edit «supported_color_modes» from this:
- id: "1704142140911"
name: Alt lys på - 2700K
entities:
light.dali_stue_1_1_62_10_cct_2x8w_spot:
min_color_temp_kelvin: 2702
max_color_temp_kelvin: 6535
min_mireds: 153
max_mireds: 370
supported_color_modes:
- color_temp
color_mode: color_temp
brightness: 255
color_temp_kelvin: 2702
color_temp: 370
hs_color:
- 28.391
- 65.659
rgb_color:
- 255
- 166
- 87
xy_color:
- 0.526
- 0.387
friendly_name: DALI Stue 1 1.62.10 CCT 2x8w Spot
supported_features: 40
state: "on"
To This:
- id: "1704142140911"
name: Alt lys på - 2700K
entities:
light.dali_stue_1_1_62_10_cct_2x8w_spot:
min_color_temp_kelvin: 2702
max_color_temp_kelvin: 6535
min_mireds: 153
max_mireds: 370
supported_color_modes:
- colortemp
color_mode: colortemp
brightness: 255
color_temp_kelvin: 2702
color_temp: 370
hs_color:
- 28.391
- 65.659
rgb_color:
- 255
- 166
- 87
xy_color:
- 0.526
- 0.387
friendly_name: DALI Stue 1 1.62.10 CCT 2x8w Spot
supported_features: 40
state: "on"
The only difference is removing the «_» between color_temp. Is there anything I can do to make HomeAssistant save the scene config using «colortemp» instead of «color_temp»? Or should I change the way the lamps are configured to make it work using «color_temp».
This is the light entity config:
# DALI light Stue 1 PNY CCT
- schema: template
name: "DALI Stue 1 1.62.10 CCT 2x8w Spot"
state_topic: "hdl/sc/1.62/10"
command_topic: "hdl/sc/1.62/10/set"
command_on_template: >
{"state": "on"
{%- if brightness is defined -%}
, "level": {{ brightness }}
{%- else -%}
, "level": 255
{%- endif -%}
{%- if color_temp is defined -%}
, "colortemp": {{ [[(1000000 / color_temp | float) | round(0), 2705] | max, 6535] | min }}
{%- endif -%}
}
command_off_template: '{"state": "off", "level": 0}'
state_template: "{% if value_json.level | int > 0 %}on{% else %}off{% endif %}"
brightness_template: "{{ value_json.level }}"
color_temp_template: "{{ (1000000 / value_json.colortemp | float) | round(0) }}"
max_mireds: 370
min_mireds: 153
qos: 1
I also have some system log errors related to «invalid colortemp». As mentioned everything works fine except for creating scenes.
Log entríes:
Logger: homeassistant.components.mqtt.light.schema_template
Source: components/mqtt/light/schema_template.py:243
Integration: MQTT (documentation, issues)
First occurred: January 13, 2024 at 08:00:50 (66949 occurrences)
Last logged: 00:29:20
Invalid color temperature value received
2024-01-13 02:25:40.600 ERROR (MainThread) [homeassistant.helpers.template] Error parsing value: 'dict object' has no attribute 'colortemp' (value: {"level":0}, template: {{ (1000000 / value_json.colortemp | float) | round(0) }})
2024-01-13 02:25:40.600 WARNING (MainThread) [homeassistant.components.mqtt.light.schema_template] Invalid color temperature value received
All help is highly appreciated Thanks!