mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-08 00:39:50 +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
|
// 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
|
// 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");
|
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_TAPWATER_ACTIVE, EMS_Boiler.tapwaterActive == 1 ? "1" : "0");
|
||||||
myESP.mqttPublish(TOPIC_BOILER_HEATING_ACTIVE, EMS_Boiler.heatingActive == 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
|
// handle the thermostat values
|
||||||
@@ -2030,13 +2030,8 @@ void loop() {
|
|||||||
do_regularUpdates();
|
do_regularUpdates();
|
||||||
publishEMSValues(true);
|
publishEMSValues(true);
|
||||||
publishSensorValues(true);
|
publishSensorValues(true);
|
||||||
_need_first_publish = false; // reset flag
|
_need_first_publish = false; // reset flag, so only do this once
|
||||||
}
|
} else {
|
||||||
|
|
||||||
// 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) {
|
|
||||||
publishEMSValues(false);
|
publishEMSValues(false);
|
||||||
publishSensorValues(false);
|
publishSensorValues(false);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1272,6 +1272,8 @@ void _checkActive() {
|
|||||||
if (EMS_Boiler.selFlowTemp != EMS_VALUE_INT_NOTSET && EMS_Boiler.burnGas != EMS_VALUE_INT_NOTSET) {
|
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_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