nastavitelny max sollar dle stridace (ulozeno v DB)
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-25 11:25:29 +02:00
parent e06f76b9ff
commit c6074e9c74
13 changed files with 101 additions and 17 deletions

View File

@@ -0,0 +1,33 @@
-- Reg 340 (max solar power): strop dle výkonu střídače, ne součtu Wp polí; min dle firmware.
alter table ems.asset_inverter
add column if not exists deye_reg340_max_solar_w int,
add column if not exists deye_reg340_min_solar_w int not null default 0;
comment on column ems.asset_inverter.deye_reg340_max_solar_w is
'Horní strop zápisu Deye reg 340 (max solar power, W). Studené panely mohou překročit součet Wp — použít plný DC limit střídače (např. 32000 home-01, 65000 větší hybridy). NULL = fallback max_dc_input_w, pak součet Wp řiditelných polí.';
comment on column ems.asset_inverter.deye_reg340_min_solar_w is
'Minimální hodnota reg 340 přijatá firmwarem střídače (W). 0 = bez spodního limitu; starší Deye (home-01) často 400.';
-- home-01: SUN-20K, reg 340 max 32 kW, firmware min 400 W
update ems.asset_inverter inv
set
deye_reg340_max_solar_w = 32000,
deye_reg340_min_solar_w = 400
from ems.site s
where s.id = inv.site_id
and s.code = 'home-01'
and inv.code = 'deye-main'
and inv.controllable = true;
-- Ostatní řízené Deye hybridy: 65 kW strop, min 0 (novější firmware)
update ems.asset_inverter inv
set
deye_reg340_max_solar_w = coalesce(inv.deye_reg340_max_solar_w, 65000),
deye_reg340_min_solar_w = 0
from ems.site s
where s.id = inv.site_id
and s.code <> 'home-01'
and inv.code = 'deye-main'
and inv.controllable = true
and inv.active = true;