Create energy sensor from power meter

I am trying to add the consumption of a “smart” power strip to my energy dashboard, it is a tuya device and in the app it shows the consumption in kwh but exposed to HA is just the amps/voltage/power not the consumption value.
So I was wondering if there is a way to create a utility meter perhaps from the power sensor or would that not work?
image

Create a helper of type Integration and select your power sensor as the input sensor:

Then wait a while and your new energy sensor will be available for the Energy dashboard.

4 Likes

Thanks and what options do I select for it? The sensor gives power in Watts

It depends on what you are measuring… For most systems trapezoidal will work fine, but if you have short duration peaks you should play with the other options.
You will find more details on the Riemann sum integral docs.

For Metric prefix I always use “k” in order to have my sensors in kWh but, again, this is up to you.

And for precision probably 2 will be fine.

2 Likes

When I do this, I get kwatth which the Energy tab rejects
How can I force kWh?

Same here. I have a Homematic system variable that used Watt as UoM. So I got the integration with kwatth. I deleted the integration and changed the UoM of the variable to W. Now the sensor is correctly displaying „W“, but the freshly created integration again shows „kWatth“.

Any clues how to fix that?