How can I only display max value of each day?

Hello everyone,

I am collecting data from an energy sensor on a daily basis. This energy sensor, however, does not return one value per day but rather continuously adds wnergy consumption and then resets at midnight.

What I would like to do is see just the final maximum value of the calendar day.

My current configuration is
SELECT last(“value”) FROM “Wh” WHERE (“entity_id” = ‘daily_energy_boiler_1’) AND $timeFilter GROUP BY time($__interval) fill(none)

which gives me

The top one is the live consumption in watts and the bottom one the one I want to change (in watt hours).

Would someone help me please? I am sure Grafana with InfluxDB is easily capable of doing this, but I cannot figure it out :frowning:

Thank you
Alex

Hello @AleXSR700,
Welcome! I’m a little confused. You’re saying that the top graph is your raw data but and the bottom graph is your data after this query:

SELECT last(“value”) FROM “Wh” WHERE (“entity_id” = ‘daily_energy_boiler_1’) AND $timeFilter GROUP BY time($__interval) fill(none)

has been applied?

I fixded it already.

SELECT max("value") FROM "Wh" WHERE ("entity_id" = 'daily_energy_fridge') AND $timeFilter GROUP BY time(1d) fill(none)

Ignore entity ids. I have multiple such graphs.

What confused you? Maybe it was not clear. The two graphs are also not identical input. As shown, one is watts and one watt hours. So the bottom one is after Riemann integral.