-
Notifications
You must be signed in to change notification settings - Fork 205
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
No issue, need explanation regarding intervals and battery consumption #23
Comments
Max 10 sec (10000 ms). Not all devices can connect if parameter above 3 seconds.
Less consumption, less accurate temperature and humidity readings.
Very little dependence on energy consumption. |
RF TX Power: 0 dB The expense is reduced by 53.2% of the default. |
Hi @pvvx , Also, when I increase the "Minimum LCD refresh rate", to e.g. 5 seconds - does it mean LCD only refreshes every 5 seconds? Would that have a beneficial effect for battery life? Does refresh need much more power compared to just "show" something on LCD? As LYWSD03MMC does not have e-paper but standard LCD I would think that "showing" would be similar to "refresh" (while real e-paper only needs power when refreshing)? Thanks for your help getting the most out of those small devices ... |
Battery level measurement no more than 200 μs at 4 mA
The rest of the equipment at default settings consumes less than 15 μA
LCD consumption is less than EPD (Electronic-ink). |
Thanks a lot - looks like I don´t have to worry about LCD update cycle then and not about battery measurement ... so I guess I will leave all that at default values. Thanks a lot for our deep analysis and inputs. |
Average power consumption of LYWSD03MMC custom firmware (v2.1) Average power consumption of Original Xiaomi LYWSD03MMC sw ver: 106. |
Am trying to decide if it is worth reflashing my 14 devices with your new firmware, instead of Aaron's. Did you happen to compare power consumption with that firmware? |
@penright Please just attach a file or provide a link to a file with this output. Right now it's so long, I think people will not read anything underneath it. Besides: the data only confirms that you were not lying about what you said, then again, nobody assumed you were lying... @pvvx I use your custom firmware, so thank you for that. While I admire your expertise on this subject and can appreciate you making all the difficult calculations, as a user I just want simple settings... The expense is reduced by 53.2% of the default.` Did I read this right ? Do these settings make the battery last a LOT longer compared to the default settings ? |
As per @MichielioZ suggestion, here is the output of ESPHome log showing the Bluetooth advertisements received. Trying to detect a failed or not responding device is what got me started down this path. Since from ESPHome perspective, the event is random. So I thought I would use HA last_updated state attribute. Looks like HA only updates the state if the state changed. So the question becomes what is the max time to allow for a temp change before declaring the ATC device missing. So I created a sensor that would be updated on every received advertisement. There are two ways, one is using the "on_value" event or baking it into the "atc_mithermometer" component. That is when I noticed the irregularity of the advertisement. I was searching for information and ran across this ticket. I thought the question would fit, but by adding the "and battery consumption" maybe I should open a new ticket? The only explanation I can think of, ESPHome missing an advertisement, or ATC has some algorithm that skips trying to save battery. Understanding that will help set the "max" receive timeout. |
@penright I use the "Passive BLE monitor" (ble_monitor) integrations in Home Assistant and with the default settings of the firmware I get a regular update interval of 1 minute. Sometimes it skips one, but that happens rarely. Maybe it's an ESPHome problem you are having ? On a side note: everyone seems to constantly be confused by the term "Advertising interval", since as far as I understand this is not the same as "Send update of data"-interval (which everyone seems to think it is). |
The increased advertising interval makes it impossible to connect to the device with old BT hardware, Apple and other poorly written drivers and systems. |
@pvvx Ah, ok, that explains why it isn't the default, but 53.2% better power usage is still worth mentioning somewhere... In daily use I use them with my Raspberry Pi 3B onboard BLE (BCM43438 chip). |
If it will be possible to connect to the device for which you set the interval of 10 seconds :) For example, I'm interested in data with a step of no more than 10 seconds. Because the dropouts of BLE packets prima in a noisy environment of radio broadcast are about 8%, that is, 4 duplicate beacons with an interval of 2.5 seconds are a guarantee. I would like to have a measurement interval even less - about 1 second, but the battery is weak ... At the same time, ESPHome users complain about its work - ESP32 has a lot of unaccepted packets, and data update gaps are tens of minutes when transferring a data device every 2.5 seconds. |
Yes, that's why I asked if my Phone (with Bluetooth 5.0, so newer version) could still connect if I set the interval to 10 seconds. I understand it is hard for you to try and satisfy everyone. If for example I find that I can safely test up to 10 secs interval with my Phone |
Testing update: For the time being I only tested with the Advertising interval and Measure interval combination. Edit: Went all the way back to 5000/5 combo, but at 3 meters still not a regular update interval in HA. Moved it to like 20 cm from my Raspberry Pi and now I get regular intervals of 1 minute (default setting in Passive BLE Monitor add-on in HA, it takes all measurements from 60s and stores the median). Conclusion for now: For all 3 test settings I am still able to update with my Phone. Anything other then the default settings (2.5s) and further away then approx. 1m has updates on my Pi that are irregular and with (much) longer periods in between... Edit 2: All my sensors further away then 1 meter (all but 1) are now back to default settings (2.5s) as my Raspberry Pi has trouble getting regular updates otherwise. The one next to my Pi has the 10000/10 setting with an RX TX Power of +0.04 dbm and is updating regularly. My guess is that with a decent antenna the chip (BCM43438) should be able to use the optimum settings further away... |
The default settings should be comparable to the original firmware in terms of consumption. |
Testing for the number of drops in receiving Advertising packages from the sensor. Any USB-BT adapter - not received packets > 90%. |
There are sources-code for any case. The main trouble with Xiaomi LYWSD03MMC is that greedy Xiaomi did not supply the power capacitors that are provided on the PCB. Because of this, the device has a large scatter of measurements the temperature and humidity, and the TLSR8251 cannot provide the calculated RF output power. |
Hi, I flashed the software on 3 LYWSD03MMC. Its working well, but Im not an expert so Im kind of lost when trying to optimize life battery.
Advertising interval is 2500, this is milliseconds? Can I increase this as much as I want? Like I only need 5 minutes updates
What happen when the option Sensor in "Low Power mode" is active?
I understand The RF TX Power is the strength of the signal, can I lower it making sure the signal is received by my ble host? (rasp w)
Thanks for the help, nice work!
The text was updated successfully, but these errors were encountered: