mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-07 08:19:52 +03:00
esnure heating and tap water mqtt messages are sent immediately
This commit is contained in:
@@ -706,12 +706,12 @@ void publishEMSValues(bool force) {
|
||||
|
||||
// see if the heating or hot tap water has changed, if so send
|
||||
// last_boilerActive stores heating in bit 1 and tap water in bit 2
|
||||
if ((last_boilerActive != ((EMS_Boiler.tapwaterActive << 1) + EMS_Boiler.heatingActive)) || force) {
|
||||
if ((last_boilerActive != ((EMS_Boiler.tapwaterActive << 1) | EMS_Boiler.heatingActive)) || force) {
|
||||
myDebugLog("Publishing hot water and heating states via MQTT");
|
||||
myESP.mqttPublish(TOPIC_BOILER_TAPWATER_ACTIVE, EMS_Boiler.tapwaterActive == 1 ? "1" : "0");
|
||||
myESP.mqttPublish(TOPIC_BOILER_HEATING_ACTIVE, EMS_Boiler.heatingActive == 1 ? "1" : "0");
|
||||
|
||||
last_boilerActive = ((EMS_Boiler.tapwaterActive << 1) + EMS_Boiler.heatingActive); // remember last state
|
||||
last_boilerActive = ((EMS_Boiler.tapwaterActive << 1) | EMS_Boiler.heatingActive); // remember last state
|
||||
}
|
||||
|
||||
// handle the thermostat values
|
||||
@@ -2030,13 +2030,8 @@ void loop() {
|
||||
do_regularUpdates();
|
||||
publishEMSValues(true);
|
||||
publishSensorValues(true);
|
||||
_need_first_publish = false; // reset flag
|
||||
}
|
||||
|
||||
// publish all the values to MQTT
|
||||
// but only if the values have changed and publish_time is on automatic mode
|
||||
// always publish when we get the first results, regardless of any publish_time setting
|
||||
if (EMSESP_Settings.publish_time == 0) {
|
||||
_need_first_publish = false; // reset flag, so only do this once
|
||||
} else {
|
||||
publishEMSValues(false);
|
||||
publishSensorValues(false);
|
||||
}
|
||||
|
||||
@@ -1272,6 +1272,8 @@ void _checkActive() {
|
||||
if (EMS_Boiler.selFlowTemp != EMS_VALUE_INT_NOTSET && EMS_Boiler.burnGas != EMS_VALUE_INT_NOTSET) {
|
||||
EMS_Boiler.heatingActive = ((EMS_Boiler.selFlowTemp >= EMS_BOILER_SELFLOWTEMP_HEATING) && (EMS_Boiler.burnGas == EMS_VALUE_INT_ON));
|
||||
}
|
||||
|
||||
EMS_Sys_Status.emsRefreshed = true; // triggers a send the values back via MQTT
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user