From 02e519a7dd56fc7543a3a441dd0a9288a8cffdd6 Mon Sep 17 00:00:00 2001 From: Bernd Schorgers Date: Thu, 8 Feb 2024 09:35:33 +0100 Subject: [PATCH] fix: Enable state_value_template in discovery --- software/NRG_itho_wifi/main/tasks/task_mqtt.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/software/NRG_itho_wifi/main/tasks/task_mqtt.cpp b/software/NRG_itho_wifi/main/tasks/task_mqtt.cpp index a81518d7..539f2e2f 100644 --- a/software/NRG_itho_wifi/main/tasks/task_mqtt.cpp +++ b/software/NRG_itho_wifi/main/tasks/task_mqtt.cpp @@ -581,8 +581,8 @@ void HADiscoveryFan() snprintf(s, sizeof(s), "%s_fan", hostName()); root["uniq_id"] = s; root["name"] = "fan"; - // root["stat_t"] = static_cast(statetopic); - // root["stat_val_tpl"] = "{% if value == '0' %}OFF{% else %}ON{% endif %}"; + root["stat_t"] = static_cast(statetopic); + root["stat_val_tpl"] = "{% if value == '0' %}OFF{% else %}ON{% endif %}"; root["json_attr_t"] = static_cast(ihtostatustopic); snprintf(s, sizeof(s), "%s/not_used/but_needed_for_HA", static_cast(cmdtopic)); root["cmd_t"] = s;