Using Tasker to set Moto Mod battery to start charge lower than 80% - Moto Z Guides, News, & Discussion

You need root to do this.
You can use the Run Code function in Tasker and put - dumpsys battery unplug
This will stop the phone from charging (thru all charging methods) until battery level drops.
If you wish to permanently stop charging the phone until a certain % then you have to set Moto Mod to efficiency mode then trick the phone to thinking it is still within a certain % with - dumpsys battery set level 81
This will artificially set the battery level to 81%, above the efficiency mode level and, stop the phone from polling battery stats.
To restart polling of battery stats use - dumpsys battery reset
Use Tasker events to control the execution of commands.
For example:
On Display On:
dumpsys battery reset
On Display On and if Battery Level is Between 50 to 81:
dumpsys battery set level 81
dumpsys battery unplug

Related

[Q] Measuring state of charge/discharge to 1% accuracy via charge counter

Is there a way to measure the state of battery to 1% accuracy, i understand that the battery manager only does in intervals of 10%. I was wondering if i could use the charge counter. I found it to be 85 and 95 when battery state changed from 80% to 90% and 90% to 100% respectively. I am not sure how to measure the % in between intervals. Also i cannot found any batt_current in my sys folder(its motorola atrix 4G). Please any suggestions would do. Thanks.
Hello, give a try to the Battery Monitor Widget application on the Store.
It is a real great application to log the battery life.

[DEBUG] Gingerbread wonky fuel gauge

I've seen a couple of people reporting that their fuel gauge wacked out and reported wildly changing battery percentages. Like going from 85 to 25% suddenly. It doesn't happen often but I've seen at least 3-4 reports.
If this happens to you:
Install CurrentWidget or another program that lets you monitor battery voltage. Not percentage state of charge, but raw voltage. Report the battery voltage you see when your fuel gauge wacks out. It should be around 3.9-4.0 volts at least when at 85%, and if the fuel gauge is reporting 25% and batt voltage is up there, the fuel gauge has gone bonkers, either due to I2C data getting corrupted or the chip just flaking out.
Edit: Before trying the below, you may be able to reset the chip without a battery pull. Run the following command in a shell. You must have root privileges - in recent Infused betas you will always have root via ADB, if using Android Terminal Emulator you may need to su first.
Code:
echo "1" >/sys/class/power_supply/battery/reset_soc
The above should be our device's equivalent of wiping battery stats.
If that doesn't work:
Power down, pull battery for 10-20 seconds, reinsert and power up. Does the problem continue?
Removing battery power completely will reset the fuel gauge IC. Rebooting without battery pull may not.
There is no point in wiping battery stats - our fuel gauge chip does not have any sort of host-controlled calibration routine. If you want your battery to "settle out" - wait 30-60 minutes of normal operation, that's all you need.
This actually applies for any phone with a MAX8998 PMIC.

[APP][FREE] Battery Saver HD

Battery Saver HD provides the best features to saves the battery time of your phone or your tablet. Whenever battery runs low or goes too much down then just tap the application to turn on the saving mode.
Link: https://play.google.com/store/apps/details?id=com.bat.saver
Battery Saver HD regulates the manner in which your device is charged with a unique 3 Stage Charging system to ensure you get the most out of your battery and reminds you not to over charge. It also has features that can monitor and regulate power consumption.
Features Overview:
1. Simple and elegant UI design
2. Disable unnecessary apps that drain your battery!
3. Kill apps when screen is off. Task Killer kills tasks with just one click. Display all the running apps with detailed memory, icon, update time and size. Kill the running task for power optimization and memory consumption. It works as Memory Booster.
4. Accurate battery remaining time. Battery Details: Current in mAH, Health Condition, Temperature in Celsius(ºC), Voltage in mV, Technology used, Plugged via USB or wall mount charger, Show Status if charging or not charging.
5. Accurate charging remaining time. Charge Mode Details: Fast Charge, Full Charge, Trickle Charge.
6. The app provides three types of Mode to save your battery life when runs low:
- Saving Mode (Suggested to use in lowest Battery Status): Brightness set to 10%, Turn off Wifi, Stand By time set to 15 seconds.
- Sleep Mode (Close all except clock, save battery a lot while sleeping): Turn Off Call & SMS and turn ON the Flight Mode, Vibrations Off, Sound Off and mute the device, Brightness set to 10%.
- Customized Mode: Easily customize all the modes depend on your usage to save Battery as much as you need. It can adjust the battery saving setting freely depend on your need and usage. It can adjust wifi, bluetooth, vibration, sound, device brightness, synchronization and stand by time.

