36 lines
1.6 KiB
SQL
36 lines
1.6 KiB
SQL
-- 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;
|