Repository navigation
Add configurable whole-site import diagnostics (no enforcement) - #5486
arturonaredo wants to merge 2 commits into
Conversation
d39bfe5 to
1a4368f
Compare
v9.4.0 publication — 14 October 2026v9.4.0 update — 14 October 2026: this branch now includes the official release
Current-head CI: run 38594150205: The latest code is in the existing PR branches; no installation branch or private configuration is published. Previous dated report — historical evidence, superseded statusConsolidated installation and validation update — 13 October 2026Current-main rebase update: all three PRs now include upstream Current-head CI: run 38375563028 for I now have the code from #5486, #5498 and #5505 installed together at home, with the household battery plan operating through Predbat's native control loop. This supersedes the original pre-deployment status, not this PR's diagnostics-only boundary. At 07:51 UTC, the latest ordinary cycle was 07:50 UTC: Scope and useful cases
Predbat already has EV planning; these additions address the coupled fixed-rate EV/domestic-battery constraint, not EV scheduling in general. The existing Plan table keeps its columns, colours, totals and calculation precision; ordinary household fallback has no production banner, with technical reasons only in Show Debug. What was verifiedThis rebased diagnostics head passed 345/345 registered groups, including slow tests and a freshly rebuilt/loaded native kernel. The rebased #5498 public tree passed 364 registered test groups with a fresh native kernel. Five optional-backend groups checked safe rejection but skipped real-template scenarios when run without #5505. The local integration of all three public heads passed 367/367 groups, without skips, including the real shared-template fixtures. Pre-commit passed on both trees; the documentation build passed with unrelated existing warnings. The separately installed revision also passed native power-matrix and captured 48-hour replay checks. None of those offline checks actuated hardware. All three PRs have now been rebased onto current upstream main. This diagnostic PR remains independent. The combined changes since the release-pinned validation are the five upstream commits, with both sides of the publication guard/per-car-list conflict preserved. Private captures, configuration and the combined installation branch are not published. GitNexus impact/change analysis was rerun after reindexing. The full PR changes still carry critical risk and dynamic-call relationships remain unresolved; this is not a graph all-clear. Current-head upstream CI remains approval-blocked as reported above; previous runs on older SHAs are not evidence for them. Boundaries: household operation is observed; physical EV charging is still pending an at-home, connected, expressly authorised session. The installed session was not renewed, and EV authority remains disabled. Real departure SOC, realised savings, outage recovery and instantaneous enforcement have not been demonstrated. Existing currents, reserve/shutdown, EV pause/restart/cooldown, the separate executor cutoff and local-only inverter ownership were preserved. Peak Shaving is not a guaranteed hard grid clamp. This PR still does not close #2449 or #1199 by itself. |
1a4368f to
3315b25
Compare
3315b25 to
6db22f4
Compare
v9.4.0 update — 14 October 2026: this branch now includes the official release
9bbe3f75b8275781dd7418237444fb9ab6154b18through a fast-forward branch update with a merge commit; existing published history is preserved. Current head:60a7b3a3ca41121cc09f4f63c3b9146afd010a0d. The three PRs remain independently owned. Their combined production code matches the v9.4.0 integration installed and verified at home at 15:30 UTC; the publication additionally corrects two optional-backend test runners. HA and the Predbat web UI reported v9.4.0, a fresh plan was generated without a runtime error, and protected settings were retained. Sustained physical EV delivery, deadline completion and real-tariff midnight savings remain unverified.Current-head CI: run 38594150205:
completed/action_required. Upstream execution awaits maintainer approval. Local validation is not an upstream CI pass.Scope: diagnostic foundation, not enforcement
Related to #2449 and #1199. This PR does not fix or close either issue.
It proposes a configurable whole-site threshold and truthful diagnostics as a first
step towards a joint household/battery/EV import constraint. It is now installed at my home alongside #5498 and #5505; the dated report above separates observed household operation from pending EV commissioning.
Implemented
import_limitin W, default0(disabled), read once per site.It is not summed or minimised across inverters. Reloads can raise, lower or remove it.
Invalid values are rejected rather than silently converted to disabled.
peak W, excess kWh, minutes over, first violation and checked forecast interval.
Modelled EV load outside the house CT is included once, assuming a shared grid connection.
predbat.best_import_limitwithdisabled/unavailable/within_limit/exceededstates andenforced: false.The scope is the entire forward forecast, not elapsed daily energy or only
end_record.EV power, actuator writes or kernel dispatch changes. Optimisation trials keep the
C++ kernel; saving runs already use Python. Stale diagnostics are cleared on later trials.
proposal for actual constraint-aware optimisation.
Why not a large monetary penalty?
A finite penalty does not establish that all feasible candidates outrank all violating
ones. Nor is it valid to shift excess import onto a battery that is already at reserve
and then clamp its SoC without accounting for the missing energy. This draft only
observes the native energy balance; it does not pretend either shortcut is enforcement.
Current v9.4.0 validation
60a7b3a3ca41121cc09f4f63c3b9146afd010a0d: 346/346 registered test groups passed, including slow suites and a freshly built/loaded native kernel. No optional-backend skips.PREDBAT_JOINT_TEMPLATE_REQUIRED=1and a fresh native kernel; treeefe99e7dc749a91d346dd68c9cd2a9637bf03d09. The shared-file resolutions preserve the independent contributions.Original standalone verification
Independently rerun locally in an isolated Python 3.12 environment (macOS):
import_limitmodule: 12 checks passed, including the reserved-batteryfixed-EV counterexample, metered/outside-CT EV accounting, raw precision, real cache
hits, actual native-kernel dispatch and the real
Plan.run_predictionHA publication path.--quicksuite withPREDBAT_KERNEL_REQUIRED=1: passed, including kernelparity; four explicitly slow tests were skipped. This is not a claim of full slow-suite
or Linux/hardware validation.
git diff --check: passed.as an unchanged upstream snapshot; no new warnings.
The prediction/configuration hooks have broad callers, so the checks explicitly verify
unchanged return tuples, energy accounting, costs, native dispatch and saved curves.
Example: a synthetic 32.1536 kWh battery already at its 10% reserve, a 1.2 kW house
and a fixed 6.77 kW EV over one hour still import 7.97 kWh, cycle the battery by
0 kWh, and report 1.97 kWh above a 6000 W threshold. The diagnostic does not
hide that demand or claim to make the plan feasible.
Commands assume the repository test dependencies and native kernel are already available.
At the original validation checkpoint, upstream CI was not yet verified: the
code-quality run
reported
action_required, with no jobs listed. The local results aboveare not being presented as a successful upstream CI run.
Explicitly not implemented
battery preparation under the site threshold.
executable inverter rates/modes, including battery-first ECO behaviour.
guarantees, multi-inverter dispatch allocation or real-time electrical protection.
within_limitrefers only to this forecast's step averages.exceededdoes not meanevery possible alternative is infeasible. Existing inverter definitions, including
local
SKconfigurations, remain untouched; no production configuration or privateHome Assistant dump is included.
Feedback requested: whether this diagnostics-first split and the scalar setting/output
names are a useful foundation before extending the optimiser, kernel result contract
and native EV planning together.