[Q] An App, that control charging process for enlarge battery lifespan?

Hey
First, please read this article:
http://batteryuniversity.com/learn/article/how_to_prolong_lithium_based_batteries
TL DR
A Li-Io or Li-Po battery charging cycle like charged to 100%, discharge to 15% and repeat, will have only 300-500 charge/discharge cycles battery lifespan, while a battery charging cycle like charged to 75%, then discharge to 25% and repeat, will get 1,500-2,500 charge/discharge cycles battery lifespan.
I have Samsung laptop, that have application (Samsung Easy Settings), that control charging process. When "BATTERY LIFE EXTENDER" is checked, then charging stops at 80% and will not get higher, and when laptop is constantly connected to wall, then app will let drop battery level 75%, then recharge to 80% again.
I'm using this laptop over 3 years and battery last over 5 hours (time on battery is shorter about 10-15min from "brand-new" state)
So, I'm looking for an android app (for rooted devices), that will stop charging at user predefined level (for example 80%), and cause alert/notification (on discharge), when battery level dropped below user predefined level (for example 25%) - to save battery lifespan.
PS: There is a trend, the newer, high-end devices have built-in batteries, without possibility to replacable (solid smarphone body, hard to open without damage), so that app could make device live longer
PS2: I read about charge control by "/sys/class/power_supply/battery/charging_enabled", but this doesn't exist in my ROM (crDroid, CM13 based on i9505)
PS3: The tasker helped me to "detect" charging over 80% (profile AC is ON and Battery level is over 79% -> task "say bla bla bla disconnect Your phone from wall"), but this is only "workaround" and doesn't work at night (You have to wake up and disconnect phone from wall)
Unfortunately this is a Question. This forum is only used to post actual apps.
You have already posted in right place so closing this.

[Guide]Using the Advanced Charging Controller (ACC) Magisk Module with Pixel 3a XL

