MQTT Light Color Temperature config error

Hi.

Having some issues with MQTT light and color temperature.

I have 1x dimmable light working with this config:

#1 - Temperature light
- schema: template
  name: "Test Temperature Light"
  state_topic: "hdl/sc/2.11/1"
  command_topic: "hdl/sc/2.11/1/set"
  command_on_template: >
    {"state": "on"
    {%- if brightness is defined -%}
    , "level": {{ brightness }}
    {%- else -%}
    , "level": 255
    {%- endif -%}
    }
  command_off_template: '{"state": "off", "level": 0}'
  state_template: "{{ 'on' if value_json.level | int > 0 else 'off' }}"
  brightness_template: "{{ value_json.level }}"

Wanted to add support for color temperature and added “color_temp_state_topic” and “color_temp_command_topic” according to MQTT Light Documentation

#1 - Temperature light
- schema: template
  name: "Test Temperature Light"
  state_topic: "hdl/sc/2.11/1"
  command_topic: "hdl/sc/2.11/1/set"
  color_temp_state_topic: "hdl/ct/2.11/1"
  color_temp_command_topic: "hdl/ct/2.11/1/set"
  command_on_template: >
    {"state": "on"
    {%- if brightness is defined -%}
    , "level": {{ brightness }}
    {%- else -%}
    , "level": 255
    {%- endif -%}
    }
  command_off_template: '{"state": "off", "level": 0}'
  state_template: "{{ 'on' if value_json.level | int > 0 else 'off' }}"
  brightness_template: "{{ value_json.level }}"

This creates an error when checking configuration under development tools:

Invalid config for [mqtt]: [color_temp_state_topic] is an invalid option for [mqtt]. Check: mqtt->mqtt->light->0->color_temp_state_topic. (See /config/configuration.yaml, line 6).

Hope somebody can explain what i am doing wrong?

Version:

Home Assistant 2022.9.4
Supervisor 2022.10.0
Operating System 9.0
Frontend 20220907.2 - latest
1 Like

The error message explains the problem:

[color_temp_state_topic] is an invalid option for [mqtt]

You’re using MQTT Light - Template schema and it doesn’t support color_temp_state_topic or color_temp_command_topic.

Those two options are supported by MQTT Light - Default schema.

1 Like

Thanks that makes sence, dont know how i missed that :smiley: