I’m tracking my energy usage, amongst which a heat meter measuring usage in Joule. I want to calculate the heating power (in Watt), which works well with the DERIVATIVE()
function.
The problem is that the derivative is returned on the latter of two timestamps describing the data, which when combined with the staircase plot of Grafana shows the derivative for the next time delta instead of the current.
How can I:
- Make Influxdb show the derivative on the first timestamp of the data? (Or alternatively: shift timestamps of a query?)
- Make Grafana plot staircase graphs extending the value left instead of right?
Graphical example
Textual example
The following heat meter readings in influxdb
08:00, 0 Joule
09:00, 3600 Joule
19:00, 7200 Joule
will give
09:00, 1.0 Watt (which refers to 08:00-09:00)
18:00, 0.1 Watt (which refers to 09:00-18:00)
which Grafana (as staircase) will plot as
08:00-09:00, Null (should be 1.0)
09:00-18:00, 1.0 (should be 0.1)
18:00-, 0.1 (should be Null)