How to calculate yearly energy costs with changing tariffs?

Hi all,

I’ve been searching the forum for an answer to my question, but haven’t found it. Hopefully someone can help me.

Like many others I want to calculate my daily, monthly and yearly energy costs. So to calculate usage I use utility_meter with peak and off_peak and to calculate costs I have multiple template_sensors. This works fine when tariffs don’t change, but when they do, I run into a simple issue.

Let’s say I want to calculate my yearly energy costs when the price for a kWh is €1 January-May and €2 June-December. If I multiply the yearly usage by the current tariff, then the usage of the entire year will be multiplied by €2, which of course it shouldn’t. I’m sure there is a simple solution, but I don’s see it. Anyone who can help me?

1 Like

Got the same problem. Our electricity provider changes tariffs every year.

Good to know I’m not alone in this… The only “solution” I’ve come up with is creating multiple template sensors for each tariff period and another sensor to add them for total yearly costs. Not perfect…

The statistics calculate the current cost every 5 minutes based on the current price at this time.

You can see the accumulated cost for any intervall in the energy dashboard.

Thanks. The thing is, I don’t want to use the energy dashboard. I want to calculate the accumulated costs myself, so what to do then?

Lucky you, here they change every hour (NOT joking)

You could get the desired information from the statistics table in the recorder database with an sql-sensor.