fix(optimization): say why the terminal value fell back to the fixed scalar

A run whose price forecast is all zeros produces no priced residual load,
so AUTO cannot derive a curve and quietly credits the request scalar
instead. The reported mode was then "FIXED" - indistinguishable from a
run actually configured that way.

The solution now carries a reason, and the fallback is logged as a
warning instead of passing unnoticed.
This commit is contained in:
Andreas
2026-09-04 11:23:35 +02:00
parent 1c10ab83ad
commit 3074018bed
4 changed files with 56 additions and 4 deletions
+3
View File
@@ -511,6 +511,9 @@ be unreachable. `deadline_policy` decides what happens then:
- `curve.energy_wh` / `curve.value_euro`: breakpoints of the value curve
- `curve.marginal_euro_per_kwh`: slope of each segment, monotonically decreasing
- `curve.window_slots`: how many trailing horizon slots the curve was derived from
- `reason`: why that mode applied. Empty in `AUTO` mode. In `FIXED` mode it distinguishes a
configured `FIXED` from an `AUTO` run that found no priced residual load in its window - the
latter is nearly always an all-zero price forecast in the request.
With direct marketing enabled, `dc_charge = 1` and `discharge_allowed = 1` may occur together. This
is the normal self-consumption mode: within a coarse optimization slot, the battery may cover