This is the new version of my old website. You can find the old website here: old.dl2sba.com. If you miss any information or you find bugs, please let me know by E-Mail

Data aggregation

Here the first step to automated data aggregation of sensor data ...

 

Aggregate all sensor for last hour

Create initial measurement

SELECT min(value), mean(value), max(value), sum(value)
INTO "sensors_1h"
FROM "sensors"
GROUP BY time(1h), nodeId, sensorId

Create CQ

CREATE CONTINUOUS QUERY "cq_sensors_1h" ON "iot" BEGIN
SELECT min(value), mean(value), max(value), sum(value)
INTO "sensors_1h"
FROM "sensors"
GROUP BY time(1h), nodeId, sensorId
END

Aggregate all sensor for last day

Create initial measurement

SELECT min(value), mean(value), max(value), sum(value)
INTO "sensors_1d"
FROM "sensors"
GROUP BY time(1d), nodeId, sensorId

Create CQ

CREATE CONTINUOUS QUERY "cq_sensors_1d" ON "iot" BEGIN
SELECT min(value), mean(value), max(value), sum(value)
INTO "sensors_1d"
FROM "sensors"
GROUP BY time(1d), nodeId, sensorId
END
(c) Dietmar Krause, DL2SBA 2026 Impressum Datenschutz
Cookies user preferences
We use cookies to ensure you to get the best experience on our website. If you decline the use of cookies, this website may not function as expected.
Accept all
Decline all
Marketing
Set of techniques which have for object the commercial strategy and in particular the market study.
Quantcast
Save