Hi there,

I’ve been controlling my washing machine and (this is probably the big part) my water boiler depending on the price level for a while now - and some neighbours are already asking how big my savings are.

But I’m having trouble calculating this.

The comparison value would be easy for a fixed time: get the total energy (accumulated) at end minus total energy at start and multiply with the energy cost of a comparable fixed energy tariff. Could maybe even set up a cost sensor for that.

But how do I handle the dynamic energy prices?

Manually this also looks easy:

Integrate the energy over the price (possible in discrete steps of 1hr). Has anybody done this already?

If not, how would you go about it? Are there useful integrations for this (like the integral, which I’ve seen, but not looked at in detail yet) ? Especially some, that also create values for historic values, not just from setup?

Or would you outsource this to other services (graphana? but not the calculations)

If I am to write a script or a function for this (input start/end datetime + energy sensor), how to access the historic values the best way?