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!
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.
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.
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:
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.
Or skip doing the Grafana transformation and instead rewrite your InfluxQL query to include the spread function. More here.