diff --git a/tasmota/xsns_69_opentherm.ino b/tasmota/xsns_69_opentherm.ino index 705a76395..d4f9624c0 100644 --- a/tasmota/xsns_69_opentherm.ino +++ b/tasmota/xsns_69_opentherm.ino @@ -108,6 +108,9 @@ typedef struct OT_BOILER_STATUS_T // Boiler desired values float m_boilerSetpoint; float m_hotWaterSetpoint; + // This flag is set when Master require a CH to be on + // and forces the OpenThermMessageID::TSet to be sent to the boiler + bool m_forceSetpointSet; } OT_BOILER_STATUS; @@ -595,6 +598,9 @@ bool Xsns69(uint8_t function) case FUNC_JSON_APPEND: sns_opentherm_stat(1); break; + case FUNC_SAVE_AT_MIDNIGHT: + sns_opentherm_protocol_reset(); + break; #ifdef USE_WEBSERVER case FUNC_WEB_SENSOR: sns_opentherm_stat(0); diff --git a/tasmota/xsns_69_opentherm_protocol.ino b/tasmota/xsns_69_opentherm_protocol.ino index 780cbba58..7c6a3a521 100644 --- a/tasmota/xsns_69_opentherm_protocol.ino +++ b/tasmota/xsns_69_opentherm_protocol.ino @@ -258,7 +258,11 @@ unsigned long sns_opentherm_set_slave_flags(struct OpenThermCommandT *self, stru AddLog(LOG_LEVEL_INFO, PSTR("[OTH]: Central Heating transitioning from %s to %s"), self->m_results[1].m_bool ? "on" : "off", - status->m_enableCentralHeating ? "on" : "off"); + centralHeatingIsOn ? "on" : "off"); + + if (centralHeatingIsOn) { + status->m_forceSetpointSet = true; + } } self->m_results[1].m_bool = centralHeatingIsOn; @@ -302,14 +306,17 @@ unsigned long sns_opentherm_set_boiler_temperature(struct OpenThermCommandT *sel // wearing out Boiler flash memory. float diff = abs(status->m_boilerSetpoint - self->m_results[0].m_float); // Ignore small changes in the boiler setpoint temperature - if (diff < OPENTHERM_BOILER_SETPOINT_TOLERANCE) + if (diff < OPENTHERM_BOILER_SETPOINT_TOLERANCE && !status->m_forceSetpointSet) { return -1; } AddLog(LOG_LEVEL_INFO, - PSTR("[OTH]: Setting Boiler Temp. Old: %d, New: %d"), + PSTR("[OTH]: Setting Boiler Temp. Old: %d, New: %d, Force: %s"), (int)self->m_results[0].m_float, - (int)status->m_boilerSetpoint); + (int)status->m_boilerSetpoint, + status->m_forceSetpointSet ? "Y" : "N"); + + status->m_forceSetpointSet = false; self->m_results[0].m_float = status->m_boilerSetpoint; unsigned int data = OpenTherm::temperatureToData(status->m_boilerSetpoint);