Skip to content

Commit

Permalink
Optimize the relative modulation when the boiler is basically off
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexwijn committed May 16, 2023
1 parent ac0675d commit 9a4d822
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions custom_components/sat/climate.py
Original file line number Diff line number Diff line change
Expand Up @@ -566,10 +566,10 @@ def pulse_width_modulation_enabled(self) -> bool:
@property
def relative_modulation_enabled(self):
"""Return True if relative modulation is enabled, False otherwise."""
if not self._coordinator.support_relative_modulation_management:
if not self._coordinator.support_relative_modulation_management or self._setpoint is None:
return False

if self._coordinator.hot_water_active:
if self._coordinator.hot_water_active or self._setpoint <= MINIMUM_SETPOINT:
return True

return self.hvac_mode == HVACMode.HEAT and not self.pulse_width_modulation_enabled
Expand Down Expand Up @@ -736,12 +736,12 @@ async def _async_control_heating_loop(self, _time=None) -> None:
# Pulse Width Modulation
await self._pwm.update(self._get_requested_setpoint(), self._coordinator.minimum_setpoint)

# Set the relative modulation value, if supported
await self._async_control_relative_modulation()

# Set the control setpoint to make sure we always stay in control
await self._async_control_setpoint(self._pwm.state)

# Set the relative modulation value, if supported
await self._async_control_relative_modulation()

# Control the integral (if exceeded the time limit)
self._pid.update_integral(self.max_error, self._heating_curve.value)

Expand Down

0 comments on commit 9a4d822

Please sign in to comment.