Skip to content

Commit

Permalink
threshold improvement
Browse files Browse the repository at this point in the history
  • Loading branch information
vindaalex committed Dec 26, 2023
1 parent 6c7195b commit ee73f63
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
4 changes: 3 additions & 1 deletion custom_components/multizone_thermostat/hvac_setting.py
Original file line number Diff line number Diff line change
Expand Up @@ -417,13 +417,15 @@ def get_control_output(self) -> dict:
if self.is_hvac_master_mode or self.is_hvac_proportional_mode:
if control_output > self.pwm_scale:
control_output = self.pwm_scale
elif control_output < 0:
# only open above threshold or 0 (or when not set)
elif control_output < self.pwm_threshold:
control_output = 0

self._logger.debug("control output before rounding %s", control_output)
control_output = get_rounded(
control_output, self.pwm_scale / self.pwm_resolution
)

if self.time_offset is None:
self.time_offset = 0

Expand Down
5 changes: 5 additions & 0 deletions custom_components/multizone_thermostat/pwm_nesting.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,11 @@ def get_pwm_max(self) -> int:

load_area = sum([a * b for a, b in zip(self.area, self.pwm)])

# check if load requirement is too low
if self.pwm_limit > 0 and self.min_load > 0:
if self.pwm_limit * self.min_load > load_area:
return 0

if self.operation_mode == NestingMode.MASTER_CONTINUOUS:
# check if load is above minimum
if self.min_load > 0:
Expand Down

0 comments on commit ee73f63

Please sign in to comment.