fix ha mode, boolean to match setting bool format

This commit is contained in:
proddy
2026-01-09 18:47:14 +01:00
parent 3218620a0e
commit 0efbd0528e

View File

@@ -1425,10 +1425,12 @@ bool Mqtt::publish_ha_climate_config(const DeviceValue & dv, const bool has_room
// 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%}";
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;