queries and migrations
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful

This commit is contained in:
2024-01-03 20:57:26 +01:00
parent 956d1bdcdb
commit c54b335e5f
7 changed files with 200 additions and 11 deletions

View File

@ -3,13 +3,7 @@ create or replace view power_v as
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,
device
from measurements
where application = 'com-passavant-geiger-poc' and
attributes->>'FPort' = '1';
create or replace view power_factor_v as
select time,
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,