Add mAh, Ah as a new BATTERY_CAPACITY device class #1052
Replies: 7 comments 12 replies
-
Ah is actually quite a poor indicator of battery capacity since it's unit isn't Joule, the measure of energy (you thus need the voltage with Ah to get to that). Wouldn't this value be mostly a constant anyway? Or are you actually talking about remaining capacity here? |
Beta Was this translation helpful? Give feedback.
This comment has been minimized.
This comment has been minimized.
-
Please list the integrations that could leverage the new device class. Integrations that can leverage anything, like template and MQTT aren't interesting. |
Beta Was this translation helpful? Give feedback.
-
I also use this integration with a device for RPI where the battery capacity is defined in mAh |
Beta Was this translation helpful? Give feedback.
-
In my opinion, HA should be capable of handling at least some Standard Units - and Ah / mAh is one. There are other examples of Units that could be integrated - even If they are not that common... MW (Mega Watt) etc. that could be easily added without causing issues If they are not beeing used immediately. You can Just Setup a Rest API Sensor or create a template that would utilize such a measurement value... |
Beta Was this translation helpful? Give feedback.
-
Hello! I was also very surprised that there is no Ah. Ah is a very important indicator for autonomous systems, since modern batteries do not allow you to estimate the remaining charge simply by measuring the voltage. ALL battery controllers simply sum up the charge time multiplied by the charge current (A*h). I use ESPHOME to get data from various BMS - and just ignored the device class error. I thought I didn't read the documentation well enough. Thanks, now I understand - it's not a bug, it's a feature) |
Beta Was this translation helpful? Give feedback.
-
I did a quick search of the codebase, only one integration uses the
However, I found some interesting cases where calculations are made so that the sensor can have a unit compatible with the energy storage device class:
And there are other integrations that implement battery info without informing a unit, which makes one wonder if they are not using units derived from Ah. I believe that the current behavior of validating the unit as compatible with the device class has caused developers to fail to implement sensors with units and without device classes, which may mask research. Despite the small number of integrations that currently use units derived from Ah, I believe that after implementation new use cases will appear. |
Beta Was this translation helpful? Give feedback.
-
This seems to be a pretty important missing unit. Currently we have support for energy capacity, but not battery capacity, which is useful for a lot of battery based devices (in my case the Ecoflow batteries) which report this value.
Beta Was this translation helpful? Give feedback.
All reactions