Themes / Apps / Mods [MOD/magisk/root] Set charging limit to 80/85/90/95% v2

Search This thread

LeoPeink

Member
Jan 12, 2023
11
1
Google Pixel 7
From what I have tested so far, it is something like this:

The charge_stop_level is the trigger, it starts the "no-charge mode".
Once it starts, the charge_start_level is the "reset" of it.

except:

If the charge_stop_level is at default, the whole thing seems to be ignored.
Besides the charge_start_level, there are some other "reset" mechanisms, like reboot/plug-unplug cable multiple times, etc. etc. I randomly found.

It is a blackbox atm until someone read google's source code and explain it.
I managed to solve all my issues with AAC and AccA. They work awesomely, but you have to set the right trigger. No need to write a front end app when AccA works beautifully.
 

StanWiz

Senior Member
Oct 27, 2014
92
32
I managed to solve all my issues with AAC and AccA. They work awesomely, but you have to set the right trigger. No need to write a front end app when AccA works beautifully.
Are you setting your triggers with the akp? Care to share your settings? In my instance acc is a hit or miss affair - at times it charges to 100%.
Thanks
 

LeoPeink

Member
Jan 12, 2023
11
1
Google Pixel 7
Are you setting your triggers with the akp? Care to share your settings? In my instance acc is a hit or miss affair - at times it charges to 100%.
Thanks
Ok, this is the export config output from AccA.

[{"profile":{"uid":4,"profileName":"Daily (80-85)","accConfig":{"configCapacity":{"shutdown":2,"resume":80,"pause":85},"configVoltage":{},"configTemperature":{"coolDownTemperature":35,"maxTemperature":45,"pause":90},"configResetUnplugged":false,"configResetBsOnPause":false,"configChargeSwitch":"/sys/devices/platform/google,charger/charge_stop_level 100 5","configIsAutomaticSwitchingEnabled":false,"prioritizeBatteryIdleMode":true}},"mIsChecked":true}]

ACC version is V2022.7.30-dev (the latest), and I'm not using djs. Just the daemon running.
It works 100% of the times, even with Wireless Charging.
Although with slow chargers, like 500ma ones (5W old bricks) it does not work well, but i use a 5V 2A Xiaomi charger and a 12W Samsung Wireless Pad and it stops every time at 85%, to resume at 80%.
 
  • Like
Reactions: StanWiz

StanWiz

Senior Member
Oct 27, 2014
92
32
Ok, this is the export config output from AccA.

[{"profile":{"uid":4,"profileName":"Daily (80-85)","accConfig":{"configCapacity":{"shutdown":2,"resume":80,"pause":85},"configVoltage":{},"configTemperature":{"coolDownTemperature":35,"maxTemperature":45,"pause":90},"configResetUnplugged":false,"configResetBsOnPause":false,"configChargeSwitch":"/sys/devices/platform/google,charger/charge_stop_level 100 5","configIsAutomaticSwitchingEnabled":false,"prioritizeBatteryIdleMode":true}},"mIsChecked":true}]

ACC version is V2022.7.30-dev (the latest), and I'm not using djs. Just the daemon running.
It works 100% of the times, even with Wireless Charging.
Although with slow chargers, like 500ma ones (5W old bricks) it does not work well, but i use a 5V 2A Xiaomi charger and a 12W Samsung Wireless Pad and it stops every time at 85%, to resume at 80%.
Not that different from my settings. I'll try playing with it a bit. Thanks


