From a4daf399ef893f5383fc5832f5311641cf268eec Mon Sep 17 00:00:00 2001 From: Jan Bouwhuis Date: Fri, 10 Jan 2025 11:44:09 +0100 Subject: [PATCH] Allow color_mode to be processed in Kelvin for MQTT template light (#36539) * Allow color_mode to be processed in Kelvin for MQTT template light * Add color_temp_kelvin documentation --- source/_integrations/light.mqtt.markdown | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/source/_integrations/light.mqtt.markdown b/source/_integrations/light.mqtt.markdown index 8947bd222ea..25c6be39a55 100644 --- a/source/_integrations/light.mqtt.markdown +++ b/source/_integrations/light.mqtt.markdown @@ -978,8 +978,13 @@ brightness_template: description: "[Template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) to extract brightness from the state payload value. Expected result of the template is an integer from 0-255 range." required: false type: template +color_temp_kelvin: + description: "When set to `true`, `command_topic` will publish color mode updates in Kelvin and process `state_topic` will process state updates in Kelvin. When not set the `color_temp` values are converted to mireds." + required: false + type: boolean + default: false color_temp_template: - description: "[Template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) to extract color temperature from the state payload value. Expected result of the template is an integer representing mired units." + description: "[Template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) to extract color temperature from the state payload value. Expected result of the template is an integer. If `color_temp_kelvin` is `true` the expected value is in Kelvin else mireds are expected." required: false type: template command_off_template: @@ -987,7 +992,7 @@ command_off_template: required: true type: template command_on_template: - description: "The [template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) for *on* state changes. Available variables: `state`, `brightness`, `color_temp`, `red`, `green`, `blue`, `hue`, `sat`, `flash`, `transition` and `effect`. Values `red`, `green`, `blue`, `brightness` are provided as integers from range 0-255. Value of `hue` is provided as float from range 0-360. Value of `sat` is provided as float from range 0-100. Value of `color_temp` is provided as integer representing mired units." + description: "The [template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) for *on* state changes. Available variables: `state`, `brightness`, `color_temp`, `red`, `green`, `blue`, `hue`, `sat`, `flash`, `transition` and `effect`. Values `red`, `green`, `blue`, `brightness` are provided as integers from range 0-255. Value of `hue` is provided as float from range 0-360. Value of `sat` is provided as float from range 0-100. Value of `color_temp` is provided as integer representing mired or Kelvin units if `color_temp_kelvin` is `true`." required: true type: template command_topic: @@ -1069,10 +1074,20 @@ json_attributes_topic: description: The MQTT topic subscribed to receive a JSON dictionary payload and then set as sensor attributes. Usage example can be found in [MQTT sensor](/integrations/sensor.mqtt/#json-attributes-topic-configuration) documentation. required: false type: string +max_kelvin: + description: The maximum color temperature in Kelvin. + required: false + type: integer + default: 6535 max_mireds: description: The maximum color temperature in mireds. required: false type: integer +min_kelvin: + description: The minimum color temperature in Kelvin. + required: false + type: integer + default: 2000 min_mireds: description: The minimum color temperature in mireds. required: false