Thanks Robert, I didn’t imagine it’s so complex and actually on Z2M they discuss it for 1.5 years, doing measurements, proposals, changing calculations … and basically :
- nobody knows how actually Xiaomi calculate batteries levels
- there is disagreement on maximum and minimum voltage, as it differs per condition (manufacturer, temperature, nominal voltage deviations)
- some messages says that Xiaomi also interpolate somehow with temperature, some say they use linear discharging characteristic
- some suggested it might be indicative only as capacity measurement is much complex then just measuring voltage
- they have tried several mathematical methods already, latest seems to be in general indeed linear - 3V_2850_3000 for those sensors being discussed
Basically on my example, if I measured 2.77V on CR2450, it’s taken as 0%, even sensor was still working fine with those levels possibly last 3 months while it was -20C outside but even +10C.
The solution would need to be much more complex (or trivial)
- add option to disable battery SOC for misbehaving / outside sensors (Athom did it already for some IKEA switches)
- showing battery voltage and use other apps eg. for calculating trends via flows - I guess it’s not possible to show battery voltage as value like in case of Z2M.
- implement some switch indicating it shall interpolate battery voltage with outside temperature sensor / Athom temp. value (seems nobody developed a mathematical model for that even graphs / discharging characteristics exists)
Sometimes you simply can’t. Eg. because of not right window orientation, because of blinds/rollers etc.