Derivative helper Min/max setting for total_increasing sensors

I has wondering if there is a workaround or something that can be improved in the case of using derivative sensor with counter sensors that reset to 0 after a while like the total_increasing sensors.
The derivative shows a large negative value after a reset.
I was thinking just adding a min/max option when creating the derivative sensor could fix it.
And also a time after, if there is no change to the counter the derivative should be 0. or just the integration time. for example if the integration time is 1 hour after one hour of the same value the derivative should be 0. currently it just stays at the last value.

You can feed your entity into a utility_meter first so that it never resets to zero, and then create your derivative from that new entity.

Regarding the derivative never reaching zero, the only workaround at the moment is to create a template sensor that triggers on a time pattern and either updates an attribute or changes the state by a tiny amount so that it registers as a change. There is an issue and a PR in the works that would address this if it gets completed and approved.

For your purposes, you could create a trigger-based template sensor that handles both the resetting-to-zero and the time-pattern-updates so that you don’t have to create multiple entities. But either way will work.

I hadn’t considered using utility_meter. I am counting items, not energy, gas or water. But is a great idea.
I had read the issue about the return to 0, I thought the issue wasn’t going forward, Great that there will soon be a change I will wait for that.
Thank you for your help.