diff --git a/db/migration/V102__heat_pump_site_fix.sql b/db/migration/V102__heat_pump_site_fix.sql new file mode 100644 index 0000000..648a8d0 --- /dev/null +++ b/db/migration/V102__heat_pump_site_fix.sql @@ -0,0 +1,19 @@ +-- Samsung EHS fyzicky stojí v home-01 (převodník 172.16.1.17 v LAN home-01, +-- MIM adresa 5, živě ověřeno 2026-06-12), ale seed ho přiřadil KV1 (site 4). +-- Kvůli tomu V096/V101 (where s.code='home-01') nic neaktualizovaly a +-- telemetrie TČ nikdy netekla; KV1 solver navíc plánoval s neexistujícím TČ. + +update ems.asset_heat_pump + set site_id = (select id from ems.site where code = 'home-01') + where code = 'hp-samsung' + and site_id = (select id from ems.site where code = 'KV1'); + +-- endpoint TČ: skutečný Waveshare home-01 (viz V096/V101, které mířily mimo) +update ems.site_endpoint e + set host = '172.16.1.17', + port = 502, + unit_id = 5, + notes = 'Waveshare RS485 TO POE ETH (B) pro Samsung EHS přes MIM-B19N(T); 9600 8E1, Modbus TCP to RTU, adresa MIM 5 (V102).' + where e.id = ( + select hp.endpoint_id from ems.asset_heat_pump hp where hp.code = 'hp-samsung' + );