I have a sensor from my HVAC that calculates the energy usage from that. I would also like to see the momentary power it´s using. Can that be derived from the energy sensor with some template? Basically the difference of two vales divided by the time difference…
That is not a real solution.
It only works when the energy sensor is regularly updated.
It you have an energy consumption that stays zero for a longer time, the power is wrong.
It was a fine solution, in april 2022. The derivative is now ‘less effective’ since the recorder was optimized to stop storing duplicate values. There are however workarounds. See the issue below. Plus, for total power in your home, it is extremely unlikely that there’s no energy consumption. So the sensor from the OP would still work fine.
But also note, any energy sensor that does not update frequently will get inaccurate results. Or better phrased, only a course average power use of the past period, which is not truly ‘momentary’ anymore. But that is an inherent problem of infrequent updates. There’s no cure for that.