pluginbattery/scripts
Michiel Berger fc90e65271 refactor: drop PV synthesis, model raw P1 net signal directly
The simulator used to reconstruct "gross household demand" by adding
back a synthesized PV trace (irradiance × kWp peak-match) to the P1 net
meter, then re-subtract a different synthesized PV per scenario. That
reconstruction was leaky — Michiel's horizontal pyranometer is at a
different location and orientation than dad's SE-facing array, so the
synthesis can't reproduce dad's actual production curve. Result: 511
hours of negative "gross demand" and phantom export inflation up to
~6 kW peak in scenarios where pv_kwp ≠ 3.

New shape: simulator works on a single signed signal, raw_demand_kw
(the P1 reading as recorded). No solar synthesis. Whatever the meter
shows is the input.

Concretely:
  - sim.py: drop synthesize_pv, reconstruct_gross_demand,
    schedule_with_planning_pv, no_foresight_schedule, groundhog_schedule,
    _oracle_daily_schedule_legacy. Rename column convention demand_kwh →
    raw_demand_kw. Plug-in discharge cap becomes max(0, raw_demand_kw).
  - web.py: drop pv_kwp/pv_yield/strategy form params. Demand slider
    now applies as an *additive* baseline shift (not multiplicative —
    multiplying scaled the export bursts too, which is wrong since dad's
    PV stays the same regardless of household consumption). Default
    demand_kwh = 2325 (dad's actual full-year net per his quote;
    extrapolated 8-month window comes out to ~1515, partial coverage).
    Saturation metric now measures (surplus ≥ pc_max), not (charge ≥
    pc_max) — the latter conflated arbitrage top-off with power-bottleneck.
  - templates/index.html: drop PV input, drop strategy radios, drop
    irradiance chart. Modal charts collapsed from 4 to 3: price, net
    meter (toggles between with/without battery), SoC.
  - app.js: mirror the above, drop pv_kwp/strategy plumbing.
  - tests: rebase fixtures on raw_demand_kw, drop synthesize_pv test.
  - scripts: drop --pv-kwp/--pv-yield flags throughout, switch column
    references to raw_demand_kw.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-08 21:32:59 +02:00
..
battery_leaderboard.py refactor: drop PV synthesis, model raw P1 net signal directly 2026-05-08 21:32:59 +02:00
capacity_sweep.py refactor: drop PV synthesis, model raw P1 net signal directly 2026-05-08 21:32:59 +02:00
compare_batteries.py refactor: drop PV synthesis, model raw P1 net signal directly 2026-05-08 21:32:59 +02:00
compare_with_store.py refactor: drop PV synthesis, model raw P1 net signal directly 2026-05-08 21:32:59 +02:00
deploy.sh deploy.sh: auto-refresh SSH host key when h4a recreates the VM 2026-04-30 15:02:47 +02:00
export_from_influx.py Initial import: home-battery ROI simulator + cracked thuisbatterijgids calc 2026-04-30 13:46:27 +02:00
import_dad_p1.py refactor: drop PV synthesis, model raw P1 net signal directly 2026-05-08 21:32:59 +02:00
run_oracle.py Initial import: home-battery ROI simulator + cracked thuisbatterijgids calc 2026-04-30 13:46:27 +02:00
scrape_batteries.py Initial import: home-battery ROI simulator + cracked thuisbatterijgids calc 2026-04-30 13:46:27 +02:00
timeline_inspect.py refactor: drop PV synthesis, model raw P1 net signal directly 2026-05-08 21:32:59 +02:00