#Can't add individual devices to Energy dashboard

1 messages · Page 1 of 1 (latest)

pulsar coyote
timber sentinel
#

Check developer-tools/statistics to see if there is any pending issues with that sensor.

nova quartz
#

I've got a similar issue where I can not add individual devices to the energy dashboard. I have a few power entities that I've grouped with a helper sum and then I've used the integral helper that shows Ws as a unit (which is just Joules). I don't have the ability to add a device class for the integral so maybe that's the problem. Should I just make the sensor in yaml the oldschool way to make it work?

nova quartz
#

Ok so I've tried it with template sensors but I ran into the same issue. Still have the feeling it has something to do with the unit conversion to Ws instead of J. I've used the powercalc custom integration to turn the helper power sensors into energy sensors and those are immediately picked up by the energy Dashboard.

timber sentinel
#

I don't know what you mean "conversion to W". Energy sensor should be Wh, not W.
You can do it with integral helper, you don't need a custom integration.

#

Or did you really mean Watt-Seconds

nova quartz
#

W*s = J indeed

timber sentinel
#

Oh sorry I read that like plural W's 😅

nova quartz
#

Integrating a sensor in the power class should result in an energy sensor but somehow it doesn't work with the helper functions

timber sentinel
#

These are the only units that HA recognizes for Energy sensors:

class UnitOfEnergy(StrEnum):
    """Energy units."""

    JOULE = "J"
    KILO_JOULE = "kJ"
    MEGA_JOULE = "MJ"
    GIGA_JOULE = "GJ"
    MILLIWATT_HOUR = "mWh"
    WATT_HOUR = "Wh"
    KILO_WATT_HOUR = "kWh"
    MEGA_WATT_HOUR = "MWh"
    GIGA_WATT_HOUR = "GWh"
    TERA_WATT_HOUR = "TWh"
    CALORIE = "cal"
    KILO_CALORIE = "kcal"
    MEGA_CALORIE = "Mcal"
    GIGA_CALORIE = "Gcal"
#

I guess Ws isn't recognized.

nova quartz
#

So why is the integration helper not converting Watts to Joules? Seems like a bug to me

timber sentinel
#

It converts Watts to Watt-Hours (Wh) or kWh.

#

If it didn't do that for you, please show an example input and output sensor.

nova quartz
#

Give me a few minutes

#

I've created a template power sensor with a fixed 1W of power. Then used the integral helper to create an energy sensor which results in Watt-second units

timber sentinel
#

Probably need to select a Time Unit of Hours when configuring the integral instead of Seconds.

nova quartz
#

Yes that works and it shows in the dashboard even before historic data is available