MAINT-28 fix round 5: while the pause holds, the batteries give only what the guard needs
checks / unit (pull_request) Failing after 38m55s
infra-pin / fresh (pull_request) Successful in 1s

H-1: one site limit while the pause holds (the period's largest floor, never under this cycle's), so the other pack no longer gives for the house. New live-try test (A 11 %, B 25 %, 90 min at 6.5 kW) red on 07d23d2. M-1: a 45-min rig-shape test that goes red when the settled check is forced True. M-2/L-2: DECISIONS. CHANGELOG line. test_safety84 n2_charge_banked re-pinned (quarters 3349 and 3950 W, aim 3950 W).

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
glenn schrooyen
2026-11-14 16:40:54 +01:00
co-authored by Claude
parent 9a76f1a968
commit de06a2c6f5
6 changed files with 93 additions and 14 deletions
+16 -1
View File
@@ -747,7 +747,9 @@ class TradeMixin:
reserve) set to the largest part of the guard's floor left to it in
this 15-minute period: the floor less what the other units are placed
at in this cycle's split without the cap. Kept per unit in `_m28_hi`,
dropped while the unit is not paused or is held.
dropped while the unit is not paused or is held. Also one site limit,
the period's largest floor, so the other pack does not give for the
house (`_m28_site`).
DECISIONS/MAINT-28-hold-the-pause-in-a-peak.md"""
floor = max((c.lo for c in claims if c.source == peakguard.SOURCE),
default=0.0)
@@ -755,6 +757,8 @@ class TradeMixin:
held = {self.actuator_of("maintenance", inv) for inv in self.inverters
if g is not None and inv.name in g.held}
q, seen = int(now.timestamp() // 900), set()
site = any(c.source == "maintenance" and c.reason == M28_REASON
and c.actuator != ACTUATOR_SITE for c in claims)
for i, c in enumerate(claims):
if c.source != "maintenance" or c.reason != M28_REASON \
or c.actuator == ACTUATOR_SITE or c.actuator in held:
@@ -771,6 +775,17 @@ class TradeMixin:
# A unit not paused (or held at its reserve) starts again from 0 W.
for u in set(self._m28_hi) - seen:
del self._m28_hi[u]
# Site: while the pause holds, the packs together give at most the
# period's largest floor, never under this cycle's (the guard's claim
# and P_PEAK outrank this one anyway).
if not site:
self._m28_site = (None, 0.0)
return
hi = max(floor, self._m28_site[1] if self._m28_site[0] == q else 0.0)
self._m28_site = (q, hi)
claims.append(Claim.limit("charge", P_MAINT_SHAPE, hi=hi,
reason=M28_REASON,
actuator=ACTUATOR_SITE))
def _m28_was(self, u, now) -> float:
"""MAINT-28: unit `u`'s cap so far in this 15-minute period, 0 W in
+1
View File
@@ -508,6 +508,7 @@ class Controller(InputsMixin, WritesMixin, TradeMixin, CycleMixin, AlarmsMixin,
self._maint_peak_hold = False # MAINT-28
self._m28_step = {} # MAINT-28: unit -> (command, step at)
self._m28_hi = {} # MAINT-28: unit -> (period, cap)
self._m28_site = (None, 0.0) # MAINT-28: (period, site cap)
# OPT-11: battery modes, off by default (SAFETY-10 section 1). Each
# battery's mode and on/off switch live in the store, not in options,
# so a change applies at once (`pack_use`, `pack_mode`).