From 9b16354c8af148495c7208858efde23e50689b1f Mon Sep 17 00:00:00 2001 From: Paul Date: Fri, 27 Sep 2019 19:58:20 +0200 Subject: [PATCH] always send thermostat MQTT even if there is not current temp detected --- src/ems-esp.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/ems-esp.cpp b/src/ems-esp.cpp index 4aba6d393..266ca51ef 100644 --- a/src/ems-esp.cpp +++ b/src/ems-esp.cpp @@ -846,13 +846,13 @@ void publishValues(bool force) { // handle the thermostat values if (ems_getThermostatEnabled()) { - uint8_t total_active_hc = 0; // number of HCs - bool hc_1_active = EMS_Thermostat.hc[0].active; // do we have HC1 active? + uint8_t total_active_hc = 0; // number of HCs + bool hc_1_active = EMS_Thermostat.hc[EMS_THERMOSTAT_DEFAULTHC - 1].active; // do we have HC1 active? for (uint8_t hc_v = 1; hc_v <= EMS_THERMOSTAT_MAXHC; hc_v++) { _EMS_Thermostat_HC * thermostat = &EMS_Thermostat.hc[hc_v - 1]; // only send if we have an active Heating Circuit with real data - if ((thermostat->active) && (thermostat->curr_roomTemp != EMS_VALUE_SHORT_NOTSET) && (thermostat->setpoint_roomTemp != EMS_VALUE_SHORT_NOTSET)) { + if (thermostat->active) { total_active_hc++; // increase count for #HCs we encounter // build new json object