Best/Easiest fix to keep for keeping the derivative sensor zero if value stays the same

There’s the well known bug that the derivative sensor only response when a new value is published. This is problematic when the value stays the same (and the derivative is zero by definition).

In my case, my Tesla Wall Connector only shows kWh but to show the current power draw I created a Derivative Helper as follows:

You can see power is stuck at 2.8kW for weeks now just because I have not used the charger (and kWh did not change). This messes up all my power statistics.

What is the best/easiest fix for this?

Hi dydx,
I personally couldn’t help with a

However, you may want to search the forum as there appears to be a lot of topics about it. Maybe someone has you covered already. try this in your search engine:

site:\home-assistant.io derivative sensor