While I've had many Android phones, this is the first phone that I decided to use a battery charging controller to regulate how my battery is charged. I just wanted to share my journey with others and encourage others to try this out if you are not already.
Although there are several different battery charging controllers out there (and more than one named "ACC" which makes it even more confusing) I decided to use the Advanced Charging Controller module developed by VR25. I choose this module because I felt it provided the most customization.
Step 1 - Installation
Installing the module is easy. It is listed in the Magisk repository. Simply browse the available modules and find the one titled, "Advanced Charging Controller (acc) created by VR25 @ XDA-developers". There are several ACC modules, so make sure you install the one by VR25 to follow this thread.
Magisk will flash the module and start it automatically. You don't even need to reboot, although it is the only way to clear the Magisk notification that the module will be started at the next reboot.
Step 2 - Changing the Charging Switch Setting
I found that the default charging switch setting (auto) does not work reliably with our phones. Therefore I would suggest changing it using the commands below. Personally I have choose option 2 (battery/charge_disable 0 1) but I listed all the options with the quirks that I have found with each one.
Step 2.1 - open your preferred command line app - I use Terminal Emulator.
Step 2.2 - type "su" and hit enter to gain root
Step 2.3 - type "acc -s s" and hit enter - this is the command that allows us to select another charging switch
Step 2.4 - type what number of the charging switch you want to use.
Here are the available charging switches and the issues I have found with them:
1) Automatic - this switch tries to cycle through the available switches until if find one that "works".
- Passes the ACC switch test (type "acc -t"): Yes
- Charges and discharges according to the cooldownratio: No - I found that the phone would charge anytime it was plugged in and below the Pause threshold. It did not seem to wait until the battery level was below the Resume threshold.
- Works with battery idle mode (the phone will pull power from the AC power and not the battery when the battery reaches the Pause threshold): Yes
- Begins charging when phone reaches Resume threshold: Yes
- Charging "chime" and battery icons correctly reflect if the phone is charging or discharging: ???
- Suffers from wakelock issues when phone is plugged in but not charging: It does have a "overheat_mitigation" wakelock when on the battery idle mode, but because the phone is not using the battery power, it doesn't effect battery life and therefore I don't concern myself with this issue.
- Other issues:​
2) battery/charge_disable 0 1 :
- Passes the ACC switch test (type "acc -t"): Yes
- Charges and discharges according to the cooldownratio: Yes
- Works with battery idle mode (the phone will pull power from the AC power and not the battery when the battery reaches the Pause threshold): Yes
- Begins charging when phone reaches Resume threshold: Yes
- Charging "chime" and battery icons correctly reflect if the phone is charging or discharging: ???
- Suffers from wakelock issues when phone is plugged in but not charging: It does have a "overheat_mitigation" wakelock when on the battery idle mode, but because the phone is not using the battery power, it doesn't effect battery life and therefore I don't concern myself with this issue.
- Other issues:​3) battery/input_suspend 0 1:
- Passes the ACC switch test (type "acc -t"): Yes
- Charges and discharges according to the cooldownratio: Yes
- Works with battery idle mode (the phone will pull power from the AC power and not the battery when the battery reaches the Pause threshold): No - phone begins discharging from battery when Pause threshold is reached but the phone is still plugged in
- Begins charging when phone reaches Resume threshold: Yes
- Charging "chime" and battery icons correctly reflect if the phone is charging or discharging: No - may show charging icon when phone is really discharging, especially during cooldownratio times and the chime doesn't always ring when charging resumes.
- Suffers from wakelock issues when phone is plugged in but not charging: No
- Other issues: The phone seems to follow the cooldown charge/discharge times even before reaching the cooldown threshold. I find the phone pausing for 10 seconds (my cool down ratio) when the batter level might be a 50% - long before the 60% cooldown threshold I have set in the config file.​4) dc/input_suspend 0 1:
- Passes the ACC switch test (type "acc -t"): NO, so this switch doesn't work with ACC
- Charges and discharges according to the cooldownratio:
- Starts discharging when the phone reaches the Pause threshold:
- Begins charging when phone reaches Resume threshold:
- Charging "chime" and battery icons correctly reflect if the phone is charging or discharging:
- Suffers from wakelock issues when phone is plugged in but not charging:
- Other issues:​5) battery/charge_control_limit 0 1:
- Passes the ACC switch test (type "acc -t"): NO, so this switch doesn't work with ACC
- Charges and discharges according to the cooldownratio:
- Starts discharging when the phone reaches the Pause threshold:
- Begins charging when phone reaches Resume threshold:
- Charging "chime" and battery icons correctly reflect if the phone is charging or discharging:
- Suffers from wakelock issues when phone is plugged in but not charging:
- Other issues:​
Step 3 - Configuration
You can configure the ACC controller using a couple of different methods. You can do everything using command lines, you can use the beta ACC app (see note below), or you can edit a config file that ACC creates when it is installed. Personally I found that editing the config file was the quickest and easiest method to make general changes.
The ACC config file is found at /storage/emulated/0/acc The file is named "config.txt" You can open the file with a text editor. I personally use the app Root Explorer. I long click on the file name, and then press the three dot button in the upper right hand corner. Choose "Open in Text Editor" and the config file will open and allow changes to be made. Saving the file will automatically push the changes to ACC, you do not need to reboot or restart the ACC daemon for changes to take effect.
I won't go into a lot of detail about all of the different configuration options here as the developer's xda thread is the best place to get that type of information. But I will talk about the most basic setting - the "capacity" setting. It is the second setting listed in the config file and it should look something like "capacity=0, 60, 70-80". Here is a break down of what those numbers mean:
- The First Number (0): is battery level were the phone will shut off. The default setting of 0 means the phone will turn off when the battery level hits 0. Personally I don't want my battery completely draining, so I have it set at 5.
- The Second Number (60): is the battery level where the module starts it's "cool down" functionality. Cool down (listed as coolDownRatio in the config file) is where the phone will stop charging briefly and then restart charging. The default "cool down" setting is coolDownRatio=50/10 which means the phone will charge for 50 seconds, and then stop charging for 10 seconds before charging again for 50 seconds, etc, etc, etc. This is designed to keep the battery temps low. A battery with a charge level less than this number (60 in this example) will charge without pausing, but when the battery level gets to this number or above, the phone will charge and pause based on the coolDownRatio.
- The Third Number (70): is the "resume" value. If the phone's battery level is below this resume value, the phone will charge. If the battery level is at or above this resume value, the phone will not charge even while plugged in.
- The Fourth Number (80): is the "pause" value. This is the battery level where the phone will stop charging and should not charge above this value.​
The default settings are set this way because research has shown that a phone's battery will last the longest with the least amount of battery capacity loss if it is charged to a max of 80% of the battery's capacity, and allowed to discharge just a small amount (10%) before being charged again. I realize this goes against the old "wives tale" that our phone's batteries have a very limited number of charges and it is best to limit the number of charges by only charging the phone when it gets to a low level. This is not true in actual battery performance however and if you charge like this, you are actually decreasing your battery's life expectancy and performance.
Obviously the default settings may not be the best setting for you. The default settings are probably only practical for a device that is plugged in 100% of the time. Personally I have changed my capacity setting to capacity=5, 60, 70-90. This means my phone will turn off when the battery level reaches 5% (something it has never dropped to yet), it is charged to a max of 90% and will discharge to 70% before charging again, and the cooldown charging cycling starts when the battery is 60% or higher. Obviously I'm not on my charger all the time, so it is very common for my battery to drop below 70%. However, if the battery is below 70% and I have a charger at my disposal, I am going to charge the phone back to 90% rather than let it the battery levels continue to fall.
Final Notes and Misc Thoughts
There are lots of other options and commands you can use in ACC. Feel free to share any changes you like to make, or post if you are having problems getting the module to work as expected on the 3a. I hope this helps some people feel give the module a try.
There is an ACC app that is available now that allows you to control some of the settings from a nice GUI. I personally did not like using it as I found it would overwrite settings in the config file that I was not intending to be changed.
There is an ACC telegram group if you want to join and have direct communication with the developer and others.
Thanks to @jellopuddingstick for educating me on what the battery idle mode does and why it is beneficial to have it working!
sic0048 said:
I just wanted to share my journey with others and encourage others to try this out if you are not already.
Click to expand...
Click to collapse
Was doing the same research when this popped up -- great job!
Can you discuss more on what unintended settings were overwritten by the app....
Also, thoughts have seem to have standardized now to lop off 40% of usuable capacity by having the battery charge btw 20-80% to extend life, such as... "capacity=20, 60, 70-80".
How were the defaults for ACC set and why have you chosen otherwise?
duh1 said:
Was doing the same research when this popped up -- great job!
Can you discuss more on what unintended settings were overwritten by the app....
Also, thoughts have seem to have standardized now to lop off 40% of usuable capacity by having the battery charge btw 20-80% to extend life, such as... "capacity=20, 60, 70-80".
How were the defaults for ACC set and why have you chosen otherwise?
Click to expand...
Click to collapse
The app works by writing to the normal config file. But it also has three profiles loaded into memory automatically when you install it. This makes it very easy to press on one of the other profiles by accident and totally change your settings. I eventually deleted all the "extra" profiles, but the charging switch isn't changeable via the app either (it seems like it defaults to auto) so the app will overwrite that setting back to auto if you aren't paying attention.
In the long run I found that using the config file was extremely easy and I found myself having the check the config file anytime I used the app to make sure it wasn't changing unintended settings, so I decided to remove the app and just use the config file.
As far as capacity, I decided to run 5, 60, 70-90. I think it is a good compromise between having a decent amount of capacity available and also not charging the phone to 100% all the time. I could probably get away with a limit of 80 or 85, but ultimately decided on 90. I do try to charge my phone when it hits 70 or below if I have a charger available vs waiting to do a larger/longer single charge.
sic0048 said:
I do try to charge my phone when it hits 70 or below if I have a charger available vs waiting to do a larger/longer single charge.
Click to expand...
Click to collapse
Don't you think 70 is too high to begin charging just to bring it back to 90. Doesn't number of charge cycles kill battery life as much as heat and fast rate charging?
Any good apps you like that intuitively monitor battery health, besides just stats and charts, that does it like apple, as a percent of remaining chargeable capacity?
Btw OT question, looking to move over my wifi connections from the previous phone and can't find the wpa_supplicant.conf file in /data/misc/wifi in the 3a. No reference online mentions that it's been moved. Any idea where they're hiding it now? Thx...
duh1 said:
Don't you think 70 is too high to begin charging just to bring it back to 90. Doesn't number of charge cycles kill battery life as much as heat and fast rate charging?
Click to expand...
Click to collapse
According to this research (https://batteryuniversity.com/index.php/learn/article/how_to_prolong_lithium_based_batteries/), the more your battery discharges, the fewer discharge cycles it will survive before really negatively effecting battery performance. So discharging your phone just 10% might give you 6000 discharge cycles, while discharging your phone 60% might reduce these discharge cycles by 90%.
Obviously I have to rely on other people's research as there is no way I can adequately test this myself. But I do trust this research as accurate. I know with other phones I've had where I did not try to control the charging system I have had to replace the batteries with pretty regular occurrence. But I would leave the phone on the charger overnight (not a good thing for battery life) and try to discharge the battery a lot before charging it back again (also not a good thing for battery life). That's why I decided to finally look into using a charging controller like ACC with this new phone.
duh1 said:
Any good apps you like that intuitively monitor battery health, besides just stats and charts, that does it like apple, as a percent of remaining chargeable capacity?
Click to expand...
Click to collapse
I've been using the ExperimentalX helper app to track battery usage. (You don't need to use their kernel to use the helper app). I like it because it breaks the battery usage stats into two parts: when the screen is on, and when the screen is off, but it doesn't attempt to give a percent of remaining chargeable capacity. I'm not aware of an app that does that (although I too would be interested to know if such and app exists).
duh1 said:
Btw OT question, looking to move over my wifi connections from the previous phone and can't find the wpa_supplicant.conf file in /data/misc/wifi in the 3a. No reference online mentions that it's been moved. Any idea where they're hiding it now? Thx...
Click to expand...
Click to collapse
I think the info you are looking for is now stored at /data/misc/wifi/WifiConfigStore.xml.
As I use my phone more, I realize that none of the charging switches seem to work 100% of the time as expected. I'll continue to do trial and error tests, but please share if you find a switch that works consistently.
I've continued to edit my original post to provide as much information about the different charging switches and the issues I see with each one. Hopefully it is easy to understand.
I still find myself defaulting to the 3rd charging switch option and while it can act a little erratic sometimes, it does work normally most of the time.
Is it possible to disable/bypass the cool down period?
creeve4 said:
Is it possible to disable/bypass the cool down period?
Click to expand...
Click to collapse
The default setting is for it to be turned off I believe. Look in the config file for "coolDownRatio=" and see if it is blank. If it is not, you can remove everything after the equal sign.
Another way to do it is set the cooldown threshold number to be equal or higher than your "pause" threshold. So you might set this as "capacity=5, 100, 70-90". The 100 represents the value at which the cooldown process would start, which is higher than the pause threshold (at 90 in this example) and therefore would never kick in.
All this being said, I find that the #3 switch option seems to allow the cooldown pause/charge process to start below the set cooldown threshold. I have my cooldown threshold set at 60, yet find the phone pausing and charging at battery levels below this threshold. This should not be happening, but is something I can live with, so I haven't bothered to follow up with it.
After several more weeks of use, I've updated the initial post again. I found some quirks with the "automatic" charging switch, so I have gone back to selecting charging switch option 2 (battery/charge_disable 0 1).
Great job!
May I ask you whick kernel you are using for "battery idle mode" support? It should not be supported on stock kernel.
Thanks

Categories

Resources