mirror of
https://github.com/ckaczor/HomeMonitor.git
synced 2026-01-14 01:25:38 -05:00
21 lines
553 B
Plaintext
21 lines
553 B
Plaintext
SELECT
|
|
time_bucket('@BucketMinutes minute', time) AS bucket,
|
|
name,
|
|
ROUND(avg(temperature), 2) AS averageTemperature,
|
|
ROUND(avg(pressure), 2) AS averagePressure,
|
|
ROUND(avg(humidity), 2) AS averageHumidity,
|
|
ROUND(avg(luminance), 2) AS averageLuminance,
|
|
ROUND(avg(gas_resistance), 2) AS averageGasResistance,
|
|
ROUND(avg(color_temperature), 2) AS averageColorTemperature,
|
|
ROUND(avg(air_quality_index), 2) AS averageAirQualityIndex
|
|
FROM
|
|
reading
|
|
WHERE
|
|
time BETWEEN @Start AND @End
|
|
GROUP BY
|
|
bucket,
|
|
name
|
|
ORDER BY
|
|
bucket ASC,
|
|
name;
|