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

@ -45,6 +45,13 @@ create or replace view temperature_v as
from measurements
where application in ('Temperature Multisensor', 'Temperature Shelly Plus HT');
create or replace view temperature2_v as
select time,
cast(values->'Value'->>'value' as float) as temperature,
device
from measurements
where application = 'Temperature Wago';
create or replace view humidity_v as
select time,
cast(values->'Value'->>'value' as float) as humidity,
@ -52,3 +59,11 @@ create or replace view humidity_v as
from measurements
where application in ('Humidity Multisensor');
create or replace view soil_v as
select time,
cast(values->'Water'->>'value' as float) as water,
cast(values->'Conductance'->>'value' as float) as conductance,
cast(values->'Temperature'->>'value' as float) as temperature,
device
from measurements
where application = 'de-hottis-app01' and attributes->>'DeviceType' = 'dragino-lse01';