-
What Grafana version and what operating system are you using?
V9.2.4 as an Home Assistant add-on running on Debian with InfluxDB v1.8.9. as docker on Synology NAS using influxQL. -
What are you trying to achieve?
Use a subquery to sum measurements and then aggregate/group by 1 hour -
How are you trying to achieve it?
SELECT max("SOU") + max("GF") + max("US") + max("GUEST") FROM
( SELECT max("value") AS "SOU" FROM "kW" WHERE ("entity_id" = 'heater_meters_sou_power') AND $timeFilter GROUP BY time(1m) fill(null) ),
( SELECT max("value") AS "GF" FROM "kW" WHERE ("entity_id" = 'heater_meters_gf_power') AND $timeFilter GROUP BY time(1m) fill(null) ),
( SELECT max("value") AS "US" FROM "kW" WHERE ("entity_id" = 'heater_meters_us_power') AND $timeFilter GROUP BY time(1m) fill(null) ),
( SELECT max("value") AS "GUEST" FROM "kW" WHERE ("entity_id" = 'heater_meters_guest_power') AND $timeFilter GROUP BY time(1m) fill(null) )
GROUP BY time(10m) fill(null)
Using other fill() options does not help.
-
What happened?
On 14:33 it can be seen that the sum of the 4 values is 16.3, which is the highest in that hour.
Still, on 14:30 the aggregated sum value is 20.7. -
What did you expect to happen?
That the sum value shows 16.3.
Or, that I understand what I’m doing wrong -
Can you copy/paste the configuration(s) that you are having problems with?
See above. -
Did you receive any errors in the Grafana UI or in related logs? If so, please tell us exactly what they were.
No. -
Did you follow any online instructions? If so, what is the URL?
No.
Any help is greatly appreciated!
(PS I have searched, but couldn’t find an existing topic)