diff --git a/db/routines/R__043_fn_pv_forecast_correction_factor.sql b/db/routines/R__043_fn_pv_forecast_correction_factor.sql index e9250b4..d8a848a 100644 --- a/db/routines/R__043_fn_pv_forecast_correction_factor.sql +++ b/db/routines/R__043_fn_pv_forecast_correction_factor.sql @@ -18,7 +18,8 @@ declare v_factor numeric := 1.0; v_clamped boolean := false; begin - select coalesce(sum(ti.pv_power_w) * 0.25 / 1000.0, 0) + -- Telemetrie je 1min (avg power). Energie v kWh ≈ sum(W) * (1/60 h) / 1000. + select coalesce(sum(ti.pv_power_w) / 60.0 / 1000.0, 0) into v_actual from ems.telemetry_inverter ti where ti.site_id = p_site_id