A phase that drops out or comes back shifted the compressed current_a tuple and
read as life, so a frozen charger never armed. ChargerReading.phase_a keeps
L1/L2/L3 with None for a missing phase and the life test uses it.
Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VSY9UpTaUYnjJF5oVtbM1w
A refused write on a live charger no longer reads as a stuck reading 60 s
later, so a refused write shows one amber row (charger_refused). A frozen
charger still arms and is still caught.
Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VSY9UpTaUYnjJF5oVtbM1w
Review fixes, no logic change:
- T17a now asserts the restore is the first write once the charger is back
(it was only checked to happen at some point); mutant M3 (restore after
SETTLE_S) now turns T17a red.
- T15 now asserts the refused restore is counted once (`fails == 1`);
a mutant without `_failed` there now turns T15 red.
- DECISIONS "The phase sequence" and the carmode docstring reflowed to 79
columns; DECISIONS says D counts as drawing too, as the code does.
Co-Authored-By: Claude <noreply@anthropic.com>
Stage zero counted mode3 B as quiet whatever the power and selected at the
20 s timeout under load. A power reading now decides (under 100 W); mode3
(not C, not D) only without one. Still drawing at 20 s: no select, the
current comes back at once, one failed try, next try PHASE_GAP_S later.
Co-Authored-By: Claude <noreply@anthropic.com>
The fallback (no record yet, or a record of an ended episode) had no check;
reading floor_limited alone there survived test_ev16. Test only.
Co-Authored-By: Claude <noreply@anthropic.com>
car_cycle ends with _car_why_tick (display only: control writes, never reads);
the Why reads the record. Adds read-gap tests (A, B, cover off/on), a long
guard-None test and a lower bound for the hold.
Co-Authored-By: Claude <noreply@anthropic.com>
Control bumps _car_over_ep at each start and end of car_over; the display
ignores a hold of another episode, so a read overlapping the end cannot bring
a stale text back.
Co-Authored-By: Claude <noreply@anthropic.com>
Display only: the 'are at' / 'give all they can' text changes only when the
other state has stood for 180 s (the car_over off hold); SoC unread is never
'are at'. Cleared when car_over drops, on unplug and with cover off.
Co-Authored-By: Claude <noreply@anthropic.com>
Test-only. Two unit checks in test_ev19.py: an honest step with a burst
that moves the meter's house side +/-60 W alarms in base's cycle, and
inside the band (0 W) the car explains at most the step's own cycle;
a car step offset by a burst at the meter is not discounted. They kill
RISE_STILL_W = 500 W and a stillness test without the car term.
Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VSY9UpTaUYnjJF5oVtbM1w
[Major] The rise discount applied to any rise, also one the meter
already shows, so an honest house step answered by one cycle of battery
power alarmed one cycle after base (review repro: T6 step + burst, R+6
instead of R+5). Now a reading above both earlier ones is discounted only
while the meter's house side (held - car; held alone when a car figure is
unknown) moved no more than RISE_STILL_W (50 W) since the last cycle.
Tests: the burst shapes (unit, meter in step and one cycle late;
controller, step at R+5 and R+30, 3 000 / 4 600 W) at base's second; the
"N6 unit" check tightened to the rise cycle; the RISE_STILL_W boundary;
a pin on EV-18's `_car_over_now` (mC); T10 restarts at R-1 and R (mE).
test_ev19: 144 of 144 here, 52 red on 43b0db7.
Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VSY9UpTaUYnjJF5oVtbM1w
EV-15 rig F-B, reproduced on 43b0db7 (tools/ev19_reserve.py, T1 grid). At
the reserve inverter-b goes on following the house, so its output rises
in that cycle. The battery reading shows the rise one cycle before the P1
sample does, and EV-18's house figure (held - car + now - min(now, prev))
counted the new battery power as house load. `_car_need_house` latched:
one PEAK_GUARD_FLOOR_LIMITED ERROR and goodwe_peak_soc_floor at R+1, red
until the guard stopped wanting power.
ctl_car._car_explains_alarm: for the house latch only, a reading above
both earlier readings counts as house only up to the higher of them. The
credit stays the lower of the last two readings. The claim, floor,
setpoints and charger writes are unchanged (342 runs, same digests).
test_ev19.py: T1-T17, T20, N1-N6 of reports/EV-19-test-plan.md; 49
checks red on 43b0db7, 124 of 124 green here.
Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VSY9UpTaUYnjJF5oVtbM1w
Wording only. DECISIONS/EV-04: a contradiction is a meter that answered and
fell short (an unknown reading is none), and it grades no alarm while the
guard's input keeps the figure. ctl_car.car_cycle: the car-over row keeps the
figure only with the cover off.
Co-Authored-By: Claude <noreply@anthropic.com>
- [Critical] The latch set `w = None` before `_car_quarter`, so with cover
off the guard's input (`car_exclude`) counted the car as house and the
batteries discharged. The latch now changes only the figure graded for the
alarm; the car's energy count, the guard's input and the car-over row keep
the unlatched `car_alarm_w()`. Cover-off N4 twins (energy gap, T9(c) liar,
SoC 60 % and at the reserve) give the same commands as without the latch.
- [Major] `corroborated()` is False for an unknown energy reading, so one
missing reading latched a correct figure for the quarter. New
`CarTracker.contradicted()`: only a meter that answered over a whole window
and fell short. R1 (energy entity unknown 1 s at E+200, T2 and T3 shapes):
red for that cycle only, explained from the next.
- Minors: unit checks that a contradiction in our own pause latches nothing
(MF) and that the latch ends with the quarter (MG).
Co-Authored-By: Claude <noreply@anthropic.com>
- [Critical] After a restart or a gap only the rest of the quarter was graded
without the car (`_carq["whole"]`), which dropped the house's own energy
from before it and hid an honest alarm (review repro: house 18 kW then
12 kW, restart at E+310). The rest-only grading is gone: the car is
credited only with energy counted since the start, the rest of what is
done counts as house (base's side). T17b covers it; T17 T2 at E+300 now
alarms from the restart (the conservative side).
- [Major] Owner 2026-11-19: a figure the energy meter contradicted (fresh,
charging, not corroborated) stays untrusted to the quarter's end, also as
the EV-15 stand-in. T9(c): one alarm edge, red to the end; T9(c) is back
in the N5 check.
- [Major] T2c lagging-meter variant (readings 389 W then 800 W, the meter at
800 W): the house latch grades on the lower reading.
- Unit stub: a run that starts mid-quarter has the car counted since the
quarter's start (no restart).
Co-Authored-By: Claude <noreply@anthropic.com>
EV-15 rig F-A: with both batteries at the peak reserve and the car charging,
PEAK_GUARD_FLOOR_LIMITED and goodwe_peak_soc_floor fired at a quarter's start
and stayed red for the quarter, the excess smaller than the car. Two causes,
both held by the per-quarter latch `_car_need_excl`:
- C2: "without the car" assumed the batteries give 0 W from now on, so what
the loop still gives below the reserve counted as house (T2 red on base);
- C1: one cycle with no trusted car figure latched it for the quarter (T1).
Owner 2026-11-19 (Q1-Q3): without the car the batteries keep giving what they
give now (lower of two readings, every cycle); a house need seen with a
trusted car figure stays latched to the quarter's end (`_car_need_house`); an
unknown car figure keeps the alarm only while it is unknown. A car known to
draw nothing (fresh reading, not charging) still grades the house's own need.
After a restart or a gap only the rest of the quarter is graded without the
car. A 0 W figure explains nothing outside our own pause (EV-15). The guard's
claim, floor, setpoints and charger writes are unchanged (N4: 41 runs, same
command digests as base).
test_ev18.py: the test plan's T1-T18, T2b, T2c, N2-N5 (tools/ev18_peak.py:
the real Controller across one quarter edge, N=2 at the reserve).
Co-Authored-By: Claude <noreply@anthropic.com>
The writer runs beside the cycle and the car can stop before the write
returns, so no sequence existed yet and the latch set. Window now opens at
send (zero_sent_at), cleared on return; ends on another writer in the tail too.
Co-Authored-By: Claude <noreply@anthropic.com>
While the add-on holds the car at 0 A for its own phase change, the car's
figure had no corroboration (not charging), so nothing was explained and the
peak-floor alarm fired once. For grading only, the car's fresh, not stuck
figure now stands in for that sequence (bounded: its own waits plus one
corroboration window), ending at once on Off, Stop, shadow, unplug, another
writer or a refused write. car_exclude, the claim, floor and writes unchanged.
Co-Authored-By: Claude <noreply@anthropic.com>
Minor bump: car Manual mode (EV-04), car-alone peak alarm fixes
(EV-10, EV-11, EV-12, EV-10b). Two new options with defaults
(ev_batt_cover, ev_mode_start); existing installs need no option change.
Co-Authored-By: Claude <noreply@anthropic.com>
Two checks a mutant survived: crediting the car-made export in the done part,
and taking off the car's quarter average instead of its power now.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The period without the car was clipped at 0 W, so batteries covering the car
were charged to the house and the floor alarm fired (rig F-1). New
car_exclude_alarm keeps the sign of the rest of the period; car_exclude (the
cover-off guard input) is unchanged.
Co-Authored-By: Claude <noreply@anthropic.com>
EV-10: the car is the cause when the period without it (projected minus the car's
fresh, corroborated average) is at or under the aim, also with the projection
still under it. EV-11: car_over stays on until the test has been false for 180 s.
EV-12: the tracker's own-write mute opens before the write and runs 15 s from its
return.
Co-Authored-By: Claude <noreply@anthropic.com>
N1 the undo gives the old current back (clamped) in shadow mode; DECISIONS records it as the one write shadow mode allows.
N2 the corroboration looks back to a stretch with at least 40 Wh expected (60 s at 2.4 kW and up, 104 s at 1.38 kW).
L4 the current comes back 10 s after the phase select returned, also when it was refused.
Co-Authored-By: Claude <noreply@anthropic.com>
M1 the writer ignores a reading taken before its latest confirmed write.
M2 a refused phase select gives the current back and stops after 3 tries (amber row).
M3 Off, shadow mode or a control/safety stop before the select undoes the change.
M4 the restore on shutdown (and the undo) is clamped.
M5 the car's power reaches the alarm path only while the charger's energy meter agrees with it.
L1 fuzz other-writer branch reachable and shown to run. L2 one wording. L3 Batteries-help-off text.
Co-Authored-By: Claude <noreply@anthropic.com>
Off and Manual (runtime state, Home and Home Assistant): the current (6 A to
the clamp) and the phases (1 or 3) are written once per user change through
the safe phase sequence, read back within 10 s, clamped to
min(ev_max_a, station limit, entity range). Shadow mode gates the writes.
The car's fresh power goes to the peak guard's alarm path: no false "Load too
high" or "Battery stopped limiting the peak", one grey notice per session.
ev_batt_cover and ev_mode_start options, peak line "set by the car", HA
entities, sim writes, DOCS, CHANGELOG, test_ev04.py.
Co-Authored-By: Claude <noreply@anthropic.com>
- MAINT-28: say the hold is for two inverters (the code gates it on N >= 2).
- EV-03: "no longer buy energy for the car" (the profile is a 7-day median).
- TEL-19: plain wording for the PV sensor point.
- Known issues: add TEL-20 (DOCS names a car sensor id HA does not create).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Bump version to 0.23.0 and fold "Not in a release yet" into a new
0.23.0 CHANGELOG section (MAINT-28, CI-17, EV-03, CI-18). Four new
options (ev_*), all with defaults; no option change needed.
Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Bdqr7PiaHcBnzPituu2yTC