Different math depending on hour (energy cost calculations on €/kWh depending on time frame)


I’ve manage to get a really nice graph of my energy consumption, but I want to go even further and see the cost of such energy, since I’m paying different prices depending on the time of the day (from 22:00 to 12:00 and from 12:00 to 22:00) I need to tell grafana such thing but I don’t really know how, and if there is a clever work around about this.

My goal is to have graphs showing what I’ve spend hourly / daily and even in the 10s time base.

Any clues?

Happy new year to all of you!


It sounds to me that you want to create a graph that is total cost, as a function of the energy consumption multiplied with the cost? Is this correct?

What are you using to store your energy consumption data? Do you already have access to the cost data? If yes, are you storing that in the same data source as the consumption data? Then you could potentially create a data source query that performs the math.

If the consumption data and cost data resides in separate data sources, it will be trickier.