Forever increasing sensor resetting

So it seems that some of my shelly devices keep resetting their energy sensors making my influx graphs totally messed up… They should be forever increasing. Instead I get negative values in my graphs because they calculate difference per month

is there any simple way of making a template that only increases in value? I’ve seen a few ppl doing it with input number and a lot of code. But it just seems like a pain doing all that.

Energy sensor looks like this

Use the sensor in a utility meter helper without a cycle defined. That will always increase.

Or use a monthly cycle if that is what you are interested in.

That sounds great, I will give it a go!

Would it also be possible to manually enter current values of those new utility_meter sensors? That way I would have a way of renaming them and switching them out in influx. That would keep the current value and prevent breaking the current differential calculations in the monthly FluxQL graphs!

The only “problem” with influx is that it relies on the whole historical chain of changes to calculate the historical months correctly… And it happens that some sensors in HA go wild and create a crazy value… Best would be to create a pass filter and after that create a utility_meter… Kinda sad to have to do so much for something that should just work.

Yes there is a utility meter calibrate service you can run from Developer Tools → Services (or in an automation or script).

That’s great, Thanks!