Compare commits
1 Commits
Author | SHA1 | Date | |
---|---|---|---|
1dbe656681
|
11
queries/saerbeck.sql
Normal file
11
queries/saerbeck.sql
Normal file
@ -0,0 +1,11 @@
|
||||
create or replace view badesee_temperature_v as
|
||||
select time,
|
||||
cast(values->'Temp_Red'->>'value' as float) as Temp1,
|
||||
cast(values->'Temp_White'->>'value' as float) as Temp2,
|
||||
cast(values->'Temp_Black'->>'value' as float) as Temp3,
|
||||
cast(values->'Battery'->>'value' as float) as battery,
|
||||
attributes->>'Status' as status,
|
||||
device
|
||||
from measurements
|
||||
where application = 'de-hottis-saerbeck-monitoring' and
|
||||
device = 'eui-a84041318187ec13';
|
@ -14,6 +14,7 @@ type hottisScd30Values struct {
|
||||
CO2Conc int32
|
||||
Temp int32
|
||||
Hum int32
|
||||
Bri int32
|
||||
}
|
||||
|
||||
|
||||
@ -35,6 +36,7 @@ func Parse(fPort int, _ []byte, frmPayload string, variables *map[string]databas
|
||||
var co2concentration float32 = float32(values.CO2Conc) / 100;
|
||||
var temperature float32 = float32(values.Temp) / 100;
|
||||
var humidity float32 = float32(values.Hum) / 100;
|
||||
|
||||
// log.Printf("CO2: %f, Temp: %f, Hum: %f, Status: %d", co2concentration, temperature, humidity, values.Status)
|
||||
|
||||
(*variables)["CO2concentration"] = database.VariableType {
|
||||
@ -55,6 +57,12 @@ func Parse(fPort int, _ []byte, frmPayload string, variables *map[string]databas
|
||||
Unit: "%",
|
||||
Value: humidity,
|
||||
}
|
||||
(*variables)["Brightness"] = database.VariableType {
|
||||
Label: "Brightness",
|
||||
Variable: "Brightness",
|
||||
Unit: "",
|
||||
Value: values.Bri,
|
||||
}
|
||||
|
||||
(*attributes)["Status"] = values.Status
|
||||
return nil
|
||||
|
Reference in New Issue
Block a user