Correct way of defining Utility meter helper for a counter that is not continously available but maintains the correct reading?

My scenario is that I’m using a local-tuya cheap power meter that often goes offline for no obvious reasons, creating gaps in the kWh counter. it is using its own internal counter which is always accurate (even when offline, it keeps counting correctly). But since the native counter does not have required parameters sorted (last reset time is not defined), I cant use it for my energy dashboard. So I’m using utility meter. And the result is that utility meter does not “catch up” with the values registered by the meter during offline state: native meter reports correctly, but the Utility Meter helper assumes there was no change in the value during the offline stage:

Native counter:

Utility meter:

How should I use it to maintain accurate readings even when device is offline?

I’ll answer myself - Periodically resetting is the culprit. It’s set to ON by default when creating a utility counter. Must be set to OFF.

manual says:

Enable this if the source sensor state is expected to reset to 0, for example, a smart plug that resets on boot. When this option is **disabled** (for example, if the source sensor is a domestic utility meter that never resets during the device’s lifetime), the *difference* between the new value and the last valid value is added to the utility meter, **which avoids the loss of a meter reading after the source sensor becomes available after being unavailable**.

And this solves my case.