From 466c15fa84da4973c47712da4becd5632db742d9 Mon Sep 17 00:00:00 2001 From: Dusan Vojacek Date: Fri, 12 Jun 2026 00:14:15 +0200 Subject: [PATCH] =?UTF-8?q?Baz=C3=A9n:=20V085=E2=86=92V087=20(out-of-order?= =?UTF-8?q?=20po=20V086)=20+=20seed=20Shelly=20Plug=20S=20Gen3=20home-01?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit V088: endpoint shelly_http 172.16.1.15 + asset pool-pump-1 (rated 600 W odhad — upřesní telemetrie; 480 min/den letní filtrace; schedulable=false = telemetry-only start, ovládání signálem POOL_PUMP_ON po ověření). Co-Authored-By: Claude Opus 4.8 (1M context) --- ..._pool_shelly.sql => V087__pool_shelly.sql} | 0 db/migration/V088__seed_pool_home01.sql | 35 +++++++++++++++++++ 2 files changed, 35 insertions(+) rename db/migration/{V085__pool_shelly.sql => V087__pool_shelly.sql} (100%) create mode 100644 db/migration/V088__seed_pool_home01.sql diff --git a/db/migration/V085__pool_shelly.sql b/db/migration/V087__pool_shelly.sql similarity index 100% rename from db/migration/V085__pool_shelly.sql rename to db/migration/V087__pool_shelly.sql diff --git a/db/migration/V088__seed_pool_home01.sql b/db/migration/V088__seed_pool_home01.sql new file mode 100644 index 0000000..4c6f9f5 --- /dev/null +++ b/db/migration/V088__seed_pool_home01.sql @@ -0,0 +1,35 @@ +-- Seed bazénového čerpadla home-01: Shelly Plug S Gen3 na 172.16.1.15 (VPN). +-- Telemetry-only start (schedulable=false): nejdřív měříme, ovládání signálem +-- POOL_PUMP_ON zapneme po ověření telemetrie. rated_power_w je odhad — skutečný +-- příkon ukáže telemetrie (apower), pak upřesnit. + +insert into ems.site_endpoint ( + site_id, endpoint_type, host, port, protocol, unit_id, enabled, notes +) +select s.id, 'shelly_http', '172.16.1.15', 80, 'http', null, true, + 'Shelly Plug S Gen3 – bazénové čerpadlo (Gen2+ RPC).' +from ems.site s +where s.code = 'home-01' + and not exists ( + select 1 from ems.site_endpoint se + where se.site_id = s.id and se.host = '172.16.1.15' + ); + +insert into ems.asset_pool_pump ( + site_id, code, manufacturer, model, endpoint_id, shelly_switch_id, + rated_power_w, min_run_min, daily_runtime_min, schedulable, notes +) +select + s.id, 'pool-pump-1', 'Shelly', 'Plug S Gen3', se.id, 0, + 600, -- odhad; upřesnit dle telemetrie (Shelly apower) + 15, + 480, -- 8 h/den (letní filtrace); zimní profil = follow-up + false, -- telemetry-only; ovládání po ověření + 'Bazénové čerpadlo přes Shelly Plug S Gen3. Ovládání: signal POOL_PUMP_ON (fn_signal_enqueue_bool), zatím vypnuto.' +from ems.site s +join ems.site_endpoint se on se.site_id = s.id and se.host = '172.16.1.15' +where s.code = 'home-01' + and not exists ( + select 1 from ems.asset_pool_pump p + where p.site_id = s.id and p.code = 'pool-pump-1' + );