Repository navigation
Commit a37dc29
Replace real-export corroboration with a wallbox-aware battery projection (v2.39.0)
v2.37 required the grid meter to show a real feed-in before a device could
switch on via the modelled-surplus path, to catch cases where remaining_
surplus read positive only because the wallbox reservation was modelled
too low relative to a gross-PV upswing. In practice it also blocked
genuinely safe starts: confirmed live 2026-09-17, the pool pump's window
opened at 09:00 and modelled surplus cleared its need by ~09:20-09:30 on
a clear, EV-away morning, but the real-export gate held it off until a
forced price slot rescued it at 10:48 - the house battery (32% SOC at
sunrise) was legitimately absorbing the "surplus" the model saw, and the
gate had no way to know that was fine given how much margin the battery
still had before its own deadline.
_battery_would_still_reach_full already answers the question the export
gate was approximating, more precisely: it explicitly models the
worst case (the device's whole draw comes straight out of the battery's
charge rate, not some separate "free" pool) and re-evaluates every cycle
against the battery's own reach-full-by-deadline math. The one gap: it
never accounted for the wallbox's reservation, only for other managed
devices' committed draw. Fixed by seeding cumulative_battery_competing_
draw with wallbox_reserved_kw, so every device's projection treats a
car that still wants power as a prior claim on the battery's charge rate
- whether or not the wallbox is drawing that reservation yet.
With the wallbox now counted, would_delay_battery_full is a strictly
more precise substitute for what the export gate was a blunt proxy for,
so v2.37's export_uncorroborated check (and its EXPORT_CORROBORATION_
MARGIN_KW / cumulative_export_committed bookkeeping) is removed outright
rather than kept alongside it. The separate battery-affordability path
(battery_would_last / export_gate_open, v2.35/36) is untouched.
Backtested against real sensor history from both 2026-09-16 (EV home,
wallbox reserving) and 2026-09-17 (EV away): on the EV-home day the new
rule's first qualifying cycle for the pool pump landed at 11:15, the same
10-minute window the forced price slot actually used that day - no
earlier, because the wallbox's reservation correctly held it back through
three prior hours of weak/contested surplus. On the EV-away day it would
have started ~75 minutes earlier than the forced fallback that actually
fired.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>1 parent e874829 commit a37dc29
3 files changed
Lines changed: 26 additions & 72 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
525 | 525 | | |
526 | 526 | | |
527 | 527 | | |
528 | | - | |
529 | | - | |
530 | | - | |
531 | | - | |
532 | | - | |
533 | | - | |
534 | | - | |
535 | | - | |
536 | | - | |
537 | | - | |
538 | | - | |
539 | | - | |
540 | | - | |
541 | | - | |
542 | | - | |
543 | 528 | | |
544 | 529 | | |
545 | 530 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
72 | 72 | | |
73 | 73 | | |
74 | 74 | | |
75 | | - | |
76 | 75 | | |
77 | 76 | | |
78 | 77 | | |
| |||
2836 | 2835 | | |
2837 | 2836 | | |
2838 | 2837 | | |
2839 | | - | |
2840 | | - | |
2841 | | - | |
2842 | | - | |
2843 | | - | |
2844 | | - | |
2845 | | - | |
2846 | | - | |
2847 | | - | |
| 2838 | + | |
| 2839 | + | |
| 2840 | + | |
| 2841 | + | |
| 2842 | + | |
| 2843 | + | |
| 2844 | + | |
2848 | 2845 | | |
2849 | 2846 | | |
2850 | 2847 | | |
| |||
3371 | 3368 | | |
3372 | 3369 | | |
3373 | 3370 | | |
| 3371 | + | |
| 3372 | + | |
| 3373 | + | |
| 3374 | + | |
| 3375 | + | |
| 3376 | + | |
| 3377 | + | |
| 3378 | + | |
| 3379 | + | |
| 3380 | + | |
| 3381 | + | |
| 3382 | + | |
| 3383 | + | |
| 3384 | + | |
| 3385 | + | |
| 3386 | + | |
| 3387 | + | |
| 3388 | + | |
3374 | 3389 | | |
3375 | 3390 | | |
3376 | 3391 | | |
3377 | | - | |
3378 | | - | |
3379 | | - | |
3380 | | - | |
3381 | | - | |
3382 | | - | |
3383 | | - | |
3384 | | - | |
3385 | | - | |
3386 | | - | |
3387 | | - | |
3388 | | - | |
3389 | | - | |
3390 | | - | |
3391 | | - | |
3392 | | - | |
3393 | | - | |
3394 | | - | |
3395 | | - | |
3396 | | - | |
3397 | | - | |
3398 | | - | |
3399 | | - | |
3400 | | - | |
3401 | | - | |
3402 | | - | |
3403 | | - | |
3404 | 3392 | | |
3405 | 3393 | | |
3406 | 3394 | | |
3407 | 3395 | | |
3408 | 3396 | | |
3409 | | - | |
3410 | 3397 | | |
3411 | 3398 | | |
3412 | 3399 | | |
| |||
3491 | 3478 | | |
3492 | 3479 | | |
3493 | 3480 | | |
3494 | | - | |
3495 | | - | |
3496 | | - | |
3497 | | - | |
3498 | | - | |
3499 | | - | |
3500 | | - | |
3501 | | - | |
3502 | | - | |
3503 | | - | |
3504 | | - | |
3505 | 3481 | | |
3506 | 3482 | | |
3507 | 3483 | | |
| |||
3527 | 3503 | | |
3528 | 3504 | | |
3529 | 3505 | | |
3530 | | - | |
3531 | | - | |
3532 | | - | |
3533 | | - | |
3534 | | - | |
3535 | | - | |
3536 | | - | |
3537 | 3506 | | |
3538 | 3507 | | |
3539 | 3508 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
| 12 | + | |
13 | 13 | | |
0 commit comments