Compute total, ignoring intermittent unavailable states

Hi,

I have a flaky EV charger that reports “Energy session” values: the total energy (kWh) consumed in the last session. Since I’m renting the charger out, I’d like to compute the total energy. “statistical characteristic” does so, but unfortunately there’s some “double counting”, as the charger isn’t perfect. Sometimes the state becomes unavailable, then gets set to the exact previous value.

How do I avoid this? Is there another helper that I can create as an intermediary helper?

Thanks,
Stefan

As long as the state is really unavailable (not 0) then use a Utility meter. This will only count increases from valid numeric states and will ignore unavailable → some value.