EV-20: Car Solar mode, charging only (part 1 of the EV-05 split). Brief v3 (R4), test plan PASS on brief v2 (61 T-ids, 15 N-ids).
What it does
Mode Solar on Home and in select.goodwe_car_mode (Off, Manual, Solar); select.goodwe_car_sun_first (Batteries / Car), runtime state in the store. Night stays refused.
Signed spare car + battery charge - grid import; Batteries first takes the RATINGS of the batteries that may charge; ev_margin_w kept back; whole amps rounded down, 6 A to the clamp; 30 s / 1 A rule; start after ev_start_min at 7 A worth (on 1 phase from a pause in auto); 6 A hold for ev_pause_min, then 0 A; auto phases 4.5 kW / 3 min up, 4.0 kW / 5 min down, one per 10 min, through EV-04's safe sequence; one-phase car on 1-phase arithmetic.
Fail state 0 A on every way out, retried by EV-04's rule (60 s, 3 tries, gave-up row); at shutdown before the inverters' 0 W, three tries inside 15 s (D3); start-up and a returning charger/HA write 0 A first (D2); never over another writer's hold (N16).
The peak guard treats a Solar car exactly as a Manual car (car_controlled), with D1's wording.
Solar kWh: sensor.goodwe_car_today_solar_kwh and "{kwh} charged today, {sun} from the sun".
EV-20: Car Solar mode, charging only (part 1 of the EV-05 split). Brief v3 (R4), test plan PASS on brief v2 (61 T-ids, 15 N-ids).
## What it does
- Mode **Solar** on Home and in `select.goodwe_car_mode` (Off, Manual, Solar); `select.goodwe_car_sun_first` (Batteries / Car), runtime state in the store. Night stays refused.
- Signed spare `car + battery charge - grid import`; Batteries first takes the RATINGS of the batteries that may charge; `ev_margin_w` kept back; whole amps rounded down, 6 A to the clamp; 30 s / 1 A rule; start after `ev_start_min` at 7 A worth (on 1 phase from a pause in auto); 6 A hold for `ev_pause_min`, then 0 A; auto phases 4.5 kW / 3 min up, 4.0 kW / 5 min down, one per 10 min, through EV-04's safe sequence; one-phase car on 1-phase arithmetic.
- Fail state 0 A on every way out, retried by EV-04's rule (60 s, 3 tries, gave-up row); at shutdown before the inverters' 0 W, three tries inside 15 s (D3); start-up and a returning charger/HA write 0 A first (D2); never over another writer's hold (N16).
- The peak guard treats a Solar car exactly as a Manual car (`car_controlled`), with D1's wording.
- Solar kWh: `sensor.goodwe_car_today_solar_kwh` and "{kwh} charged today, {sun} from the sun".
- `ev_margin_w` (100, 0-1000), `ev_start_min` (2, 1-30), `ev_pause_min` (5, 1-30): config, validator, translations, DOCS; DECISIONS/EV-20-solar-mode.md; CHANGELOG.
## Checks
New: `test_ev20.py`, `test_ev20_exits.py`, `test_ev20_writers.py`, `test_ev20_guard.py`, `test_ev20_long.py` (sim day), `test_ev20_fuzz.py`; harness `tools/ev20_sun.py`, `tools/ev20_kit.py`. Changed: `test_ev03.py`, `test_ev04.py` (Solar is no longer the refused example: Night/Bogus instead; four car entities/sensors).
Details, mutants and coverage per T-id: reports/EV-20-dev-report.md.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_01VSY9UpTaUYnjJF5oVtbM1w
Solar as a second writer next to Manual (carmode.SolarPlan, SolarWriter on
ManualWriter's one write site, safe phase sequence and other-writer watch):
signed spare, Batteries first on the batteries' ratings, the margin, whole
amps rounded down, the 30 s / 1 A rule, start and pause dwells, auto phases,
a one-phase car. Every way out ends at 0 A, retried by EV-04's rule; at
shutdown before the inverters, three tries inside 15 s (D3); start-up and a
returning charger or HA write 0 A first (D2); never over another writer's
hold. The peak guard treats a Solar car as a Manual car (D1 wording). Solar
kWh sensor and card line; select.goodwe_car_sun_first; ev_margin_w,
ev_start_min, ev_pause_min with config, validator, translations, DOCS,
DECISIONS and CHANGELOG.
Checks: test_ev20.py, test_ev20_exits.py, test_ev20_writers.py,
test_ev20_guard.py, test_ev20_long.py, test_ev20_long_car.py,
test_ev20_fuzz.py (harness tools/ev20_sun.py, ev20_kit.py, ev20_day.py);
test_ev03/test_ev04 no longer use Solar as the refused example.
Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VSY9UpTaUYnjJF5oVtbM1w
T4: battery A's power missing, NaN or unavailable, for one cycle (no
write) and for 400 s (no spare, the current held, 0 A at 300 s).
T21 (a): car_cycle on the same projection, guard and reading gives the
same car figure, explains and over in Solar and Manual.
Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VSY9UpTaUYnjJF5oVtbM1w
C1: an own 0 A not yet read back is kept with the mode; a start in Off with
it writes the 0 A (retried), without it nothing; a start that will not write
warns once when the charger still has the add-on's current. C6: Solar's 30 s
gate also counts from Manual's latest write. C9: an exit also owes its 0 A
when the read-back shows Solar's own value. Rows for C5 and C8 too.
Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VSY9UpTaUYnjJF5oVtbM1w
After its own phase select (taken, or with a late read-back), Solar ends the
sequence with the lower of the currents for the new phases and the phases the
charger reports, and keeps the plan on them; the old phases' current comes
back only when no select went out (EV-28's cap). Rows: T19/T33 settle write
refused or ignored once and select confirmed late; an exit after a given-up
write; shutdown in Off with the 0 A owed; Stop with a refused 0 A and another
writer. NoCharger.write_current takes took_s; ev_mode_start text names C1;
NL solar_hold wording.
Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VSY9UpTaUYnjJF5oVtbM1w
ManualWriter._write, the one write_current call, stamps every non-zero
current either writer sends; Solar's 30 s gate reads that stamp (its own and
Manual's), so the step back up after a phase change's closing write waits 30
s on every path. The closing current is fixed once per sequence, retries too.
Rows: every select shape (refused, ignored, late; settle refused three times;
T7 1 -> 3 and T22 3 -> 1) with nevers().
Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VSY9UpTaUYnjJF5oVtbM1w
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
EV-20: Car Solar mode, charging only (part 1 of the EV-05 split). Brief v3 (R4), test plan PASS on brief v2 (61 T-ids, 15 N-ids).
What it does
select.goodwe_car_mode(Off, Manual, Solar);select.goodwe_car_sun_first(Batteries / Car), runtime state in the store. Night stays refused.car + battery charge - grid import; Batteries first takes the RATINGS of the batteries that may charge;ev_margin_wkept back; whole amps rounded down, 6 A to the clamp; 30 s / 1 A rule; start afterev_start_minat 7 A worth (on 1 phase from a pause in auto); 6 A hold forev_pause_min, then 0 A; auto phases 4.5 kW / 3 min up, 4.0 kW / 5 min down, one per 10 min, through EV-04's safe sequence; one-phase car on 1-phase arithmetic.car_controlled), with D1's wording.sensor.goodwe_car_today_solar_kwhand "{kwh} charged today, {sun} from the sun".ev_margin_w(100, 0-1000),ev_start_min(2, 1-30),ev_pause_min(5, 1-30): config, validator, translations, DOCS; DECISIONS/EV-20-solar-mode.md; CHANGELOG.Checks
New:
test_ev20.py,test_ev20_exits.py,test_ev20_writers.py,test_ev20_guard.py,test_ev20_long.py(sim day),test_ev20_fuzz.py; harnesstools/ev20_sun.py,tools/ev20_kit.py. Changed:test_ev03.py,test_ev04.py(Solar is no longer the refused example: Night/Bogus instead; four car entities/sensors).Details, mutants and coverage per T-id: reports/EV-20-dev-report.md.
🤖 Generated with Claude Code
https://claude.ai/code/session_01VSY9UpTaUYnjJF5oVtbM1w