Utility meter ignores tracked sensors increases after restart
See original GitHub issueThe problem
I have a daily utility meter that counts the energy produced by my solar panels. The meter uses as a source a template sensor with state_class: "total_increasing".
The problem is that if for any reason HA is stopped and then restarted, the amount of energy produced when HA was off is not counted by the utility meter, it just resume counting adding to the last reading before HA was shut down. The source sensor instead shows the correct count, taking into account all the energy produced when HA was off. I am pretty sure that this was working fine a couple of months ago.
Here’s the forum post with pictures and configuration: https://community.home-assistant.io/t/utility-meter-skipping-counts-on-total-increasing-sensors/426566
What version of Home Assistant Core has the issue?
2022.5.2
What was the last working version of Home Assistant Core?
No response
What type of installation are you running?
Home Assistant OS
Integration causing the issue
Utility Meter
Link to integration documentation on our website
https://www.home-assistant.io/integrations/utility_meter/
Diagnostics information
No response
Example YAML snippet
No response
Anything in the logs that might be useful for us?
No response
Additional information
No response
Issue Analytics
- State:
- Created a year ago
- Comments:18 (5 by maintainers)

Top Related StackOverflow Question
True, also for my source sensor by the way, but you can fix the source sensor upstream with a template for example, that’s what I did.
Thanks for confirming this! I’ll have a look at the code 😃
@jrlacharnay I like the idea of the extra options. My smart meter is an ESP32 with 2 IR sensors. Unfortunately, the ESP32 regularly loses the connection because it is in the basement. After that, the Weekly and Daily Utility Meter values are always wrong, although the total consumption is correct.