I asked on Reddit: https://www.reddit.com/r/homeassistant/comments/1g6tatq/cant_add_individual_devices_to_energy_dashboard/
I'm rarely on here, but I would appreciate the responses in the Reddit thread.
1 messages · Page 1 of 1 (latest)
I asked on Reddit: https://www.reddit.com/r/homeassistant/comments/1g6tatq/cant_add_individual_devices_to_energy_dashboard/
I'm rarely on here, but I would appreciate the responses in the Reddit thread.
Check developer-tools/statistics to see if there is any pending issues with that sensor.
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?
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.
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
W*s = J indeed
Oh sorry I read that like plural W's 😅
Integrating a sensor in the power class should result in an energy sensor but somehow it doesn't work with the helper functions
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.
So why is the integration helper not converting Watts to Joules? Seems like a bug to me
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.
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
Probably need to select a Time Unit of Hours when configuring the integral instead of Seconds.
Yes that works and it shows in the dashboard even before historic data is available