Skip to content

Commit

Permalink
fix: hysteresis with native heating control has been fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
Laxilef committed Nov 1, 2024
1 parent 467cfea commit e4211c8
Showing 1 changed file with 14 additions and 15 deletions.
29 changes: 14 additions & 15 deletions src/OpenThermTask.h
Original file line number Diff line number Diff line change
Expand Up @@ -667,26 +667,25 @@ class OpenThermTask : public Task {
}
}
}
}

// Hysteresis
// Only if enabled PID or/and Equitherm or Native heating control via OT
bool useHyst = false;
if (settings.heating.hysteresis > 0.01f && vars.sensors.indoor.connected) {
useHyst = settings.equitherm.enable || settings.pid.enable || settings.opentherm.nativeHeatingControl;
}

// Hysteresis
// Only if enabled PID or/and Equitherm or Native heating control via OT
bool useHyst = false;
if (settings.heating.hysteresis > 0.01f && vars.sensors.indoor.connected) {
useHyst = settings.equitherm.enable || settings.pid.enable || settings.opentherm.nativeHeatingControl;
}

if (useHyst) {
if (!this->heatingBlocking && vars.temperatures.indoor - settings.heating.target + 0.0001f >= settings.heating.hysteresis) {
this->heatingBlocking = true;

} else if (this->heatingBlocking && vars.temperatures.indoor - settings.heating.target - 0.0001f <= -(settings.heating.hysteresis)) {
this->heatingBlocking = false;
}
if (useHyst) {
if (!this->heatingBlocking && vars.temperatures.indoor - settings.heating.target + 0.0001f >= settings.heating.hysteresis) {
this->heatingBlocking = true;

} else if (this->heatingBlocking) {
} else if (this->heatingBlocking && vars.temperatures.indoor - settings.heating.target - 0.0001f <= -(settings.heating.hysteresis)) {
this->heatingBlocking = false;
}

} else if (this->heatingBlocking) {
this->heatingBlocking = false;
}
}

Expand Down

0 comments on commit e4211c8

Please sign in to comment.