[[{"profile":{"uid":2,"profileName":"Charge to 90%","accConfig":{"configCapacity":{"shutdown":5,"resume":70,"pause":89},"configVoltage":{},"configTemperature":{"coolDownTemperature":40,"maxTemperature":45,"pause":90},"configOnPlug":"9000000","configResetUnplugged":false,"configResetBsOnPause":false,"configIsAutomaticSwitchingEnabled":true,"prioritizeBatteryIdleMode":true}},"mIsChecked":true}]
 

evtoofly

Senior Member
Feb 20, 2019
146
10
Google Pixel 6
Noob question but does this mean I no longer need to use acc? I would like to try this with my pixel 6a but know if this can be used to override acc or I need to use both at once. Does this also fix the overheating when charging?
 
Jun 9, 2018
38
20
I'm unsure if this has been asked here (Not a fan of the search function). But is there a way to use this mod to set the max battery to say for example I'm using the 90% mod, but then have the phone display 100% even though it's really only going to 90%?
 

kylechen

Senior Member
Feb 13, 2009
115
59
I'm unsure if this has been asked here (Not a fan of the search function). But is there a way to use this mod to set the max battery to say for example I'm using the 90% mod, but then have the phone display 100% even though it's really only going to 90%?
That goes down the rabbit hole of the "battery management" arena.
From what I know, there is a complex manufacture + smart-self-updated battery "profile" in binary format mating the physical status and the display status of the battery. (remember the reset battery status function on the old androids?)

Is there a way? Yes, if you are BL unlocked rooted, everything has a way.
Is there an easy way? No, not that ive heard of.
 
  • Haha
Reactions: aimsjahan

Flyview

Senior Member
May 17, 2010
2,555
1,673
Toronto/San Diego
Thanks for this! It's working great on my Pixel 6 Pro. I used ACC in the past but as other have said, it often glitched, and it screwed up the normal charging currents as percentage goes up.
 

Anchewei

New member
Jul 30, 2023
2
0
Ok, this is the export config output from AccA.

[{"profile":{"uid":4,"profileName":"Daily (80-85)","accConfig":{"configCapacity":{"shutdown":2,"resume":80,"pause":85},"configVoltage":{},"configTemperature":{"coolDownTemperature":35,"maxTemperature":45,"pause":90},"configResetUnplugged":false,"configResetBsOnPause":false,"configChargeSwitch":"/sys/devices/platform/google,charger/charge_stop_level 100 5","configIsAutomaticSwitchingEnabled":false,"prioritizeBatteryIdleMode":true}},"mIsChecked":true}]

ACC version is V2022.7.30-dev (the latest), and I'm not using djs. Just the daemon running.
It works 100% of the times, even with Wireless Charging.
Although with slow chargers, like 500ma ones (5W old bricks) it does not work well, but i use a 5V 2A Xiaomi charger and a 12W Samsung Wireless Pad and it stops every time at 85%, to resume at 80%.

This set worked for me, I don't get terribly slow charging speed due to some weird setting.
But have you tried to change the charging speed by setting Max voltage or Max Current?
 

fyresg

Senior Member
Dec 8, 2011
121
20
Singapore
Hi, I downloaded P6n_charginglimit_80.zip then installed it as a module in the Magisk app, then rebooted. And verified the module is loaded. Yet my phone charges to 100%. Any ideas what am I doing wrong?

Specs: Xiaomi 13, using xiaomi.eu firmware 14.0.23 (Android 13), and Magisk 26.1.
 

fyresg

Senior Member
Dec 8, 2011
121
20
Singapore
Thanks. Google brought me here, and I couldn't tell from the first post nor title that this is only for Pixel 6.
 

Top Liked Posts

  • There are no posts matching your filters.
  • 1
    Yup - you're not using a Pixel 6. This module is app specific.
  • 20
    After some readings on: https://forum.xda-developers.com/t/limit-charge.4355851/
    and https://forum.xda-developers.com/t/mod-magisk-root-set-charging-limit-to-90.4363477/
    ( Credits to @rickysidhu_ and @foobar66 )

    There is a thing I found and tested:
    "charge_stop_level" must be used together with "charge_start_level"
    If set start @40 / stop @60, the phone will begin charging when (and only when) the battery drops to 40%, and stops charging @ 60%.
    (it defines a range, and the first time the user hit the range boundary activates this range function)
    If set stop @90 without setting a start, the phone will refuse the 2nd time charging until the battery drops to default 0 (or the battery service/phone has been restarted)

    (This explained many "phone not charging" reports in the above links posts)


    I like @foobar66's magisk mod solution. It is simple and safe.
    It has only 1 line of working script in the zip.

    So I "clone" it with some different values (added the fix, so 2 lines of script code in each zip now, that's all it does)

    These are for the lazy people who don't want to deal with advanced settings, and who want a 10-second trouble-free simple solution for battery health.


    The 4 clones:

    • P6n_charginglimit_95.zip (charging limit to 95%, it should give you an extra ~30% battery life span in lab-tested theory)
    • P6n_charginglimit_90.zip (charging to 90%, an extra ~60% battery life span)
    • P6n_charginglimit_85.zip (charging to 85%, double the battery life span, recommended for joe and johns)
    • P6n_charginglimit_80.zip (charging to 80%, should give more than double the battery life span)

    Those numbers are the best estimates from other battery research papers, no guarantee.

    To install, pick the one you want and flash it in Magisk.
    To uninstall, simply disable or remove it in Magisk.

    A12.1 tested. It should work on A13.
    Edit: A13 is also confirmed working.
    Reply problems if you find any.
    8
    I use advanced charging controller, I stop charging at 81% and I can regulate voltage as well. Temperature triggers etc it's great.
    I use ACC plus Tasker to keep the battery entering idle mode at around 50% while plugged. I got my pixel 6 last November, now the battery gets 82 cycles so far.
    The thing is, ACC monitors/controls too many components in the system that I don't fully get, and I am not sure if it conflicts with built-in "smart charging" or other circuit controllers or not, and have to combine a Magisk backend module and a root-access frontend APP to make it work with so many details settings to setup....... It is just......too heavy?
    (or I am too old to tinkering those things.....my sad middle-age life)

    These .zips are the "10-second solution" for lazy folks.
    It does only 1 thing, It is transparent and super snappy (only 2 lines of script, no binary), and it can hardly go wrong.....it just works.


    How does it increase battery life by 30%?
    Or you mean battery health ?
    You are right Shakespeare, "life span" to be precise, sorry for my English ahahahah.
    5
    The thing is, ACC monitors/controls too many components in the system that I don't fully get, and I am not sure if it conflicts with built-in "smart charging" or other circuit controllers or not, and have to combine a Magisk backend module and a root-access frontend APP to make it work with so many details settings to setup....... It is just......too heavy?
    (or I am too old to tinkering those things.....my sad middle-age life)

    These .zips are the "10-second solution" for lazy folks.
    It does only 1 thing, It is transparent and super snappy (only 2 lines of script, no binary), and it can hardly go wrong.....it just works.



    You are right Shakespeare, "life span" to be precise, sorry for my English ahahahah.
    I strongly agree, just not worth having to deal with acc, getting idle mode to work, debugging, getting it to work again and hoping it still works. If I get the time to do so might write a module that integrates a slider in settings or as a quick setting to set to what percentage it should charge and executing those lines of code with that percentage.
    3
    Hi, does anyone know if this will also work for the Pixel 7 pro?
    Works perfectly fine on 7 pro
    2
    How does it increase battery life by 30%?
    Or you mean battery health ?