How to energy meter with home assistant

Hi there,

I have a entity which measures the actual electrical power in Watts.
Unfortunately the sensor doesn’t count the Wh or kWh.

Is it possible, to create a electric meter (Wh), based on the measured Watts?

And - how can I do that?


Yes it is. Use this:

Be sure to read about the method option. You very likely want method: left to reduce approximation errors and it is not the default setting.

That will count up energy forever. If you want a sensor that resets after some cycle (hourly/daily/weekly/etc…) feed the Riemann Sum sensor to this helper:

1 Like

Can you also tell me, if the energy card is configured right?

I only configured “Wh from the Grid”, “Wh to the grid”, “total Wh produced by PV”.
Does the energy card calculate the used energy on its own (based on these three values)?
Or is there something missing?


Yep. Looks good.

1 Like