fix rezani pv a
This commit is contained in:
@@ -1290,6 +1290,20 @@ def _build_setpoints(
|
||||
forecast = int(pi.get("pv_a_forecast_solver_w") or 0)
|
||||
curtail = int(pi.get("pv_a_curtailed_w") or 0)
|
||||
pv_a_allowed = compute_pv_a_reg340_max_solar_w(int(pv_a_cap_w), forecast, curtail)
|
||||
# Home-01 strategie: pokud jsou zároveň buy<0 i sell<0 a PV B vyrábí (necurtailable),
|
||||
# chceme držet baterii „prázdnější“ pro PV B / další záporný nákup a PV A raději odstavit
|
||||
# i když forecast PV A je nulový (predikce/telemetrie může být odpojená).
|
||||
buy_raw = pi.get("effective_buy_price")
|
||||
buy_f: float | None = float(buy_raw) if buy_raw is not None else None
|
||||
pv_b = int(pi.get("pv_b_forecast_solver_w") or 0)
|
||||
if (
|
||||
buy_f is not None
|
||||
and sell_f is not None
|
||||
and float(buy_f) < 0.0
|
||||
and float(sell_f) < 0.0
|
||||
and pv_b > 0
|
||||
):
|
||||
pv_a_allowed = 0
|
||||
return ControlSetpoints(
|
||||
battery_w=int(pi["battery_setpoint_w"] or 0),
|
||||
grid_export_limit=abs(min(grid_sp, 0)),
|
||||
|
||||
Reference in New Issue
Block a user