Created
May 24, 2025 15:00
-
-
Save h3xagn/29566e19bb63cc82a87b598e1c068782 to your computer and use it in GitHub Desktop.
Data queries for Grafana dashboard tiles
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -- TimeScaleDB | |
| SELECT | |
| time_bucket('180 seconds', bucket) AS agtime, | |
| AVG(avg) as "lab_indoor_temp" | |
| FROM | |
| timeseries_60s | |
| WHERE | |
| $__timeFilter("bucket") AND | |
| tagname = 'lab_indoor_temp' | |
| GROUP BY agtime | |
| ORDER BY agtime ASC | |
| -- InfluxDB | |
| SELECT | |
| DATE_BIN(INTERVAL '180 seconds', time) AS time, | |
| avg(value) AS 'lab_indoor_temp' | |
| FROM homedb | |
| WHERE | |
| time >= $__timeFrom | |
| AND time <= $__timeTo | |
| AND sensor = 'lab_indoor_temp' | |
| GROUP BY 1 | |
| ORDER BY 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment