Align evening push with peak-band candidates and dynamic Wh budget.
Some checks failed
CI and deploy / migration-check (push) Failing after 23s
CI and deploy / deploy (push) Has been skipped

Restore _evening_peak_export_indices filter so push slots are chosen from
profitable peak-band nights, then ranked by sell until the Wh budget is
exhausted—not all profitable night slots and not a fixed top-3. Docs and
tests match v39 SoC balance tag.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Dusan Vojacek
2026-05-29 00:10:27 +02:00
parent ba0b55bf10
commit 620a557a89
4 changed files with 23 additions and 18 deletions

View File

@@ -15,7 +15,7 @@ Formát: **datum (ISO)** · stručný důvod · soubory · chování / ověřen
**Problém:** `_evening_battery_export_push_indices` bral jen **málo slotů** v úzkém pásmu `max0,05` a při řazení podle rozpočtu mohl vynechat dražší 15min (9,5 Kč) a exportovat později levněji (4,8 Kč). `evening_early` zákaz `ge_bat` platil jen **před** prvním push slotem.
**Změna (v38):** Kandidáti = **profitable ∩ noční okno**; push = nejdražší sloty **sell desc**, dokud `kumulované_Wh ≤ push_budget` (`discharge_slot_buffer`, SoC nad `min_soc`)**žádné pevné top-3** (počet slotů závisí na SoC, typ. ~4,3 kWh/slot při 17 kW BMS, home-01 export cap 13,5 kW × 0,25 h ≈ 3,4 kWh/slot v LP). `evening_early` = `ge_bat=0` pro profitable noční sloty pod `peak0,05` mimo `evening_push_ts` (i po prvním push). Rolling **hysteresis** při malé změně peak sell / SoC.
**Změna (v38):** Kandidáti = **profitable ∩ peak pásmo v nočním okně** (`_evening_peak_export_indices`, max sell v úseku degrad — shodně s R__063); push = nejdražší **sell desc**, dokud `kumulované_Wh ≤ push_budget` (`discharge_slot_buffer`, SoC nad `min_soc`); `per_slot` = min(BMS, export cap) × účinnost × 0,25 h — **počet slotů dynamický** (např. ~40 kWh / ~3,4 kWh ≈ 11 slotů u home-01), **ne pevné top-3**. `evening_early` = `ge_bat=0` pro profitable noční sloty pod `peak0,05` mimo `evening_push_ts` (i po prvním push). Rolling **hysteresis** při malé změně peak sell / SoC. (Doplněno ve v39: stejná logika, tag `evening-export-soc-balance-v39`.)
**Soubory:** `backend/services/planning_engine.py`, `backend/tests/test_planning_dispatch_milp.py`, `docs/04-modules/planning.md`.