Problem
Continuous energy data should be grouped to reflect consumption per shift – starting at 03:00, then 11:00, 19:00, and so on.
Solution
With the right query, the data can be grouped into 8-hour intervals that start with a 3-hour offset. This ensures the shift times are displayed correctly instead of starting at midnight (00:00) by default.
Steps
For this example, we’re using the Graph widget – but the process works exactly the same for any other widget.
- Select your device and metric (as usual).
- Set the SELECT function to
last()
to display the last value of each interval (avoiding averages). - Optional: For continuous values, add
difference()
to visualize the energy consumed within each 8-hour interval. - In GROUP BY time, use
time(8h,3h)
:8h
= duration of each bucket3h
= start offset, shifting the beginning from 00:00 to 03:00- Result: values at 03:00, 11:00, 19:00, etc.