Wolfgang Hottgenroth c54b335e5f
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
queries and migrations
2024-01-03 20:57:26 +01:00

15 lines
686 B
SQL

create or replace view power_v as
select time,
cast(values->'ActivePowerL1'->>'value' as float) as power_l1,
cast(values->'ActivePowerL2'->>'value' as float) as power_l2,
cast(values->'ActivePowerL3'->>'value' as float) as power_l3,
cast(values->'ActivePowerL123'->>'value' as float) as power_total,
cast(values->'PowerfactorL1'->>'value' as float) as factor_l1,
cast(values->'PowerfactorL2'->>'value' as float) as factor_l2,
cast(values->'PowerfactorL3'->>'value' as float) as factor_l3,
device
from measurements
where application = 'com-passavant-geiger-poc' and
attributes->>'FPort' = '1';