I am experiencing some issues with my utility meters.
I created a template sensor that counts all my measured plugs, so I can see the daily usage of all my devices.
This sensor is used with my daily, weekly, monthly and yearly utility meters.
However, when I restart my HA (happens often ), after the restart the utility meter is now longer displaying the corrent value (it is always higher then the actual power usage).
I tested this by restarting HA today, and can see the following:
This screenshot was taken right after the reload, and as you can see, the difference between “Power Consumption Total” and Daily Energy Usage" is rather large.
Does any of you have an idea what might be causing this ?
Exactly the same issue with my sonoff pow sensors, flashed with tasmota. I believe that the problem was described a few times, but with no actual resolution till now.
I`m planning to open an issue in Utility meter GitHub. Two weeks ago I’ve write in a thread Daily energy monitoring about the same problem, but the solution doesn’t help me. Still waiting for help.
Its happening the same to me, is there any solution for this? after rebooting HA, utility meter doesnt retain last value, it seems its getting last data directly from sensor.
Gents, after some research i changed my sensor value_template to string ( before was float), but my total power consumption still getting high values after reboot.
my workaround was getting current power (watts) and send this to integration template, this template calculates energy consumption (kWh or Wh) creating other sensor.
Then i send this value after integration sensor to utility_meter. as the sensor is always getting current value and not stored kWh from cloud or whatever, it doesnt get anything you dont want.
thats my config.
this sums 2 clamp meters and gives me total current power:
I have similar (?) issues. Although I was able to limit them to only happening when I restart Hass when there is no sun (i.e. solar panel sensors are unavailable)
I also have the suspect that at boot some sensor maybe unavailable until after utility meter has started… But if it is the case it would be needed a delay at boot that prevent utility meter to refer to unavailable sensors readings.
I am using Shelly 3EM through MQTT, and finally I have used following code to clear out the problem of getting unavalaible / unknown state of total power meter converted to 0 on restart:
The availability_template is not very clever, hopefully I could merge the unvailable and unknown for each sensor into one line, but it works for now. It prevents getting the state of 0 after converting those states after reset.