mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-07 16:29:51 +03:00
optimize mqtt not to send unknown values
This commit is contained in:
@@ -612,13 +612,26 @@ void publishValues(bool force) {
|
|||||||
if (abs(EMS_Boiler.boilTemp) < EMS_VALUE_SHORT_NOTSET)
|
if (abs(EMS_Boiler.boilTemp) < EMS_VALUE_SHORT_NOTSET)
|
||||||
rootBoiler["boilTemp"] = (double)EMS_Boiler.boilTemp / 10;
|
rootBoiler["boilTemp"] = (double)EMS_Boiler.boilTemp / 10;
|
||||||
|
|
||||||
rootBoiler["wWActivated"] = _bool_to_char(s, EMS_Boiler.wWActivated);
|
if (EMS_Boiler.wWActivated != EMS_VALUE_INT_NOTSET)
|
||||||
rootBoiler["burnGas"] = _bool_to_char(s, EMS_Boiler.burnGas);
|
rootBoiler["wWActivated"] = _bool_to_char(s, EMS_Boiler.wWActivated);
|
||||||
rootBoiler["heatPmp"] = _bool_to_char(s, EMS_Boiler.heatPmp);
|
|
||||||
rootBoiler["fanWork"] = _bool_to_char(s, EMS_Boiler.fanWork);
|
if (EMS_Boiler.burnGas != EMS_VALUE_INT_NOTSET)
|
||||||
rootBoiler["ignWork"] = _bool_to_char(s, EMS_Boiler.ignWork);
|
rootBoiler["burnGas"] = _bool_to_char(s, EMS_Boiler.burnGas);
|
||||||
rootBoiler["wWCirc"] = _bool_to_char(s, EMS_Boiler.wWCirc);
|
|
||||||
rootBoiler["wWHeat"] = _bool_to_char(s, EMS_Boiler.wWHeat);
|
if (EMS_Boiler.heatPmp != EMS_VALUE_INT_NOTSET)
|
||||||
|
rootBoiler["heatPmp"] = _bool_to_char(s, EMS_Boiler.heatPmp);
|
||||||
|
|
||||||
|
if (EMS_Boiler.fanWork != EMS_VALUE_INT_NOTSET)
|
||||||
|
rootBoiler["fanWork"] = _bool_to_char(s, EMS_Boiler.fanWork);
|
||||||
|
|
||||||
|
if (EMS_Boiler.ignWork != EMS_VALUE_INT_NOTSET)
|
||||||
|
rootBoiler["ignWork"] = _bool_to_char(s, EMS_Boiler.ignWork);
|
||||||
|
|
||||||
|
if (EMS_Boiler.wWCirc != EMS_VALUE_INT_NOTSET)
|
||||||
|
rootBoiler["wWCirc"] = _bool_to_char(s, EMS_Boiler.wWCirc);
|
||||||
|
|
||||||
|
if (EMS_Boiler.wWHeat != EMS_VALUE_INT_NOTSET)
|
||||||
|
rootBoiler["wWHeat"] = _bool_to_char(s, EMS_Boiler.wWHeat);
|
||||||
|
|
||||||
rootBoiler["ServiceCode"] = EMS_Boiler.serviceCodeChar;
|
rootBoiler["ServiceCode"] = EMS_Boiler.serviceCodeChar;
|
||||||
rootBoiler["ServiceCodeNumber"] = EMS_Boiler.serviceCode;
|
rootBoiler["ServiceCodeNumber"] = EMS_Boiler.serviceCode;
|
||||||
@@ -681,6 +694,7 @@ void publishValues(bool force) {
|
|||||||
|
|
||||||
if (EMS_Thermostat.heatingtype != EMS_VALUE_INT_NOTSET)
|
if (EMS_Thermostat.heatingtype != EMS_VALUE_INT_NOTSET)
|
||||||
rootThermostat[THERMOSTAT_HEATINGTYPE] = EMS_Thermostat.heatingtype;
|
rootThermostat[THERMOSTAT_HEATINGTYPE] = EMS_Thermostat.heatingtype;
|
||||||
|
|
||||||
if (EMS_Thermostat.circuitcalctemp != EMS_VALUE_INT_NOTSET)
|
if (EMS_Thermostat.circuitcalctemp != EMS_VALUE_INT_NOTSET)
|
||||||
rootThermostat[THERMOSTAT_CIRCUITCALCTEMP] = EMS_Thermostat.circuitcalctemp;
|
rootThermostat[THERMOSTAT_CIRCUITCALCTEMP] = EMS_Thermostat.circuitcalctemp;
|
||||||
}
|
}
|
||||||
@@ -1545,7 +1559,7 @@ void initEMSESP() {
|
|||||||
EMSESP_Status.dallas_sensors = 0;
|
EMSESP_Status.dallas_sensors = 0;
|
||||||
EMSESP_Status.led_gpio = EMSESP_LED_GPIO;
|
EMSESP_Status.led_gpio = EMSESP_LED_GPIO;
|
||||||
EMSESP_Status.dallas_gpio = EMSESP_DALLAS_GPIO;
|
EMSESP_Status.dallas_gpio = EMSESP_DALLAS_GPIO;
|
||||||
EMSESP_Status.heating_circuit = 1; // default heating circuit
|
EMSESP_Status.heating_circuit = 1; // default heating circuit to HC1
|
||||||
|
|
||||||
// shower settings
|
// shower settings
|
||||||
EMSESP_Shower.timerStart = 0;
|
EMSESP_Shower.timerStart = 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user