Grafana and InfluxDB question of a special calculation

Dear forum,

I am using Grafana and InfluxDB to visualise my heatpump temperatures which is for me important to know since I want to fine tune the heatpump settings itself.
Currently I have around 2 starts of the compressor for the warm water service per day. If you look at the 24h graph you can directly see the 2 peaks , see screenshot:

My question is now how I could calculate these peaks and display as a singlestat for example.
The preconditions are:

  • values above 50°C
  • peaks are usually within a time scale of 2h

I tried something like this

SELECT derivative(count("value"), 2h) FROM "autogen"."HeatPump_Temperature_Supplay" WHERE ("value" > 50) AND $timeFilter GROUP BY time(24h) fill(null)

but derivative() leads me to a wrong value.
Does someone have an idea? Maybe I am too blind and don’t see the wood for the trees.
I am sure there is a more simple solution :wink:

Cheers

Have you asked influx or grafana forums/help desk?

No but maybe you are right that this would be a better choice. Thanks