Repository navigation
feat: experimental native joint EV and home battery planning - #5498
arturonaredo wants to merge 11 commits into
Conversation
Source: joint-planner PR springfall2008#5498, commit 5653cc0. Shadow-only; no control activation.
Sources: PR springfall2008#5498 at 091716c and PR springfall2008#5497 at 68682c7. Conditional stale-SOC scenarios retain their freshness blocker. All controls remain shadow-only in the local rollout.
|
Automated publication update on behalf of the PR author. Car kWh display follow-upLatest display follow-up — This signed fast-forward commit changes two presentation modules and updates the existing cancelled-slot HTML assertions. Repository pre-commit hooks and the quick suite passed, together with five focused presentation/dynamic-load groups on both the standalone and combined trees. The actually served JavaScript was also executed against a captured 97-row plan in six combinations (native/shadow/applied, Show Debug off/on): for example The combined display tree is Current-head CI: run 38646601211: The four EV priorities are included in this head. No maintainer reviews or inline comments were present at the latest review check. Daylight solar delivery, sustained charging and physical departure SOC remain unverified. Priority implementation and earlier reports — dated evidenceAutomated publication update on behalf of the PR author. Four distinct EV prioritiesEV priorities update: signed, fast-forward head The latest home software readback at 2026-10-14 21:03 UTC reported a fresh applied Current-head CI: run 38645116638:
Current priority-update validation
No private household/vehicle captures, configuration, credentials or installation branch are included. Previous dated reports — historical evidence and superseded statusv9.4.0 publication — 14 October 2026v9.4.0 update — 14 October 2026: this branch now includes the official release
Current-head CI: run 38594153731: This update publishes the standing daily policy, metering/continuity recovery, model-only arrival forecasting and the The latest code is in the existing PR branches; no installation branch or private configuration is published. Previous dated report — historical evidence, superseded statusConsolidated update — working at home, with EV commissioning still pendingCurrent-main rebase update: all three PRs now include upstream Current-head CI: run 38375559848 for I have the code from #5486, #5498 and #5505 installed together at home, and the household battery plan is operating through Predbat's native control loop — not merely displaying a simulation. At the read-only check on 13 October 2026, 07:51 UTC, the latest ordinary cycle was 07:50 UTC: The household-routing update was installed at 06:08 UTC; a display-only follow-up at 06:37 UTC removed the routine absence banner while retaining its reason in Show Debug. These are verified snapshots, not a claim of uninterrupted endurance testing. Earlier overnight shadow observations concerned older revisions, not hours of this apply revision. What each PR owns
All three branches have now been rebased onto current upstream main. The PRs remain independently reviewable; no private installation branch, configuration, identifiers or captured household/vehicle data is published. Added use cases and correctionsPredbat already plans EV charging. These changes extend the joint fixed-rate-EV/domestic-battery case rather than claiming EV planning itself is new:
The existing external EV executor remains the only automatic EV switch writer. Bounded cache-only lease revalidation cannot authorise a new intent or indefinitely extend an old plan. No forced relay actions, extra hardware polling, BMS bypass or speculative recovery writes were used. EV compatibility review after the rebaseThe post-rebase review checked the published Do not co-enable the native charger controller with joint apply. The joint publisher uses numeric minutes in Joint apply continues to require the sole separately commissioned external EV executor. GECloud EVC, myenergi Zappi and Ohme native plan-driven control must remain absent/inactive for this mode; Ohme's Seven focused groups passed again in the local combined tree with the template required and no skips: native joint replay, real entrypoints, joint apply, grid-support physics, smart-car scheduling, native charger control and joint sessions. An additional isolated publication probe revoked an expired receipt. These supplement, rather than replace, the exact-tree full-suite results below; they do not establish physical EV commissioning or complete the unresolved dynamic-call graph analysis. Validation and limits
My installation retains 160 A domestic charge/discharge (approximately 8192 W at nominal 51.2 V, not a constant physical wattage clamp), 6000 W Peak Shaving, the separate 16000 W EV-executor cutoff, 10% domestic reserve/5% shutdown, 15%/25% EV pause/restart and 600 s cooldown. The 6.77 kW, 25 kWh, requested-100% EV settings, manual domestic targets, local Solarman and disabled Deye Cloud remain unchanged. Physical EV charging has not been commissioned or demonstrated by this update. The installed EV session remains unauthorised/expired ( |
6919a7b to
fe51fff
Compare
Add limited-discharge actions, future-floor reachability, native segmented replay and a bounded forecast-envelope retry. Keep stale-SOC scenarios explicitly conditional and non-executing.
fe51fff to
fcf5464
Compare
…ority Preserve metering and observation continuity, daily targets and bounded execution leases. Keep absent-car demand model-only. Invalidate stale execution evidence when the HA priority changes. Guard optional template-dependent test suites for standalone PR validation.
Summary
Latest display follow-up —
2d4de3cbd5cd02d07cb6d025d06d09910d7012a0: show Car kWh with exactly two decimal places in native, shadow and applied Plan rows, including totals and cancelled-slot values. Display rounding preserves the underlying JSON/calculation values and cancellation markers.This signed fast-forward commit changes two presentation modules and updates the existing cancelled-slot HTML assertions. Repository pre-commit hooks and the quick suite passed, together with five focused presentation/dynamic-load groups on both the standalone and combined trees. The actually served JavaScript was also executed against a captured 97-row plan in six combinations (native/shadow/applied, Show Debug off/on): for example
0.564displays as0.56, raw data stays0.564, and other row cells/styles compare identically.The combined display tree is
91d69e4b932713c0a64ef2c8b46b8ae2aff77745. It was installed and read back at 2026-10-14 22:16 UTC with v9.4.0, a fresh appliedcostplan, no runtime error and protected settings verified. The full-suite counts below belong to the priority implementation parent; this small display follow-up has the focused/quick validation described here.Priority implementation (parent commit): signed head
3d2be7a83781b9c52003360c26c152940e8e192eadds distinctnow,asap,costandsolarpolicies on the existing v9.4.0 base (9bbe3f75b8275781dd7418237444fb9ab6154b18). The eight-file delta is limited to this PR's planner, dispatch guards, tests and documentation. Its combination with the separately owned diagnostics/template contributions reproduces the exact tested and installed tree4e9fa51fa2638d2253a0c624c923c65646af5181.The latest home software readback at 2026-10-14 21:03 UTC reported a fresh applied
costplan, no runtime error, preserved protected controls and v9.4.0 in HA and the web UI. The four-option helper was also verified in persisted HA configuration. This is software/deployment evidence; daylight SOLAR delivery, sustained EV delivery, physical deadline completion and realised savings remain unverified.Current-head CI: run 38646601211:
completed/action_required. Upstream execution awaits maintainer approval; local checks are not an upstream CI pass.Experimental native joint planning for #5490: schedule a fixed-rate EV and a domestic battery together against house/heating demand, PV, tariffs, import/conversion limits, losses, reserve and manual domestic minimum targets.
Default off. Shadow is isolated; apply is separately gated. Code from this PR, #5486 and #5505 is installed at my home and household control is operating. Sustained physical EV delivery and deadline completion remain unverified. See the consolidated home report and use cases for observed evidence and its limits. This is not a general production recommendation.
Implemented
Explicitly opted-in standing daily EV policy with durable sensor-derived sessions, native ready-by time/target, genuine meter intervals, continuity checks and safe handling of corrupt stored authority.
Model-only arrival forecasts can contribute hypothetical future demand while the EV is absent; they do not grant execution permission or fabricate observed SOC. Household routing checks availability first.
ev_charging_priorityaccepts literals or a cached HAinput_select/selectwithcost/asap/now/solar. A watched change invalidates the plan and execution receipt; changing it during calculation rejects the old-priority candidate.Bounded joint search across the forecast horizon, with independent full-horizon native nominal/PV10 replay. A search miss is not proof of infeasibility or global optimality.
Fixed EV power, pause/restart hysteresis, elapsed-OFF cooldown, domestic reserve and timed manual minima are preserved. Unsupported overrides block execution.
Optional shared-template grid-charge modelling gives house/EV load priority, uses available grid/PV charging headroom and bounds battery support by real rate, reserve and conversion inputs. Unsupported demand remains a violation, never a clipped trace.
Mode-specific bounded scheduling with separately authorised partial delivery. Partial plans require new paired-safe replay and exact evidence binding; requested and planning targets stay separate.
Availability-first household routing: absent/disconnected/unpermitted/expired EV sessions are excluded before EV SOC/meter reads. Withdraw EV authority first; return to the native household executor only after observed relay OFF. ON/unknown retains existing support without another writer.
Explicit single-session confirmation can support retained push telemetry plus a dedicated cumulative meter, without inventing freshness. Contradictions persist through Storage; later home/connection transitions require renewed explicit confirmation. In this legacy confirmation mode, departure/session authority never renew automatically; the separately opted-in standing policy above is distinct.
Gated dispatch inside the real native
execute_plan/Inverter.adjust_charge_immediateentry points. Successful observation can grant a bounded EV-slot lease; the existing external EV executor remains the sole automatic switch writer. Cache-only revalidation cannot start a new intent or indefinitely extend an old plan.One existing Plan table, using the candidate's native-replay trajectory. Preserve columns, colours, totals and calculation precision; hide technical detail in Show Debug. Applied status requires a valid observed-current-command receipt; future rows remain forecasts. Stale/failed evidence cannot retain an old active candidate.
Independent ownership and control boundary
This PR does not incorporate #5486's import diagnostics or #5505's generic service-sequence core/template. It remains independently importable/testable; unavailable apply backends fail closed. Shared-template compatibility is implemented here; #5505 replaces the superseded #5497 proposal. Combined validation is local, not a published installation branch.
apply_verifiedandev_executor_lease_verifieddefault false. The narrowly scoped confirmed shared-support path also supports an explicitexecution_authorisedrequest; that is not physical commissioning. A separately commissioned external executor must reject expired/malformed leases without further Predbat updates. This PR does not install that automation.HA read-back is observed, not hardware-confirmed;
ready_to_activateandhardware_confirmedremain false. Standing current limits, physical ToU times, work mode, reserve/shutdown and BMS protections are not raised or rewritten. Persistent inverter settings can survive a stopped planner: site-specific recovery commissioning remains required. Ordinary native best-plan graphs are not relabelled as the applied joint trajectory.Retained EV control boundary — review dated 13 October
The post-rebase review checked the published
fcf54648tree, not main without this PR's changes. Joint publication/execution guards, plugin-hook suppression, lease refresh, HAlast_updated, replay physics/kernel exclusion and Plan rendering were retained; upstream's per-car plan isolation is also present. The eight joint runtime modules are unchanged by the rebase. Diagnostics remain optional to replay; the shared-template backend remains a separate, fail-closed dependency for that apply mode.Do not co-enable the native charger controller with joint apply. The joint publisher uses numeric minutes in
plannedplus the separate versionedvalid_from/valid_untillease. UpstreamCarChargerControlreads textual planned windows, not the joint lease contract. An offline reproduction with the real publisher/parser/mixin and a fake charger produced an empty native window list and an OFF command from a valid joint ON publication. No physical command was sent. Merely converting the window timestamps would not add the required lease, permission, hysteresis or cooldown checks.Joint apply continues to require the sole separately commissioned external EV executor. GECloud EVC, myenergi Zappi and Ohme native plan-driven control must remain absent/inactive for this mode; Ohme's
autosetting must not be mistaken for disabled. The joint preflight rejects Octopus scheduling and registered plan hooks, but does not automatically detect every component-based competing writer. Concurrent native control is unsupported, not an automatically prevented or validated combination. No new controller or live configuration change was made.Seven focused groups passed again in the local combined tree with the template required and no skips: native joint replay, real entrypoints, joint apply, grid-support physics, smart-car scheduling, native charger control and joint sessions. An additional isolated publication probe revoked an expired receipt. These supplement, rather than replace, the exact-tree full-suite results below; they do not establish physical EV commissioning or complete the unresolved dynamic-call graph analysis.
Priority implementation validation
3d2be7a83781b9c52003360c26c152940e8e192e, tree5621a34b228606892f74b11641a7aad70bf21279: 368/368 registered test groups passed, including slow suites and a freshly built/loaded native kernel. Eight optional-backend groups test safe rejection and explicitly omit real-template scenarios without Add shared Deye/Solarman template with observed service sequences #5505.4e9fa51fa2638d2253a0c624c923c65646af5181: 371/371 groups passed, no skips, withPREDBAT_JOINT_TEMPLATE_REQUIRED=1. Replacing the eight owned files in the previous validated combination reproduces this tree exactly.coverage/run_pre_commitpassed, including all pre-commit hooks and the quick suite. The focusedjoint_site_priorityrunner also passed. Tracked source and tree identities were stable during validation.No private household/vehicle captures, configuration, credentials or installation branch are included.