mirror of
https://github.com/Laxilef/OTGateway.git
synced 2025-12-13 03:34:28 +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,6 +230,7 @@ protected:
|
|||||||
|
|
||||||
|
|
||||||
// Get heating min/max temp
|
// Get heating min/max temp
|
||||||
|
if (settings.opentherm.getMinMaxTemp) {
|
||||||
if (updateMinMaxHeatingTemp()) {
|
if (updateMinMaxHeatingTemp()) {
|
||||||
if (settings.heating.minTemp < vars.parameters.heatingMinTemp) {
|
if (settings.heating.minTemp < vars.parameters.heatingMinTemp) {
|
||||||
settings.heating.minTemp = vars.parameters.heatingMinTemp;
|
settings.heating.minTemp = vars.parameters.heatingMinTemp;
|
||||||
@@ -252,6 +253,7 @@ protected:
|
|||||||
settings.heating.maxTemp = 90;
|
settings.heating.maxTemp = 90;
|
||||||
fsSettings.update();
|
fsSettings.update();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Get outdoor temp (if necessary)
|
// Get outdoor temp (if necessary)
|
||||||
if (settings.sensors.outdoor.type == SensorType::BOILER) {
|
if (settings.sensors.outdoor.type == SensorType::BOILER) {
|
||||||
|
|||||||
@@ -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