mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-07 08:19:52 +03:00
fix for HC MQTT
This commit is contained in:
@@ -665,19 +665,18 @@ void publishValues(bool force) {
|
|||||||
last_boilerActive = ((EMS_Boiler.tapwaterActive << 1) + EMS_Boiler.heatingActive); // remember last state
|
last_boilerActive = ((EMS_Boiler.tapwaterActive << 1) + EMS_Boiler.heatingActive); // remember last state
|
||||||
}
|
}
|
||||||
|
|
||||||
doc.clear();
|
|
||||||
// handle the thermostat values
|
// handle the thermostat values
|
||||||
if (ems_getThermostatEnabled()) {
|
if (ems_getThermostatEnabled()) {
|
||||||
|
doc.clear();
|
||||||
|
JsonObject rootThermostat = doc.to<JsonObject>();
|
||||||
|
|
||||||
for (uint8_t hc_v = 1; hc_v <= EMS_THERMOSTAT_MAXHC; hc_v++) {
|
for (uint8_t hc_v = 1; hc_v <= EMS_THERMOSTAT_MAXHC; hc_v++) {
|
||||||
_EMS_Thermostat_HC * thermostat = &EMS_Thermostat.hc[hc_v - 1];
|
_EMS_Thermostat_HC * thermostat = &EMS_Thermostat.hc[hc_v - 1];
|
||||||
|
|
||||||
// only send if we have an active Heating Circuit with real data
|
// only send if we have an active Heating Circuit with real data
|
||||||
if (thermostat->active) {
|
if (thermostat->active) {
|
||||||
// build new json object
|
// build new json object
|
||||||
JsonObject rootThermostat = doc.to<JsonObject>();
|
char hc[10]; // hc{1-4}
|
||||||
|
|
||||||
// hc{1-4}
|
|
||||||
char hc[10];
|
|
||||||
strlcpy(hc, THERMOSTAT_HC, sizeof(hc));
|
strlcpy(hc, THERMOSTAT_HC, sizeof(hc));
|
||||||
strlcat(hc, _int_to_char(s, thermostat->hc), sizeof(hc));
|
strlcat(hc, _int_to_char(s, thermostat->hc), sizeof(hc));
|
||||||
JsonObject dataThermostat = rootThermostat.createNestedObject(hc);
|
JsonObject dataThermostat = rootThermostat.createNestedObject(hc);
|
||||||
|
|||||||
Reference in New Issue
Block a user