feat: added OT option `Sync max heating temp with target temp`

This commit is contained in:
Yurii
2025-01-05 17:32:10 +03:00
parent 8662b9dc8f
commit 17bd31b2a2
7 changed files with 29 additions and 7 deletions

View File

@@ -1021,14 +1021,16 @@ protected:
if (this->needSetHeatingTemp(convertedTemp)) {
// Set max heating temp
if (this->setMaxHeatingTemp(convertedTemp)) {
Log.sinfoln(
FPSTR(L_OT_HEATING), F("Set max heating temp: %.2f (converted: %.2f)"),
vars.master.heating.setpointTemp, convertedTemp
);
if (settings.opentherm.options.maxTempSyncWithTargetTemp) {
if (this->setMaxHeatingTemp(convertedTemp)) {
Log.sinfoln(
FPSTR(L_OT_HEATING), F("Set max heating temp: %.2f (converted: %.2f)"),
vars.master.heating.setpointTemp, convertedTemp
);
} else {
Log.swarningln(FPSTR(L_OT_HEATING), F("Failed set max heating temp"));
} else {
Log.swarningln(FPSTR(L_OT_HEATING), F("Failed set max heating temp"));
}
}
// Set target heating temp

View File

@@ -67,6 +67,7 @@ struct Settings {
bool dhwToCh2 = false;
bool dhwBlocking = false;
bool modulationSyncWithHeating = false;
bool maxTempSyncWithTargetTemp = true;
bool getMinMaxTemp = true;
bool nativeHeatingControl = false;
bool immergasFix = false;

View File

@@ -118,6 +118,7 @@ const char S_MAX_FREE_BLOCK[] PROGMEM = "maxFreeBlock";
const char S_MAX_MODULATION[] PROGMEM = "maxModulation";
const char S_MAX_POWER[] PROGMEM = "maxPower";
const char S_MAX_TEMP[] PROGMEM = "maxTemp";
const char S_MAX_TEMP_SYNC_WITH_TARGET_TEMP[] PROGMEM = "maxTempSyncWithTargetTemp";
const char S_MEMBER_ID[] PROGMEM = "memberId";
const char S_MIN[] PROGMEM = "min";
const char S_MIN_FREE[] PROGMEM = "minFree";

View File

@@ -388,6 +388,7 @@ void settingsToJson(const Settings& src, JsonVariant dst, bool safe = false) {
otOptions[FPSTR(S_DHW_TO_CH2)] = src.opentherm.options.dhwToCh2;
otOptions[FPSTR(S_DHW_BLOCKING)] = src.opentherm.options.dhwBlocking;
otOptions[FPSTR(S_MODULATION_SYNC_WITH_HEATING)] = src.opentherm.options.modulationSyncWithHeating;
otOptions[FPSTR(S_MAX_TEMP_SYNC_WITH_TARGET_TEMP)] = src.opentherm.options.maxTempSyncWithTargetTemp;
otOptions[FPSTR(S_GET_MIN_MAX_TEMP)] = src.opentherm.options.getMinMaxTemp;
otOptions[FPSTR(S_NATIVE_HEATING_CONTROL)] = src.opentherm.options.nativeHeatingControl;
otOptions[FPSTR(S_IMMERGAS_FIX)] = src.opentherm.options.immergasFix;
@@ -821,6 +822,15 @@ bool jsonToSettings(const JsonVariantConst src, Settings& dst, bool safe = false
}
}
if (src[FPSTR(S_OPENTHERM)][FPSTR(S_OPTIONS)][FPSTR(S_MAX_TEMP_SYNC_WITH_TARGET_TEMP)].is<bool>()) {
bool value = src[FPSTR(S_OPENTHERM)][FPSTR(S_OPTIONS)][FPSTR(S_MAX_TEMP_SYNC_WITH_TARGET_TEMP)].as<bool>();
if (value != dst.opentherm.options.maxTempSyncWithTargetTemp) {
dst.opentherm.options.maxTempSyncWithTargetTemp = value;
changed = true;
}
}
if (src[FPSTR(S_OPENTHERM)][FPSTR(S_OPTIONS)][FPSTR(S_GET_MIN_MAX_TEMP)].is<bool>()) {
bool value = src[FPSTR(S_OPENTHERM)][FPSTR(S_OPTIONS)][FPSTR(S_GET_MIN_MAX_TEMP)].as<bool>();