Daily consumption for one day is showing one day after

Hi,
i am very new to grafana and just want to use some data provide by Homeassistant via InfluxDB.

I want to display the daily consumption from total meter sensors.
It currently looks like this:

With the following option of the Graph panel:
image


Currently the consumption for day 2023-12-29 00:00:00 is displayed at 2023-12-30 00:00:00, just shifted by one day. Is there a workaround to change this?

I also want to have the consumption for “today”, which is missing, as the date for “today” is filled with the consumption from yesterday.

Would be happy, if someone can give me some hints, thanks!

Best regards,
Dave

Welcome @glad05 to the Grafana forum.

I believe some kind soul over at InfluxDB wrote a short Bible on this topic. See here. In there, they state that the InfluxQL statement can contain an offset interval, which is the key to solving your situation, I think.

GROUP BY time(<time_interval>,<offset_interval>)

I believe you’ll have to click the pencil icon on your queries and then edit from there, as I do not see an Offset_interval box in the query GUI builder.

Hi grant2,

thanks for this hint, it was exactly what i was looking for. using an offset like -1m, will stop the day 1min befor midnight, and for that displayed at the correct day. :slight_smile:

Is there also a way, to get the consumption for the current day displayed?
For now it looks like, only a “complete day” is displayed.
now is the 31.12, and the last entry is 30.12:

Best regards,
David

Hi David,

Do you see any data if you change the time selector to this?
image

Hi grant2,

thanks, yes, there is a difference:

but i change the group by time to 12h, i get some strange numbers.

I am not sure, what i am missing here.

Best regards,
David

Yeah, those group by time (12h) values do not make any sense to me. Is Wasserzaehler a value that is always increasing, i.e. to get the quantity consumed for a given period, it would be calculated like this?

value at end of period LESS value at start of period

I ask because I see your query is using the difference() function which returns the result of subtraction between subsequent field values.

Not sure if this would work or not, but you might try to use the “last” value in your query and then use the Grafana Transformation called “range” which is the difference between the max and min values.

image

Or skip doing the Grafana transformation and instead rewrite your InfluxQL query to include the spread function. More here.

Hi grant2 and a happy new year!

thanks alot for your support, spread was exactly what i was looking for, this solved everything. :slight_smile:
Best regards,
David