-
Notifications
You must be signed in to change notification settings - Fork 213
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Supporting uptime/battery time in the custom format (0x181a) #198
Comments
Unsolvable factors:
Batteries are sold with different conditions, shelf life and different manufacturers. They have different capacities in Ah. |
I thought that your code generates the 19 bytes advertisements output and you only need to add the extra 2 bytes. Isn't that the case?
Yes, but I don't consider this a big issue or even to be a valid use case. |
All Integrations will not work. Adding any byte to the advertising packet increases battery consumption. |
I see, all of them is 0x181a and it can rely only on the message length? |
Describe the algorithm for determining battery replacement. I have installed batteries that have been stored for over 10 years. The initial voltage on them was 2.0V. After a day of work, it rose to 2.8V. |
Yes, it would need to save the voltage time to time. Or we would lose that date too? I would simply say if the battery is above 3V at start and the last save of the battery is below 2.6V then there was a replacement. |
Do you consider that a regular usage? :D |
And in this exotic case: The battery change event can only be registered by setting it in the configuration when connected. Home Assistant allows you to write a script that calculates the time and battery life without resorting to changing the program in the thermometer. At the time of its appearance, only 14 months have passed since 11.2021 and I have not replaced a single battery on the thermometer with custom firmware. The battery life is still unknown. |
In the capacitor case you don't get any meaningful battery percentage either.
Elapsed time, but you are right, 3 bytes already used on battery (I didn't check, but my guess is that the percentage is a formula from battery_mv).
Is it possible to attach persistent values based on - let's say - MAC address and then propagate new properties to the device? How would adding one extra byte change the battery life? |
Whole ad package: 10 + adv_data_len + 1 |
In no case will you get a meaningful percentage of battery charge by measuring only the voltage of CR2032. The battery voltage measurement process takes about 83 µs. The current consumption during the measurement is about 3mA if no other loads are active. |
Thank you for the explanation. |
Not certainly in that way. The analysis can be performed by a person who is familiar with everything described and has battery voltage graphs, but not a stupid processor in the thermometer itself. |
First, thank you for your library, I am using it for more than a year (since v2.5) and it's perfect!
When I refreshed my new devices, I noticed that for the LYWSD03MMC, I even can set the proper date.
If the device is able to measure the time for this range; is it possible to add extra 2 bytes to the custom format (0x181a) and send the "uptime"/"battery time" in hours (one byte in days might be too small)?
If somebody changes the battery (hard reset, battery voltage significantly greater than the last measurements) the firmware would save the starting date of the battery change somewhere and then just send the date difference in hours in the advertisements.
With this feature we would be able to follow easily the battery life for each device.
Thank you very much!
The text was updated successfully, but these errors were encountered: