Skip to content

Add flow-rate-aware zone scheduling#95

Draft
lnagel wants to merge 2 commits into
mainfrom
add-flow-control
Draft

Add flow-rate-aware zone scheduling#95
lnagel wants to merge 2 commits into
mainfrom
add-flow-control

Conversation

@lnagel
Copy link
Copy Markdown
Owner

@lnagel lnagel commented Feb 8, 2026

Summary

  • Add per-zone nominal_flow_rate configuration (L/min) for flow-rate-aware scheduling
  • Add controller-level optimal_flow_rate_min and optimal_flow_rate_max bounds via a new "Flow Scheduling" options menu
  • Introduce core/scheduler.py with apply_flow_constraint() to cap aggregate flow by demoting TURN_ON actions to STAY_OFF when the budget is exceeded (front-loading zones with highest remaining quota)
  • Suppress boiler heat request when aggregate flow from active zones is below the configured minimum (latent heat mode)

Test plan

  • Unit tests for apply_flow_constraint() covering: unconstrained pass-through, budget capping, starvation prevention, zones without flow rate
  • Integration tests for flow minimum gating of heat request
  • Config flow tests for the new flow scheduling options step
  • Verify diff coverage meets 100% threshold

🤖 Generated with Claude Code

@codecov
Copy link
Copy Markdown

codecov Bot commented Feb 8, 2026

Codecov Report

❌ Patch coverage is 23.37662% with 59 lines in your changes missing coverage. Please review.
✅ Project coverage is 93.46%. Comparing base (5210f04) to head (8114562).
⚠️ Report is 8 commits behind head on main.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
custom_components/ufh_controller/core/scheduler.py 9.67% 28 Missing ⚠️
custom_components/ufh_controller/config_flow.py 21.87% 23 Missing and 2 partials ⚠️
...ustom_components/ufh_controller/core/controller.py 33.33% 4 Missing and 2 partials ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main      #95      +/-   ##
==========================================
- Coverage   96.61%   93.46%   -3.16%     
==========================================
  Files          20       21       +1     
  Lines        1715     1791      +76     
  Branches      257      281      +24     
==========================================
+ Hits         1657     1674      +17     
- Misses         36       91      +55     
- Partials       22       26       +4     
Files with missing lines Coverage Δ
custom_components/ufh_controller/const.py 100.00% <100.00%> (ø)
custom_components/ufh_controller/coordinator.py 94.70% <100.00%> (+0.02%) ⬆️
custom_components/ufh_controller/core/zone.py 100.00% <100.00%> (ø)
...ustom_components/ufh_controller/core/controller.py 97.22% <33.33%> (-2.78%) ⬇️
custom_components/ufh_controller/config_flow.py 84.35% <21.87%> (-13.62%) ⬇️
custom_components/ufh_controller/core/scheduler.py 9.67% <9.67%> (ø)

lnagel and others added 2 commits February 12, 2026 22:25
Add per-zone nominal flow rate configuration and two flow-rate constraints
to the heating controller:

- Flow constraint (max): Limits how many zones can be ON simultaneously by
  capping aggregate flow rate. TURN_ON candidates are prioritized by
  remaining quota (front-loading high-demand zones). Zones already ON are
  never preempted, and a single zone is never starved.

- Flow minimum gating: Suppresses the boiler heat request when aggregate
  flow from active zones is below a configured minimum threshold (latent
  heat mode), allowing residual heat to be used before firing the boiler.

Both thresholds are optional and configurable via a new "Flow Scheduling"
options menu step. Per-zone nominal flow rate is configurable in zone
entity settings.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replace string literals with CONF_NOMINAL_FLOW_RATE,
CONF_OPTIMAL_FLOW_RATE_MIN, and CONF_OPTIMAL_FLOW_RATE_MAX constants
in config_flow.py and coordinator.py for consistency and typo prevention.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant