Instantaneous kWh

good. how can i make an instantaneous kWh sensor with a W sensor? the kWh sensor I can do is always adding up, and what I wanted was the instantaneous value to put in the new home Assistant option “energy”

There is not such think as “instantaneous” kWh.
1 kWh is how much kW you consumed in1h.

Maybe you’re looking at transforming instantaneous W in kWh?
Then use

Thank you very much