[SOLVED] Measure power from energy sensor

Hi, I have problem with power metering. I want to use Lovelace Power wheel card but I don’t have any power sensor, just PV Inverter sensor. BUT I have energy (not power) sensor for energy consumed from grid and exported to grid via energy company meter. It refreshes every 15 minutes so when I was able to get two sensors:
sensor.energy_in_last and
sensor.energy_in_previous
I could have average power from last 15 minutes via another template sensor. But how to get it? How to make sensor which would store previous value of different sensor?

Solution: Diffrential value for energy consumption sensor