From 0efbd0528e29d5c0079c91796d4610f5bb9a6156 Mon Sep 17 00:00:00 2001 From: proddy Date: Fri, 9 Jan 2026 18:47:14 +0100 Subject: [PATCH] fix ha mode, boolean to match setting bool format --- src/core/mqtt.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/core/mqtt.cpp b/src/core/mqtt.cpp index 03d9b2eb5..70eaa58a5 100644 --- a/src/core/mqtt.cpp +++ b/src/core/mqtt.cpp @@ -1424,11 +1424,13 @@ bool Mqtt::publish_ha_climate_config(const DeviceValue & dv, const bool has_room doc["mode_cmd_t"] = mode_cmd_s; // add hvac_action - https://github.com/emsesp/EMS-ESP32/discussions/2562 - doc["act_t"] = "~/boiler_data"; - doc["act_tpl"] = "{% if value_json.hpactivity=='cooling'%}cooling{%elif value_json.heatingactive=='on'%}heating{%else%}idle{%endif%}"; + doc["act_t"] = "~/boiler_data"; + char on_string[12]; + doc["act_tpl"] = "{% if value_json.hpactivity=='cooling'%}cooling{%elif value_json.heatingactive=='" + std::string(Helpers::render_boolean(on_string, true)) + + "'%}heating{%else%}idle{%endif%}"; // uses boolean translation for on/true // map EMS modes to HA climate modes - // EMS modes: auto, manual, heat, off, night, day, nofrost, eco, comfort, cool) + // EMS modes: auto, manual, heat, off, night, day, nofrost, eco, comfort, cool // HA supports: auto, off, cool, heat, dry, fan_only bool found_auto = false; bool found_heat = false;