Merge pull request #12314 from yury-sannikov/ot_force_tset

OpenTherm: Send boiler temperature setpoint when Central Heating flag is set.
This commit is contained in:
Theo Arends 2021-06-07 19:20:33 +02:00 committed by GitHub
commit 48ade67215
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 17 additions and 4 deletions

View File

@ -108,6 +108,9 @@ typedef struct OT_BOILER_STATUS_T
// Boiler desired values // Boiler desired values
float m_boilerSetpoint; float m_boilerSetpoint;
float m_hotWaterSetpoint; 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; } OT_BOILER_STATUS;
@ -595,6 +598,9 @@ bool Xsns69(uint8_t function)
case FUNC_JSON_APPEND: case FUNC_JSON_APPEND:
sns_opentherm_stat(1); sns_opentherm_stat(1);
break; break;
case FUNC_SAVE_AT_MIDNIGHT:
sns_opentherm_protocol_reset();
break;
#ifdef USE_WEBSERVER #ifdef USE_WEBSERVER
case FUNC_WEB_SENSOR: case FUNC_WEB_SENSOR:
sns_opentherm_stat(0); sns_opentherm_stat(0);

View File

@ -258,7 +258,11 @@ unsigned long sns_opentherm_set_slave_flags(struct OpenThermCommandT *self, stru
AddLog(LOG_LEVEL_INFO, AddLog(LOG_LEVEL_INFO,
PSTR("[OTH]: Central Heating transitioning from %s to %s"), PSTR("[OTH]: Central Heating transitioning from %s to %s"),
self->m_results[1].m_bool ? "on" : "off", 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; 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. // wearing out Boiler flash memory.
float diff = abs(status->m_boilerSetpoint - self->m_results[0].m_float); float diff = abs(status->m_boilerSetpoint - self->m_results[0].m_float);
// Ignore small changes in the boiler setpoint temperature // 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; return -1;
} }
AddLog(LOG_LEVEL_INFO, 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)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; self->m_results[0].m_float = status->m_boilerSetpoint;
unsigned int data = OpenTherm::temperatureToData(status->m_boilerSetpoint); unsigned int data = OpenTherm::temperatureToData(status->m_boilerSetpoint);