implmemtace cuttoff genportu
Some checks failed
CI and deploy / migration-check (push) Failing after 9s
CI and deploy / deploy (push) Has been skipped

This commit is contained in:
Dusan Vojacek
2026-04-20 10:41:10 +02:00
parent d8dbb284fd
commit b8515f30df
15 changed files with 265 additions and 5 deletions

View File

@@ -0,0 +1,9 @@
-- Feature flag: řízení microinverter export cutoff přes Deye Modbus (GEN / AC coupling).
-- Použito pro instalace typu BA81, kde při BLOCK_EXPORT (sell_price < 0) musíme odpojit / zakázat export z MI na GEN portu.
alter table ems.asset_inverter
add column if not exists deye_gen_microinverter_cutoff_enabled boolean not null default false;
comment on column ems.asset_inverter.deye_gen_microinverter_cutoff_enabled is
'Pokud true, EMS při BLOCK_EXPORT přepíná Deye reg 179 (Control board special 1) bits01 pro MI export cutoff na GEN portu.';

View File

@@ -0,0 +1,10 @@
-- BA81: při BLOCK_EXPORT (sell_price < 0) je potřeba aktivovat „MI export to Grid cutoff“.
-- EMS to řeší přes Deye reg 179 bits 01 (masked RMW) pouze když je tento feature flag zapnutý.
update ems.asset_inverter ai
set deye_gen_microinverter_cutoff_enabled = true
from ems.site s
where s.id = ai.site_id
and s.code = 'BA81'
and ai.code = 'deye-main';

View File

@@ -0,0 +1,10 @@
-- Explicitní flag pro řízení odpojení GEN portu (mikroinvertory / AC coupling) v daném slotu.
-- Použito hlavně u BA81: při záporné výkupní ceně a očekávaném přebytku nechceme exportovat, takže solver může zvolit cut-off.
alter table ems.planning_interval
add column if not exists deye_gen_cutoff_enabled boolean;
comment on column ems.planning_interval.deye_gen_cutoff_enabled is
'True = v daném slotu odpojit GEN port (MI export cutoff) přes Deye reg 179 bits01.
NULL = lokalita / instalace GEN cut-off nepoužívá nebo flag není relevantní.';