mirror of
https://github.com/Laxilef/OTGateway.git
synced 2025-12-12 11:14:28 +05:00
feat: added OT option alwaysSetIndoorTemp #180
This commit is contained in:
@@ -1209,8 +1209,8 @@ protected:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Native heating control
|
// Set indoor temp for Native heating control/Always set indoor temp
|
||||||
if (settings.opentherm.options.nativeHeatingControl) {
|
if (settings.opentherm.options.nativeHeatingControl || settings.opentherm.options.alwaysSetIndoorTemp) {
|
||||||
// Converted current indoor temp
|
// Converted current indoor temp
|
||||||
float convertedTemp = convertTemp(vars.master.heating.indoorTemp, settings.system.unitSystem, settings.opentherm.unitSystem);
|
float convertedTemp = convertTemp(vars.master.heating.indoorTemp, settings.system.unitSystem, settings.opentherm.unitSystem);
|
||||||
|
|
||||||
@@ -1237,10 +1237,13 @@ protected:
|
|||||||
Log.swarningln(FPSTR(L_OT_HEATING), F("Failed set current CH2 indoor temp"));
|
Log.swarningln(FPSTR(L_OT_HEATING), F("Failed set current CH2 indoor temp"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Native heating control
|
||||||
|
if (settings.opentherm.options.nativeHeatingControl) {
|
||||||
// Converted target indoor temp
|
// Converted target indoor temp
|
||||||
convertedTemp = convertTemp(vars.master.heating.targetTemp, settings.system.unitSystem, settings.opentherm.unitSystem);
|
float convertedTemp = convertTemp(vars.master.heating.targetTemp, settings.system.unitSystem, settings.opentherm.unitSystem);
|
||||||
|
|
||||||
// Set target indoor temp
|
// Set target indoor temp
|
||||||
if (this->needSetHeatingTemp(convertedTemp)) {
|
if (this->needSetHeatingTemp(convertedTemp)) {
|
||||||
|
|||||||
@@ -78,6 +78,7 @@ struct Settings {
|
|||||||
bool autoFaultReset = false;
|
bool autoFaultReset = false;
|
||||||
bool autoDiagReset = false;
|
bool autoDiagReset = false;
|
||||||
bool setDateAndTime = false;
|
bool setDateAndTime = false;
|
||||||
|
bool alwaysSetIndoorTemp = true;
|
||||||
bool nativeHeatingControl = false;
|
bool nativeHeatingControl = false;
|
||||||
bool immergasFix = false;
|
bool immergasFix = false;
|
||||||
} options;
|
} options;
|
||||||
|
|||||||
@@ -38,6 +38,7 @@ const char S_ACTION[] PROGMEM = "action";
|
|||||||
const char S_ACTIONS[] PROGMEM = "actions";
|
const char S_ACTIONS[] PROGMEM = "actions";
|
||||||
const char S_ACTIVE[] PROGMEM = "active";
|
const char S_ACTIVE[] PROGMEM = "active";
|
||||||
const char S_ADDRESS[] PROGMEM = "address";
|
const char S_ADDRESS[] PROGMEM = "address";
|
||||||
|
const char S_ALWAYS_SET_INDOOR_TEMP[] PROGMEM = "alwaysSetIndoorTemp";
|
||||||
const char S_ANTI_STUCK_INTERVAL[] PROGMEM = "antiStuckInterval";
|
const char S_ANTI_STUCK_INTERVAL[] PROGMEM = "antiStuckInterval";
|
||||||
const char S_ANTI_STUCK_TIME[] PROGMEM = "antiStuckTime";
|
const char S_ANTI_STUCK_TIME[] PROGMEM = "antiStuckTime";
|
||||||
const char S_AP[] PROGMEM = "ap";
|
const char S_AP[] PROGMEM = "ap";
|
||||||
|
|||||||
10
src/utils.h
10
src/utils.h
@@ -468,6 +468,7 @@ void settingsToJson(const Settings& src, JsonVariant dst, bool safe = false) {
|
|||||||
otOptions[FPSTR(S_AUTO_FAULT_RESET)] = src.opentherm.options.autoFaultReset;
|
otOptions[FPSTR(S_AUTO_FAULT_RESET)] = src.opentherm.options.autoFaultReset;
|
||||||
otOptions[FPSTR(S_AUTO_DIAG_RESET)] = src.opentherm.options.autoDiagReset;
|
otOptions[FPSTR(S_AUTO_DIAG_RESET)] = src.opentherm.options.autoDiagReset;
|
||||||
otOptions[FPSTR(S_SET_DATE_AND_TIME)] = src.opentherm.options.setDateAndTime;
|
otOptions[FPSTR(S_SET_DATE_AND_TIME)] = src.opentherm.options.setDateAndTime;
|
||||||
|
otOptions[FPSTR(S_ALWAYS_SET_INDOOR_TEMP)] = src.opentherm.options.alwaysSetIndoorTemp;
|
||||||
otOptions[FPSTR(S_NATIVE_HEATING_CONTROL)] = src.opentherm.options.nativeHeatingControl;
|
otOptions[FPSTR(S_NATIVE_HEATING_CONTROL)] = src.opentherm.options.nativeHeatingControl;
|
||||||
otOptions[FPSTR(S_IMMERGAS_FIX)] = src.opentherm.options.immergasFix;
|
otOptions[FPSTR(S_IMMERGAS_FIX)] = src.opentherm.options.immergasFix;
|
||||||
|
|
||||||
@@ -1003,6 +1004,15 @@ bool jsonToSettings(const JsonVariantConst src, Settings& dst, bool safe = false
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (src[FPSTR(S_OPENTHERM)][FPSTR(S_OPTIONS)][FPSTR(S_ALWAYS_SET_INDOOR_TEMP)].is<bool>()) {
|
||||||
|
bool value = src[FPSTR(S_OPENTHERM)][FPSTR(S_OPTIONS)][FPSTR(S_ALWAYS_SET_INDOOR_TEMP)].as<bool>();
|
||||||
|
|
||||||
|
if (value != dst.opentherm.options.alwaysSetIndoorTemp) {
|
||||||
|
dst.opentherm.options.alwaysSetIndoorTemp = value;
|
||||||
|
changed = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (src[FPSTR(S_OPENTHERM)][FPSTR(S_OPTIONS)][FPSTR(S_NATIVE_HEATING_CONTROL)].is<bool>()) {
|
if (src[FPSTR(S_OPENTHERM)][FPSTR(S_OPTIONS)][FPSTR(S_NATIVE_HEATING_CONTROL)].is<bool>()) {
|
||||||
bool value = src[FPSTR(S_OPENTHERM)][FPSTR(S_OPTIONS)][FPSTR(S_NATIVE_HEATING_CONTROL)].as<bool>();
|
bool value = src[FPSTR(S_OPENTHERM)][FPSTR(S_OPTIONS)][FPSTR(S_NATIVE_HEATING_CONTROL)].as<bool>();
|
||||||
|
|
||||||
|
|||||||
@@ -457,6 +457,7 @@
|
|||||||
"autoFaultReset": "Auto fault reset <small>(not recommended!)</small>",
|
"autoFaultReset": "Auto fault reset <small>(not recommended!)</small>",
|
||||||
"autoDiagReset": "Auto diag reset <small>(not recommended!)</small>",
|
"autoDiagReset": "Auto diag reset <small>(not recommended!)</small>",
|
||||||
"setDateAndTime": "Set date & time on boiler",
|
"setDateAndTime": "Set date & time on boiler",
|
||||||
|
"alwaysSetIndoorTemp": "Always set indoor temperature",
|
||||||
"immergasFix": "Fix for Immergas boilers"
|
"immergasFix": "Fix for Immergas boilers"
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
@@ -687,6 +687,11 @@
|
|||||||
<span data-i18n>settings.ot.options.setDateAndTime</span>
|
<span data-i18n>settings.ot.options.setDateAndTime</span>
|
||||||
</label>
|
</label>
|
||||||
|
|
||||||
|
<label>
|
||||||
|
<input type="checkbox" name="opentherm[options][alwaysSetIndoorTemp]" value="true">
|
||||||
|
<span data-i18n>settings.ot.options.alwaysSetIndoorTemp</span>
|
||||||
|
</label>
|
||||||
|
|
||||||
<label>
|
<label>
|
||||||
<input type="checkbox" name="opentherm[options][immergasFix]" value="true">
|
<input type="checkbox" name="opentherm[options][immergasFix]" value="true">
|
||||||
<span data-i18n>settings.ot.options.immergasFix</span>
|
<span data-i18n>settings.ot.options.immergasFix</span>
|
||||||
@@ -1117,6 +1122,7 @@
|
|||||||
setCheckboxValue("[name='opentherm[options][autoFaultReset]']", data.opentherm.options.autoFaultReset);
|
setCheckboxValue("[name='opentherm[options][autoFaultReset]']", data.opentherm.options.autoFaultReset);
|
||||||
setCheckboxValue("[name='opentherm[options][autoDiagReset]']", data.opentherm.options.autoDiagReset);
|
setCheckboxValue("[name='opentherm[options][autoDiagReset]']", data.opentherm.options.autoDiagReset);
|
||||||
setCheckboxValue("[name='opentherm[options][setDateAndTime]']", data.opentherm.options.setDateAndTime);
|
setCheckboxValue("[name='opentherm[options][setDateAndTime]']", data.opentherm.options.setDateAndTime);
|
||||||
|
setCheckboxValue("[name='opentherm[options][alwaysSetIndoorTemp]']", data.opentherm.options.alwaysSetIndoorTemp);
|
||||||
setCheckboxValue("[name='opentherm[options][nativeHeatingControl]']", data.opentherm.options.nativeHeatingControl);
|
setCheckboxValue("[name='opentherm[options][nativeHeatingControl]']", data.opentherm.options.nativeHeatingControl);
|
||||||
setCheckboxValue("[name='opentherm[options][immergasFix]']", data.opentherm.options.immergasFix);
|
setCheckboxValue("[name='opentherm[options][immergasFix]']", data.opentherm.options.immergasFix);
|
||||||
setBusy('#ot-settings-busy', '#ot-settings', false);
|
setBusy('#ot-settings-busy', '#ot-settings', false);
|
||||||
|
|||||||
Reference in New Issue
Block a user