mirror of
https://github.com/Laxilef/OTGateway.git
synced 2025-12-11 10:44:29 +05:00
feat: added setting to enable/disable polling of min and max temperatures via opentherm
This commit is contained in:
@@ -107,6 +107,10 @@
|
|||||||
<input type="checkbox" class="opentherm-sync-modulation-with-heating" name="opentherm[modulationSyncWithHeating]" value="true">
|
<input type="checkbox" class="opentherm-sync-modulation-with-heating" name="opentherm[modulationSyncWithHeating]" value="true">
|
||||||
Sync modulation with heating
|
Sync modulation with heating
|
||||||
</label>
|
</label>
|
||||||
|
<label for="opentherm-get-min-max-temp">
|
||||||
|
<input type="checkbox" class="opentherm-get-min-max-temp" name="opentherm[getMinMaxTemp]" value="true">
|
||||||
|
Get min/max temp from boiler
|
||||||
|
</label>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
|
|
||||||
<button type="submit">Save</button>
|
<button type="submit">Save</button>
|
||||||
|
|||||||
@@ -203,7 +203,7 @@ protected:
|
|||||||
|
|
||||||
|
|
||||||
// Get DHW min/max temp (if necessary)
|
// Get DHW min/max temp (if necessary)
|
||||||
if (settings.opentherm.dhwPresent) {
|
if (settings.opentherm.dhwPresent && settings.opentherm.getMinMaxTemp) {
|
||||||
if (updateMinMaxDhwTemp()) {
|
if (updateMinMaxDhwTemp()) {
|
||||||
if (settings.dhw.minTemp < vars.parameters.dhwMinTemp) {
|
if (settings.dhw.minTemp < vars.parameters.dhwMinTemp) {
|
||||||
settings.dhw.minTemp = vars.parameters.dhwMinTemp;
|
settings.dhw.minTemp = vars.parameters.dhwMinTemp;
|
||||||
@@ -230,27 +230,29 @@ protected:
|
|||||||
|
|
||||||
|
|
||||||
// Get heating min/max temp
|
// Get heating min/max temp
|
||||||
if (updateMinMaxHeatingTemp()) {
|
if (settings.opentherm.getMinMaxTemp) {
|
||||||
if (settings.heating.minTemp < vars.parameters.heatingMinTemp) {
|
if (updateMinMaxHeatingTemp()) {
|
||||||
settings.heating.minTemp = vars.parameters.heatingMinTemp;
|
if (settings.heating.minTemp < vars.parameters.heatingMinTemp) {
|
||||||
fsSettings.update();
|
settings.heating.minTemp = vars.parameters.heatingMinTemp;
|
||||||
Log.snoticeln(FPSTR(L_OT_HEATING), F("Updated min temp: %hhu"), settings.heating.minTemp);
|
fsSettings.update();
|
||||||
|
Log.snoticeln(FPSTR(L_OT_HEATING), F("Updated min temp: %hhu"), settings.heating.minTemp);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (settings.heating.maxTemp > vars.parameters.heatingMaxTemp) {
|
||||||
|
settings.heating.maxTemp = vars.parameters.heatingMaxTemp;
|
||||||
|
fsSettings.update();
|
||||||
|
Log.snoticeln(FPSTR(L_OT_HEATING), F("Updated max temp: %hhu"), settings.heating.maxTemp);
|
||||||
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
Log.swarningln(FPSTR(L_OT_HEATING), F("Failed get min/max temp"));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (settings.heating.maxTemp > vars.parameters.heatingMaxTemp) {
|
if (settings.heating.minTemp >= settings.heating.maxTemp) {
|
||||||
settings.heating.maxTemp = vars.parameters.heatingMaxTemp;
|
settings.heating.minTemp = 20;
|
||||||
|
settings.heating.maxTemp = 90;
|
||||||
fsSettings.update();
|
fsSettings.update();
|
||||||
Log.snoticeln(FPSTR(L_OT_HEATING), F("Updated max temp: %hhu"), settings.heating.maxTemp);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
|
||||||
Log.swarningln(FPSTR(L_OT_HEATING), F("Failed get min/max temp"));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (settings.heating.minTemp >= settings.heating.maxTemp) {
|
|
||||||
settings.heating.minTemp = 20;
|
|
||||||
settings.heating.maxTemp = 90;
|
|
||||||
fsSettings.update();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get outdoor temp (if necessary)
|
// Get outdoor temp (if necessary)
|
||||||
|
|||||||
@@ -46,6 +46,7 @@ struct Settings {
|
|||||||
bool dhwToCh2 = false;
|
bool dhwToCh2 = false;
|
||||||
bool dhwBlocking = false;
|
bool dhwBlocking = false;
|
||||||
bool modulationSyncWithHeating = false;
|
bool modulationSyncWithHeating = false;
|
||||||
|
bool getMinMaxTemp = true;
|
||||||
} opentherm;
|
} opentherm;
|
||||||
|
|
||||||
struct {
|
struct {
|
||||||
|
|||||||
@@ -283,6 +283,7 @@ void settingsToJson(const Settings& src, JsonVariant dst, bool safe = false) {
|
|||||||
dst["opentherm"]["dhwToCh2"] = src.opentherm.dhwToCh2;
|
dst["opentherm"]["dhwToCh2"] = src.opentherm.dhwToCh2;
|
||||||
dst["opentherm"]["dhwBlocking"] = src.opentherm.dhwBlocking;
|
dst["opentherm"]["dhwBlocking"] = src.opentherm.dhwBlocking;
|
||||||
dst["opentherm"]["modulationSyncWithHeating"] = src.opentherm.modulationSyncWithHeating;
|
dst["opentherm"]["modulationSyncWithHeating"] = src.opentherm.modulationSyncWithHeating;
|
||||||
|
dst["opentherm"]["getMinMaxTemp"] = src.opentherm.getMinMaxTemp;
|
||||||
|
|
||||||
dst["mqtt"]["server"] = src.mqtt.server;
|
dst["mqtt"]["server"] = src.mqtt.server;
|
||||||
dst["mqtt"]["port"] = src.mqtt.port;
|
dst["mqtt"]["port"] = src.mqtt.port;
|
||||||
@@ -500,6 +501,11 @@ bool jsonToSettings(const JsonVariantConst src, Settings& dst, bool safe = false
|
|||||||
changed = true;
|
changed = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (src["opentherm"]["getMinMaxTemp"].is<bool>()) {
|
||||||
|
dst.opentherm.getMinMaxTemp = src["opentherm"]["getMinMaxTemp"].as<bool>();
|
||||||
|
changed = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// mqtt
|
// mqtt
|
||||||
if (!src["mqtt"]["server"].isNull()) {
|
if (!src["mqtt"]["server"].isNull()) {
|
||||||
|
|||||||
@@ -501,6 +501,7 @@ async function loadSettings() {
|
|||||||
setCheckboxValue('.opentherm-dhw-to-ch2', result.opentherm.dhwToCh2);
|
setCheckboxValue('.opentherm-dhw-to-ch2', result.opentherm.dhwToCh2);
|
||||||
setCheckboxValue('.opentherm-dhw-blocking', result.opentherm.dhwBlocking);
|
setCheckboxValue('.opentherm-dhw-blocking', result.opentherm.dhwBlocking);
|
||||||
setCheckboxValue('.opentherm-sync-modulation-with-heating', result.opentherm.modulationSyncWithHeating);
|
setCheckboxValue('.opentherm-sync-modulation-with-heating', result.opentherm.modulationSyncWithHeating);
|
||||||
|
setCheckboxValue('.opentherm-get-min-max-temp', result.opentherm.getMinMaxTemp);
|
||||||
setBusy('#opentherm-settings-busy', '#opentherm-settings', false);
|
setBusy('#opentherm-settings-busy', '#opentherm-settings', false);
|
||||||
|
|
||||||
setInputValue('.mqtt-server', result.mqtt.server);
|
setInputValue('.mqtt-server', result.mqtt.server);
|
||||||
|
|||||||
Reference in New Issue
Block a user