Replies: 4 comments 4 replies
-
Hey @rivnut, Does this happen with a single sensor or all of them? Could you plot the other ones as well? While at it, could you plot the temperature? If you remove the battery and measure it with a multimeter, what do you get? I'm asking because our batt discharging model (map from voltage -> %) is pretty rough and does not take temp into account. In extreme temps, the % reading will be off. |
Beta Was this translation helpful? Give feedback.
-
There is a trick (that works sometimes) to read the battery voltage from the zigbee samples through Home Assistant. In the device page, click the three dots then "manage zigbee device", select "PowerConfiguration" cluster, then "battery_voltage" and tap "READ ATTRIBUTE": ![]() This is in 100 mV units, so 29 means 2900 mV = 2.9 V in this case, and it reads 91% in the top right of the screenshot. In this other example, 2.8-ish V (rounded) => 38% ![]() Now a little backstory... This is because the discharge curve of a CR2032 looks a bit like this (from energizer, assumes constant draw, constant temp): If I remember correctly I based the CR discharge model I set up was based on an example of an old SDK version (now deprecated). It tries to linearize the curve piecewise. In reality this mapping is not really good. If you look at a typical multi-month discharge pattern in %: ![]() You can see a steep drop in the beginning. I think this is more a consequence of a bad battery curve model (that doesn't take into account battery current during measurement, temperature etc) than a battery drain issue. This is still at 2.8-ish V, which indicates it's working okay. So, this is somewhat expected within reason given the current simple battery modeling. Still, a sharp drop from 100% to 20% in a couple of days is concerning. Let me know if you manage to gather some more data from the other sensors, and also from the temperature. |
Beta Was this translation helpful? Give feedback.
-
I have one of these cheap LYWSD03MMC sensors flashed with the popular custom pvvx/ATC_MiThermometer firmware. Out of curiosity I put it outside yesterday, and I also see a similar variation in battery voltage and %: ![]() In their case, we can see a pretty much linear mapping from temperature, voltage and battery %. I found where it is handled in code, and it really is a linear function in the range 3.0 V - 2.2 V. This is even "simpler" than what we do here with 4 piecewise linear approximations, but I would argue it looks smoother and doesn't have the sharp drop as our model shows in practice for our current pattern. So maybe simpler is better? |
Beta Was this translation helpful? Give feedback.
-
Hello @rbaron, attached you will find the results from the tests. In the Excel file you will find the raw data. Best regards, ![]() ![]() ![]() ![]() |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello everyone,
first of all, big thx to rbaron for this project and to be avaiable as a open source project to rebuild.
Maybe someone can help me with a problem of battery drain with a zigbee version of this sensor.
I ordered some fully assembled sensors from jlcpcb.com and flashed the firmware with j-link. The sensors works great at all but after some days, it starts to drain the battery and the capacatiy goes down from 100% to 30% within one or two days. Can anybody help me, where I should start to search for the problem?
Image attached
Best Regards, Robert
Beta Was this translation helpful? Give feedback.
All reactions