From 978f2e3d5d67efbd04864def99191274ac252098 Mon Sep 17 00:00:00 2001 From: Erik Date: Thu, 15 Jul 2021 18:16:59 +0200 Subject: [PATCH] Use explicit color mode for RGBWW lights --- tasmota/xdrv_12_home_assistant.ino | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tasmota/xdrv_12_home_assistant.ino b/tasmota/xdrv_12_home_assistant.ino index c9ca04906..7568b8e2f 100644 --- a/tasmota/xdrv_12_home_assistant.ino +++ b/tasmota/xdrv_12_home_assistant.ino @@ -102,7 +102,9 @@ const char HASS_DISCOVER_LIGHT_WHITE[] PROGMEM = const char HASS_DISCOVER_LIGHT_CT[] PROGMEM = ",\"clr_temp_cmd_t\":\"%s\"," // cmnd/led2/CT "\"clr_temp_stat_t\":\"%s\"," // stat/led2/RESULT - "\"clr_temp_val_tpl\":\"{{value_json." D_CMND_COLORTEMPERATURE "}}\""; + "\"clr_temp_val_tpl\":\"{{value_json." D_CMND_COLORTEMPERATURE "}}\"," + "\"clrm_stat_t\":\"%s\"," // stat/led2/RESULT + "\"clrm_val_tpl\":\"{%%if value_json.White%%}color_temp{%%else%%}hs{%%endif %%}\""; const char HASS_DISCOVER_LIGHT_SCHEME[] PROGMEM = ",\"fx_cmd_t\":\"%s\"," // cmnd/led2/Scheme @@ -530,7 +532,7 @@ void HAssAnnounceRelayLight(void) char *color_temp_command_topic = stemp1; GetTopic_P(color_temp_command_topic, CMND, TasmotaGlobal.mqtt_topic, D_CMND_COLORTEMPERATURE); - TryResponseAppend_P(HASS_DISCOVER_LIGHT_CT, color_temp_command_topic, state_topic); + TryResponseAppend_P(HASS_DISCOVER_LIGHT_CT, color_temp_command_topic, state_topic, state_topic); ct_light = false; } if (LST_RGBW == Light.subtype && !PwmMulti && LightControl) {