implementace co nejdrive dosazeni SOC na home-01 a umozneni plneho socu n slotu ped koncem sell < 0
Some checks failed
CI and deploy / migration-check (push) Failing after 13s
CI and deploy / deploy (push) Has been skipped

This commit is contained in:
Dusan Vojacek
2026-05-26 08:07:00 +02:00
parent 8494ea26de
commit 91a9bef3d7
10 changed files with 566 additions and 25 deletions

View File

@@ -0,0 +1,35 @@
-- Fázované SoC a curtail v okně sell < 0 (plánovač v32).
alter table ems.asset_battery
add column if not exists planner_neg_sell_prep_soc_percent numeric(5, 2) not null default 80;
alter table ems.asset_battery
add column if not exists planner_neg_sell_full_soc_tail_slots int not null default 4;
alter table ems.asset_battery
add column if not exists planner_neg_sell_vent_min_sell_czk_kwh numeric;
comment on column ems.asset_battery.planner_neg_sell_prep_soc_percent is
'Cíl SoC (%) v hlavní části denního okna sell<0 (ASAP nabít z FVE). 100 = legacy (tlak na soc_max až na konci). Realizace škrcení A přes plánovaný pv_a_curtailed_w → Deye reg 340.';
comment on column ems.asset_battery.planner_neg_sell_full_soc_tail_slots is
'Počet 15min slotů před koncem denního úseku sell<0 (Europe/Prague), kdy LP rampuje cíl SoC na soc_max. 0 = bez tail fáze (legacy).';
comment on column ems.asset_battery.planner_neg_sell_vent_min_sell_czk_kwh is
'V tail fázi: dobrovolný ventil pole B (ge_pv) jen pokud effective sell >= tato hodnota (Kč/kWh). NULL = vent jen při plné baterii (stávající w_pv_b_vent).';
update ems.asset_battery ab
set
planner_neg_sell_prep_soc_percent = 80,
planner_neg_sell_full_soc_tail_slots = 4,
planner_neg_sell_vent_min_sell_czk_kwh = -1.0
from ems.site s
where ab.site_id = s.id
and s.code = 'home-01';
update ems.asset_battery ab
set planner_neg_sell_prep_soc_percent = 100
from ems.site s
join ems.site_grid_connection sgc on sgc.site_id = s.id
where ab.site_id = s.id
and coalesce(sgc.block_export_on_negative_sell, false) = true;

View File

@@ -72,7 +72,10 @@ begin
'planner_daytime_charge_target_enabled', coalesce(ab.planner_daytime_charge_target_enabled, true),
'planner_night_baseload_buffer_percent', coalesce(ab.planner_night_baseload_buffer_percent, 20::numeric),
'planner_daytime_charge_price_quantile', coalesce(ab.planner_daytime_charge_price_quantile, 0.70::numeric),
'planner_charge_commitment_penalty_czk_kwh', coalesce(ab.planner_charge_commitment_penalty_czk_kwh, 0.20::numeric)
'planner_charge_commitment_penalty_czk_kwh', coalesce(ab.planner_charge_commitment_penalty_czk_kwh, 0.20::numeric),
'planner_neg_sell_prep_soc_percent', coalesce(ab.planner_neg_sell_prep_soc_percent, 80::numeric),
'planner_neg_sell_full_soc_tail_slots', coalesce(ab.planner_neg_sell_full_soc_tail_slots, 4),
'planner_neg_sell_vent_min_sell_czk_kwh', ab.planner_neg_sell_vent_min_sell_czk_kwh
)
into v_b
from ems.asset_battery ab