I have a database of weather and my heating system data.
I’m trying to make a query that would return historical heating data for a certain outside temperature. I have this working with a pre-selected temperature in the query, but how do I reference the current temperature in the historical query?
So I would like to do this:
get mean of historical heating data where temp = currentTemp.
I couldn’t make this work.
Is there a way of storing variables in Grafana? and use them? So i could store $currentTemp and use that in the query.
My historical query looks like this now:
SELECT mean("extfram") FROM "modbus" WHERE utemp<-25 AND $timeFilter GROUP BY time($__interval) fill(null)
So it is the “utemp<-25” that I would like to replace with the current fetched temperature from the database.
Help!