#How to include fixed costs per month in energy cost calculations?

1 messages · Page 1 of 1 (latest)

rotund cedar
#

Hi everyone, so far, my searches have been semi-successful.

I want to include fixed costs per month in my energy cost calculations, and I have no idea how.

Probably the best solution was to divide the monthly costs by hours in a month and then create a helper sensor for it. Seen here: https://domoticarte.com/en/p/calculate-electricity-bill-home-assistant/#fixed-costs-price-sensor.

My energy provider (Planet B Net Zero Energy — Germany) gives me a rate per month which is fixed, and I would like to avoid errors by dividing a 30-day month by 28 days, for example.

Can I add a utility meter helper for monthly energy consumption and multiply it by the current price? Then use this and add the fixed price? That is my best idea right now, but I can see that it only takes the last current price and doesn't store price based on the hour/quarter it was consumed, right?

Moreover, I am a bit surprised, that I don't find more 'proper' solutions on this. Is this a German 'problem'?

Anyway, all help is appreciated.

domoticarte

How to use the Home Assistant energy panel to perform calculations that will allow you to visualize electricity consumption and fixed costs. Learn how to calculate your electricity bills.

#

Okay, I did some more searching here, and it seems the topic has been discussed a few times already. The conclusion is, it not being simple to calculate.

#

Is there something like a total_increasing sensor with the costs from the energy dashboard? Given such a sensor, one could use helpers to do the rest.

split forge
#

The easiest way I've found to do this is:

  1. Template sensor calculating the average cost per hour (easy to update at the start of every month)
  2. Template sensor that adds in current consumption power x cost per kWh to give total cost per hour (you can do this combined with 1, I just wanted to keep it separate)
  3. Integral helper to turn cost per hour into total cost - can be plugged in to the energy dashboard
rotund cedar
#
  1. You mean something like fixed costs / days in month / hours in day?
split forge
#

yeah basically.
I'd do something like:

{% set first_this_month = now().replace(day=1) %}
{% set first_next_month = (first_this_month + timedelta(days=32)).replace(day=1) %}
{% set month_length_in_hours = (first_next_month - first_this_month).total_seconds() // 3600 %}
{{ fixed_costs / month_length_in_hours }}
late abyss
split forge
#

He's talking about spreading a fixed cost over time so it's recorded sensibly - the cost for the energy used is separate to that

late abyss
#

You're spreading a fixed cost across all consumed energy right?

split forge
#

No

#

It's calculating a cost per hour not cost per energy

late abyss
#

Ok

rotund cedar
#

@late abyss would it be possible to return the calculated cost (from the energy dashboard) back as a sensor? It records per hour, is that correct?

#

@split forge thank you for the help! However, I was indeed hoping for a solution where I didn't need to split the fixed costs per hour.

late abyss
#

Costs are stored in _cost sensors, so after adding the integral sensor to the dashboard you will be able to access that

late abyss
#

The energy dashboard is not meant to be used for administration

rotund cedar