This seems to return the correct value and so I intended to feed to two utility meters to track the daily and monthly spend:
##### Octopus Go - Cost Meters
octo_go_daily_cost:
source: sensor.octopus_daily_cost
name: Octopus Go Daily Cost
cycle: daily
octo_go_monthly_cost:
source: sensor.octopus_daily_cost
name: Octopus Go Monthly Cost
cycle: monthly
It is the value of the utility meters that I’m unsure about. Can anyone suggest why, when the source to the utility meters is £0.68 presently, the meters are reporting £0.19?
Both are rising steadily, but I would have expected the meter to start with the standing charge cost (£0.49) and increase with the subsequent usage. Have I misunderstood?
Thank you soooooooo much!!! You’ve helped me solve something that’s been pestering me for months which I’ve been constantly returning to every so often to figure out a solution.
Since getting my electricity and gas smart meter installed I’ve been really struggling with this one. Before when I had a CT clamp I was able to just make a template sensor which was simple enough.
When I got the smart meter and the total cost for the day already included the standing charge I was delighted to drop the template sensors. However then I came to find/figure out that the utility meter only updates when there is a delta to the previous value as supposed to always updating with the current state at the given time intervals set.
This isn’t an issue with the electricity however for gas I have far more days when I use zero gas and this results in the daily gas cost just sticking at the standing charge cost. Which as we know the utility meter does not pick up and my totals just stay at the previous days values.
Thanks to your suggestion of using the utility_meter.calibrate service it sparked a solution in my head. Just before midnight if the imported gas volume is zero I can use that service call to update the utility meters with the standing charge.
alias: Utility Meter - Gas Standing Charge Correction
description: >-
Correct gas weekly and monthly utility meters with standing charge when zero
gas used for the day
trigger:
- platform: time
at: "23:57:00"
condition:
- condition: state
entity_id: sensor.smart_meter_gas_import_vol_today
state: "0.0"
action:
- service: utility_meter.calibrate
data:
value: >-
{{ (states('sensor.gas_cost_weekly') |float(0) +
states('sensor.smart_meter_gas_import_standing_charge') | float(0)) |
round(2) }}
target:
entity_id:
- sensor.gas_cost_weekly
- service: utility_meter.calibrate
data:
value: >-
{{ (states('sensor.gas_cost_monthly') |float(0) +
states('sensor.smart_meter_gas_import_standing_charge') | float(0)) |
round(2) }}
target:
entity_id:
- sensor.gas_cost_monthly
mode: single
Very much appreciated for helping give me that spark for what was needed to solve this one.