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

This commit is contained in:
2023-12-05 13:31:42 +01:00
parent 57ebd76849
commit 1d947b7676
4 changed files with 261 additions and 0 deletions

25
queries/hottis.sql Normal file
View File

@ -0,0 +1,25 @@
create or replace view pv_power_v as
select time,
cast(values->'PowerActive'->>'value' as float) as power,
values->'Status'->>'status' as status,
device
from measurements
where application = 'PV';
create or replace view pv_total_import_v as
select time,
cast(values->'Power'->>'value' as float) as power,
device
from measurements
where application = 'Power' and
device = 'Total' and
attributes->>'Status' = 'Ok';
create or replace view power_v as
select time,
cast(values->'Power'->>'value' as float) as power,
device
from measurements
where application = 'Power' and
attributes->>'Status' = 'Ok';