Hi,
I am using the following sensor to calculate the daily cost of my electricity usage and include the standing charge (this works fine):
total_daily_cost:
friendly_name: "Electricity Cost Today"
device_class: monetary
unit_of_measurement: GBP
icon_template: mdi:currency-gbp
value_template: >
{{ '%0.2f' |format (states('sensor.daily_import_octo_peak') | float * 0.3396 +
states('sensor.daily_import_octo_off_peak') | float * 0.075 +
(0.4826)
| round(2)) }}
I am then however using Utility Meter to add this up on a daily basis into a monthly cost, but utility meter doesent seem to capture the standing charge:
Any Ideas?
Thanks in advance
What’s the formula for your month to date cost calculation?
or are you saying you use the total_daily_cost as a source sensor for a utility meter?
Yes exactly that - just using the inbuilt utility meter helper to total up each day for the month. Ive done the same with the rest of the MTD calcs but they are obviously in kWh not GBP (which i guess is my issue)
Yeah I was wondering this but it’s not perfectly clear in the utility meter docs, it just says (e.g., energy, gas, water, heating).
Which isn’t conclusive, but could indeed be the issue.
In my setup i create another sensor for the monthly cost. Yours could be something like:
total_monthly_cost:
friendly_name: "Electricity Cost Monthly"
device_class: monetary
unit_of_measurement: GBP
icon_template: mdi:currency-gbp
value_template: >
{{ '%0.2f' |format (states('sensor.monthly_import_octo_peak') | float * 0.3396 +
states('sensor.monthly_import_octo_off_peak') | float * 0.075 +
(0.4826 * now().day)
| round(2)) }}
Thank you!
I now get the following:
Is this the full month’s worth of standing charges + consumption since i set the utility meter up (yesterday)?
i.e. should (0.4826 * now().day) be doing 0.4826 x 28?
Something seems a little out but definitely closer:
(0.4826 x 28) + 1.92 = £15.43 (whereas the dash is reporting £14.98)
Many thanks
Mike
Ignore this - i have just answered my own question!
18.7 x 0.075 = 1.40
0.2 x 0.3396 = 0.07
= 1.47
(0.4826 x 28) + 1.47 = £14.98
Thanks again!
Yep the 1.92 already included one daily fee.
And yes it will be inaccurate this month due to it being new. Next month it will be correct and add the daily charge at midnight