Changing the point in time a GROUP BY takes effect InfluxDB

I’m displaying energy usage stored in InfluxDB. I want to have a bar graph, that displays how much energy was used per day. I already have a graph which uses SELECT derivative (24h) and GROUP BY time (24h) to display a single measurement per 24-hour timeframe.

However, the point in time from when this is calculated is inconvenient. For example, the timecode for the latest bar in the bar graph is 2017-10-23 02:00:00. The day always “rolls over” at 00:00 UTC, it seems (I’m in Germany and we have summertime, so the UTC offset is +2).

So, my question is: How do I change the exact point in time where the GRPOUP BY time(24h) starts grouping? I obviously want it to be 12 midnight and not 2 AM.

Currently my query looks like this:
SELECT derivative(mean("DataRecord_0_Value"), 24h) / 1000 FROM "MBusData_mbus" WHERE ("SlaveInformation_Id" = '6054930') AND $timeFilter GROUP BY time(24h)

Not sure, but maybe there is something about this in the InfluxDB docs

Maybe something in this thread would help: Wrong value in graph with bars

InfluxDB has offsets for Group by time and a tz function. Grafana has a dashboard setting for UTC/local time taken from browser as well that might affect the times.

1 Like

Fur future readers: the solution presented in that thread was exactly what I was searching for. The ‘group by’ function gave a timeshift, related to the timezone I’m in. See this post: Wrong value in graph with bars - #34 by nicp