How to estimate remaining battery life of a wireless device

So, i have the auto entities card giving me a nice view of my battery powered devices like so:-

image

Is there a way to calculate when the battery of any given device would drop below a certain threshold and show the number of (say) days before that will happen ?

So for example, ‘122 days before battery reaches 20%’

Reliably? Probably not. I have a temperature sensor in my freezer that, due to the cold, has been reporting 20% battery for like 6 or 8 months now.

Too many variables.

1 Like

Yeah, I’ve done a bit of reading since, and it seems the environment and the device itself have different consumption effects on the battery, making it hard to know when and by how much its going to drop by.

Type of batteries come into play as well. Small lithium batteries tend to trickle down for a while and then fall off a cliff at some semi-random point, where alkaline are a smoother curve.

Different manufacturers/integrations use different algorithms to compute percentage.

As stated - too many variables.

Probably no. Problem is obvious. You can’t predict how many times in x days those devices will change state, detect something, turn on off vale etc. And that all affect battery life.

There is no magic formula, there are variations, but the fact that there are variations is IMHO no reason to decide to do nothing.

Battery technology (Alkaline, Li/MnO2, Li/FeS2, …), brand, format, production variation, temperature, load, etc. all influence effective Volt/Current discharge characteristics.
However, when examining discharge curves, they generally have very similar discharge curves when you have the same battery techology.

The main issue is that the estimates made by the products themselves are often not reliable. I have found myself at the heart of the “decision process” several times in small companies: the commercial guy even gets involved in deciding how voltage should be converted to percentage based on small sample sizes! The recommendations of an engineer may have only a small influence on the end result…

With off-the-shelf Zigbee devices, I have found the following:

  • They stop working before reaching 0% (at 30%, 80% even).
    Reasons:
    • The measurement is based on voltage and lithium batteries have mostly a constant voltage (3V) until they are about 10% from a severe voltage drop, and the Zigbee devices need 2.4-2.8V to function for instance.
    • The minimum operating voltage was not integrated in the % estimates. 0% may be the theoretical limit (0.9-1V) for an AA Alkaline cell but the product stops working when the cells are at 1.2V (still 50% of the published batterty life left in the battery).
  • The percentage loss accelerates near the end:
    • The discharge curve was not modeled after reality - the voltage is mapped to a percenting using a simple linear formula similar to (Voltage-1V)/0.5V. Meaning that 1.25V translates to 50% and 1.05V to 10%.

Here is a 1 year graph of batterie percentages as reported:

The red curve that breaks down in august (août) are 2 AA Alkaline batteries in a Danfoss Ally TRV. That valve continued working until then, but others I had to replace at about 30% (not all devices are in the graph).
The flat curves are mostly Lithium batterieS. The lemon/greenish color is one of them - it is typical for them to start “oscillating” their % at some point.
This is what the Zigbee specification says:

Manufacturers SHOULD measure the battery voltage and capacity at a consistent moment (e.g., the moment of radio transmission (i.e., peak demand)) in order to avoid unnecessary fluctuation in reporting the attribute, which can confuse users and make them call into question the quality of the device.
Manufacturers SHOULD employ a hysteresis algorithm appropriate for their battery type in order to smooth battery reading fluctuations and avoid sending multiple battery warning messages when crossing the voltage thresholds defined for warnings.

So given all that, a better estimate can only be provided by the end users.
For AA Alkaline batteries, I think it is best to estimate the % remaingng based on voltage reports which are available in some cases (but you need to configure the devices and Home Assistant to keep long-term data for those).

For Lithium Batteries it is difficult to see the end coming a long time in advance based on the voltage reports. Two methods that complement each other:

  • Save a date when the battery was last changed and estimate the % remaining based on the passed wall clock time vs. the expected lifetime of the battery for the device.
  • And generate a warning as soon as the voltage drops below 2.8V for instance.