yashsingh1/xdaforums huggingface dataset:
[Android Apps and Games] aamadorj:
You can use a free "terminal emulator" app to manually change the control file to writable. For my old Nexus 5 the script runs this command automatically, but it can be run manually after boot also, using the terminal emulator with root privileges:

chmod 0644 /sys/devices/f9923000.i2c/i2c-84/84-006b/power_supply/ac/charging_enabled

The control file and path is the one suitable for your device.
[Android Apps and Games] JustIceForSake:
Thank you very much for the reply.

Is the path you indicated exactly the same I should be looking on my device? I'm asking because I searched for it and can't find it. I'm using "X-plore" file manager with root enabled and it's set to show hidden files.

As you can see in the image attached I don't have the "f9923000.i2c" directoty.
[Android Apps and Games] aamadorj:
You have to look for the control file which is the right one for your device.and make sure that one is writable.
[Android Apps and Games] jazic:
For anyone who still uses this, I think I found the file that controls the Pixel 5.

For me I could get it working with wireless but haven't found the general battery charging control file.

Anyways, long story short it's:

/sys/class/power_supply/wireless/online

1 = enable

0 = disable

AFAIK it only works with wireless. Cannot verify if it works with a plug or not. You might also need to fiddle with the advanced settings because it tries to fight you a few times to charge when it's not 100%.
[Android Apps and Games] drevel123:
On OnePlus 8 Pro you have to use this file to disable Wireless Charging. Values for enabling/ disabling charging are the opposite of the normal values.

/sys/class/power_supply/wireless/op_disable_charge

Enabled: 0

Disabled: 1
[Android Apps and Games] megatron_lives:
Just a quick question. I found this app after my LG G5 battery started to bulge. I have the phone on and charging constantly as I use it as a music player. I assume if I use this app and set say max as 85% and low as 20%, I can get a new battery and leave the phone on 24/7 knowing the battery will be 'free' of overcharging and the battery can just keep cycling through charging and discharging?

Or what would people recommend for an alway on phone to maintain better battery health?
[Android Apps and Games] larsdennert:
Even better leave it at 50%. That's The happy spot.
[Android Apps and Games] megatron_lives:
Awesome thanks. So stop charging at 50%, but what should the minimum be to resume charging?
[Android Apps and Games] larsdennert:
You could do a larger gap than most people do like 30%-50%. Lithium batteries hate being overdischarged and over charged but like being in the middle. They also don't like over heating.
[Android Apps and Games] JAVOLL007:
Did anyone find a working charging switch for pixel 5?

Have been testing files for a whole day but came up empty.
[Android Apps and Games] cheptii:
did you try this ?
[Android Apps and Games] JAVOLL007:
Yes I did, but didn't work because I have no subfolder "charger" under power_supply
[Android Apps and Games] cheptii:
Maybe it is worth a try anyway.

I tried the control file in the first quoted post for wireless charging, and it worked even though I couldn't find the directory with a file explorer
[Android Apps and Games] JAVOLL007:
Tried the wireless folder, but can verify if it works because I don't have a wireless charger yet. But I can say that that control file doesn't work for usb. I also tried the same path for usb, which is

sys/class/power_supply/usb/online

and

sys/class/power_supply/dc/online

but none of them work. I really start to think Google doesn't want us to edit those files anymore on Pixel 5.
[Android Apps and Games] yakalelos7:
Hi people i always use this app. I buy now an galaxy note 10 plus and i am rootless . I dont want to root this divice . Is it possible to give permissions or make this app work with adb commands ?
[Android Apps and Games] zputnyq:
It's not possible, it could only work with root since the file needed is in kernel level. If your device isn't rooted you better go with an app that could notify battery limit charge reach or some kind of tool that could stop it from charger as mentioned here before.
[Android Apps and Games] rodfantana:
Pixel 4A 5G control file

I think I may have found the control file for Pixel 4a 5G. (android 11 with latest Nov patch; rooted with Magisk 21.1). It might be the same for the original Pixel 4A but i wouldn't know. I can see the value changing 0/1 depending on whether the charger is plugged in or not. The only issue is I can't edit that file. Permissions are 666. I tried with Root Explorer and Total Commander, but they both seem to see no space left in /.

control values are in /sys/devices/platform/soc/c440000.qcom,spmi/spmi-0/spmi0-02/c440000.qcom,spmi:qcom,pm7250b@2,qpnp-smb5/powersupply/usb/online

Any suggestions on how to edit it?

EDIT: looks like bad news - https://xdaforums.com/pixel-4-xl/help/modify-files-rooting-t4018899.
[Android Apps and Games] mj7649:
I tried:

/sys/kernel/debug/google_charger/input_suspend with 0 for charging and 1 for disconnect and it seems to work for my Pixel 4A, not sure if Pixel 5 has the same control file
[Android Apps and Games] rodfantana:
how are you able to write to /sys? mine says "/sys not enough memory"
[Android Apps and Games] mj7649:
hummm all I did was unlocked bootloader and rooted with magisk, and then I set that file path in "Configure Control Data" in the Battery Charge Limit app, I didn't do anything else special, I am new to this but that error sounds like a permission problem...
[Android Apps and Games] iamlaybhari:
Great app. I wish I wouldn't have to root the phone in order to set the battery charge limit. :good::good::p
[Android Apps and Games] mmoiron:
Feature request / application idea:

I no longer root my smartphones but this is something I'd like to have. I've tried to do something similar with Tasker but didn't manage to get it working properly. It would be nice if your application was able to send GET requests to switch ON or OFF a smartplug (sonoff basic with Tasmota but should work with others) thus controlling the charging process. Another nice functionality would be to keep battery level between two thresholds, say 75-80, until time to next alarm is less than a certain time (1 hour). This would allow us to charge our smartphones every night, without having it fully charged for too long, yet maintaining the full charge available when the wakeup alarm is triggered.

Just an idea.

Cheers

MFM
[Android Apps and Games] larsdennert:
Buy a new oneplus phone or iPhone. They have this feature built in.
[Android Apps and Games] sfaeium:
Could you share this script?
[Android Apps and Games] aamadorj:
Sure, it's attached as a text file.
[Android Apps and Games] d3smond:
I have a Xiaomi Mi 10T Pro running Lineage OS with Magisk.

I granted root permission for the app but the app does not work, I set it to 80% but it charged past 80%.

What do I have to change to make it work?

Thx
[Android Apps and Games] yaconsult:
I would LOVE to get this working on my new Pixel 4a 5G. Here are the nodes under the power_supply directory. Can someone tell me how to enable and disable charging on this magisk rooted phone? I am willing to experiment and report back results.

I have uploaded a copy of all the file nodes under /sys/class/power_supply at the following pastebin:

https://pastebin.com/T0VJqiW4

I know something has changed on the 4a 5G because advanced charge controller worked fine on the 3a but on the 4a 5G the phone always thinks it is charging even when ACC has stopped the charging.

Thanks!
[Android Apps and Games] Gibsonflyingv:
I'm also trying to get this to work on my P5. I noticed, when I was looking, only some of those are files are writable. I don't know much about this stuff but I wonder if setting "current max" to 0 once we hit our limit would do it?
[Android Apps and Games] evronetwork:
Wish this app would still be in development, my gf phone(my prev phone) oneplus one works great, as for mine Xiaomi Mi Mix 2S, I need to reset battery stats each time ...but it does honor the limit
[Android Apps and Games] sielhadi:
It works like a charm with galaxy s20 ultra. Thanks
[Android Apps and Games] urekeli:
nice app
[Android Apps and Games] pleomaxell:
I am trying to make it work on Nexus 7 3G. The default /sys/class/power_supply/battery/status file isn't working. It keeps on charging past my set limit. Is there any other way to make it work?
[Android Apps and Games] the_cr0w:
same to me in my asus zenpad 10 :(

it shows only motorola defy+ in the control files, don't know if that is the problem

UPDATE: found out that the app should automatically edit /sys/class/power_supply/battery/charging_enabled but on my device the control file points to /sys/class/power_supply/battery/status , which is a file that does not have a binary value, thus cannot be automatically switched, i guess? however a custom file can be pointed enabling configurable ctrl file data option, but i don't know what file should be. any ideas?
[Android Apps and Games] pleomaxell:
But is there a charging_enabled file on /sys/class/power_supply/battery/?
[Android Apps and Games] the_cr0w:
no! maybe that's the problem ? or maybe there is another file with the same function?

UPDATE: found out that there is a file in sys/class/power_supply/ac/device that is called charge_status, and as expected the content of the file is 0 while not plugged and 1 while plugged. i tried to set that as ctrl file but nothing changed, then i noticed that it has only read permissions, tried to set rwxrwxrwx so that the app could edit the file but changing the permissions bugged my system ui and forced me to reboot. after booting the permissions of the file are reset into r--r--r--. Is this the problem?
[Android Apps and Games] pleomaxell:
There is another file called sys/class/power_supply/ac/online which becomes 1 when the charger is connected. I face similar issue with that file too. The phone restarts as soon as I change the permission and set an upper and lower limit.
[Android Apps and Games] the_cr0w:
eww let me know if you find out anything new... i guess the app is discontinued by the developer as of now, and it's sad because it's still used even in modern devices
[Android Apps and Games] Saqib Mushtaq 74:
S:

Used battery charge limit app to charge only to 99% but now turned off but still it does not charge to 100% now any solution to get 100 chrgd

Like editng some value in root folder

I am using redmi note 7
[Android Apps and Games] amn1987:
If its possible to set the proper permissions then try lowering charge voltage and/or current in constant_charge_current, constant_charge_voltage or voltage_max_design etc. BCL works out-of-the-box in my Poco F1 but in addition I have limited charging voltage and current as well. At 4.15V battery charge hits 80% thereafter the battery light starts blinking. If I then increase voltage to 4.2V battery light stops blinking. But in my case the files are differently named constant_charge_current_max and voltage_max. Dunno if it work for you. Experiment with various files.
[Android Apps and Games] Heinz_P:
I install it today on a Samsung Galaxy Tab SM-T585.

It works fine, but I can not clear the statistik in the Tab.

I delete

/data/system/batterystats.bin to clear stats

But it is still there.

Edit:

Now it works, statistik is ok.

I delete the file, power down the Tab and start again and after 80% the stat is correkt.

Edit 2:

After a new charge the statistik is wrong again and nothing helps to clear it.View attachment 5220787
[Android Apps and Games] @kitokit:
I've been using this app for a while now, I'm using a Mi9 with RR Rom a10, before I set my limit to 85 and 2O percent.. and then I decided to increase it to 90. What I've noticed is, whenever I charge my phone, when my battery reaches 85 it notifies me that it has reached the limit and after a second it will start charging again obviously because I set it to 90, and when that level is reached it will stop charging.. but it will start charging again at 80 percent, even though I set the minimum to 20.. any ideas why is this is happening..

I've already tried to uninstall and rebooted the phone and then reinstall the app, but same problem I face.. any help?
[Android Apps and Games] badryasir@gmail.com:
Hey about the battery problem u has did u find a fix?,im having the same issue
[Android Apps and Games] umibuzu:
Hi, thank you again fot this app.

I use it on my xiaomi MI9 SE , and my TAB S7+ , works perfectly

But....

I installed it on my xiaomi MI10TPRO . Evrything looks right, but the charge does not stop like expected.

Is this phone handled by BCL ?

View attachment 5242549

EDIIIIIIIIIIIIIT:

It seems to be fixed when we switch the control file:

View attachment 5242555

Thank you for this app
[Android Apps and Games] cordezz:
Same problem here, did you find a solution? With my old Pixel 3a it worked perfectly.
[Android Apps and Games] T0unet:
Yes, i've switched on AccA (with ACC bundle)

GitHub - MatteCarra/AccA: Acc app allows to edit acc config file and add a tile to start and stop acc deamon

Acc app allows to edit acc config file and add a tile to start and stop acc deamon - MatteCarra/AccA

github.com

Magisk needed. Available in F-Droid.
[Android Apps and Games] ioctl0:
Accd consume battery itself. Leave phone at night with and without acc and you will see it. Here is a bug:

accd consume too much battery itself · Issue #94 · VR-25/acc

Phone with accd discharge 1.5 time faster at the night. This can be proven using the Battery Historian PC tool. It seems, because it's internal cycle is 10 seconds, so it wakes up and consume battery.

github.com
[Android Apps and Games] cihaneken:
Android devices are already making this limitation. In other words, android already charges your battery between 70% and 80% according to its actual capacity. However, in the interface, we see it as 100%. With this application, you once again add an 80% charge limit to the 80% charge limit set by the system. As a result, you are charging your battery 40% less. On the contrary, what I need is to remove the limit set by the android and charge my battery to its physical capacity. If you know such an application that requires root, please teach me. I currently have a Mi 9 device. By default, Miui allows to fill my battery, which is 3300mah, only up to 2800mah. So when the battery is 2800 mah, 100% is displayed on the interface. I would be glad if you let me know about an application or magisk module that I can exceed this android system limit.
[Android Apps and Games] amn1987:
How did you check that the battery is only being charged to 2800mAh? Does MIUI shows it explicitly because in custom ROMs root is needed to read this value.
[Android Apps and Games] cihaneken:
It does not show directly, the root is required to do this. You can also try the AIDA 64 app. It shows the value correctly on the rooted device but I don't know how the situation is on the non-rooted device.

In my case, when the device reaches 2800 mah, the charging process stops and it shows 100% on the interface. This is actually the way it should be. Thus, the battery life of your device will be longer than normal. Now with the official version miui, I can get 5-6 hours of screen time on my 2-year-old Mi 9 device. But I want more. If I use this device for another year, it is enough for me. I don't care if the battery is dead afterwards.
[Android Apps and Games] amn1987:
I ditch MIUI on my Xiaomi devices at the very first opportunity so I might be mistaken but I think the value being quoted by AIDA64 and many other similar apps is the ACTUAL battery capacity post degradation. For ex. in my Poco F1 around the 10 month mark the battery capacity was reduced from the original 3996mAh to 3596mAh.

/sys/class/power_supply/battery/charge_full This is where the value is stored in my device. Third-party apps simply read this value.
[Android Apps and Games] cihaneken:
I think this is not a time-based degradation. It's a voluntary thing done to extend battery life. I think the battery health of my device is extremely good. Even in the official Miui version, I can get a performance close to the performance of other users in Custom versions. At the other point, there are great reasons why I cannot give up the Miui interface. Better device compatibility than Miui launcher and Others.

My battery should typically be 3300, but now I am getting between 2700-2800 and 5-6 hours of SOT which is not too bad for the Mi 9 device.
[Android Apps and Games] amn1987:
Device Info HW app is a good option. Once granted root it shows both the original and current battery capacity. Accubattery as well.

I was getting SoT ranging from 13-15 hours for the first 6-7 months but later when it fell to 12-13 hours I did a little search and stumbled upon how to derive battery capacity directly from kernel profile.

BTW sys/class/power_supply/battery/cycle_count keeps a record of the total charge-discharge cycles undergone by the battery till date. Mine's at just under 600 currently. Isn't reset after flashing ROMs.
[Android Apps and Games] MagikGab:
Will this app work on an OnePlus 8 with OOS 11.0.4.4? I downloaded the app from the PlayStore and set the correct config. file for OP phones, but I was afraid from one of the firsts comments on PlayStore, saying that even removing the app, the charge limit was not restored to 100%.

Thanks in advance for your reply.
[Android Apps and Games] zputnyq:
Afaik It needs a reboot after uninstalling on some device.
[Android Apps and Games] shahfaishal:
(1) Why only 99%?

(2) Is it same as "AccA" app?

(3) How do we know if the app is working (of course without testing it to charge and discharge)? And there is no inbuilt charging status which can actually tells us if it's charging or discharging when threshold reaches.

(4) What's that setting? (Check Screenshot)
[Android Apps and Games] SGH-i200:
Is your Samsung tablet rooted? I want to use this app on my Tab A 10.5 2018 (SM-T590), which is not rooted, yet.
[Android Apps and Games] THEVAN3D:
I installed this app and it still charged past 80%. I have Pixel 5 on Android 11. In the Select Control File menu I only have one option - Motorola Defy+ (MB526) Experimental. How do I add more options there? Or what do I do to use this app? What do I need to change?
[Android Apps and Games] MoHed:
Same exact problem here on a rooted OnePlus 9.

To quote THEVAND3D...

I installed this app and it still charged past 80%. I have rooted OnePlus 9 on Android 11. In the Select Control File menu I only have one option - Motorola Defy+ (MB526) Experimental.

How do I add more options there? Or what do I do to use this app? What do I need to change?
[Android Apps and Games] amn1987:
This app works by modifying the value of the charge control file. Mostly located in sys/class/power_supply/battery. You have to manually check which control file works in case its even possible for OP9 devices. If nothing works then maybe you need to flash a custom kernel like for ex. Kirisakura kernel for OP7? IIRC.

You can also try ACC module but it didn't work reliably for me. Now I have setup Tasker to control charging in my Xiaomi devices. Plus it can also stop charging if battery temp. gets too high unlike BCL.
[Android Apps and Games] MoHed:
Thank you for the useful reply.

Can you share the Tasker script ?

TIA
[Android Apps and Games] dlareghoe:
I'm doing it the same way, control charging via Tasker by copying the file charging_enabled into the directory. Was long working on OP8, but not more at OP9.

Even on rootet device it is not possible to copy some file into /sys/class/power_supply/battery/ or create some file in it. So my Tasker solution is not working anymore, also no other solution.

If somebody find a way to make directory writeable again, please tell me.

g.
[Android Apps and Games] amn1987:
No issues with sharing it but the charging control file of OP9 is likely to be different from my Poco F1 in which case it won't work. I have also managed to limit charging voltage and current mostly to prevent battery temps. from rising too quickly.
[Android Apps and Games] amn1987:
Oh. I recently moved my Poco F1 to A11 and no issues so far. In your case I think its a kernel issue probably. In a Redmi 3s only charging control worked in Pie and earlier. But from Q and later (which coincided with a kernel upgrade from 3.x to 4.x) it became possible to limit charging voltage and current as well.
[Android Apps and Games] mateomix99:
Hello could sombody help me to get it working with Xiaomi Redmi Note 2?

My device is rooted of course but i cant get it working. It is charging always. Even if i changed control file from Motorola Defy+ to Xiaomi Redmi Note 2(hermes).

Or how could i find control file in my phone? I tried using file manager and found /sys/class/power_supply but theres nothing in this folder.

Could somebody help?

EDIT: i found right path and now it stops charging while reaching limit, but "recharge below" doesnt work. i though that when i have set limit to 80% and recharge below 50% - phone should be charged only when reaching <50 and charging max to 80% but it doesnt work.

it doesnt care about recharge below. how can i fix it?
[Android Apps and Games] amn1987:
I don't know why it doesn't resume charging when battery charge goes below the level set but you don't need to keep the delta so high. 5-10% below your max. charge is better as it will take much less time and not as much heat. The frequent, small charges aren't damaging.

P.S. Try executing the command to resume charging in Termux or any other terminal client to check whether it's working or not.
[Android Apps and Games] megatron_lives:
Hi all. I have an LG G5 and with stock this app works fine with the universal control file. But if I flash Lineage 18.1, it doesn't work. I've tried a few control files to no avail, can anyone recommend a control file to try for lineage 18.1??
[Android Apps and Games] diorlee90:
ya, i think i know why this app cant work on my xiaomi 11 pro, because android 11 restricted modify system so this app can read but cant write (charging/discharing) to control file. we must wait dev find out how to write to system on android 11
[Android Apps and Games] amn1987:
If you know which charging control files have to be tweaked you can use Tasker instead. Works in A11 w/o any issues. I think Macrodroid should also work. I ditch MIUI ASAP in my Xiaomi devices so I can't say if it will work in it or not.
[Android Apps and Games] diorlee90:
i dont know how to configure. I have tested Macrdroid but nothing happen
[Android Apps and Games] amn1987:
If no modification is possible then perhaps a different kernel is needed. Mi 11 is fairly new so you might have to wait a while. Battery Charge Limit seems to be abandoned. ACC also hasn't seen any updates in months unfortunately.
[Android Apps and Games] ercanziyanak:
Hello friends. My phone is Samsung Note 10 plus. This application stops when it is 70%, whereas I set 80%. Is there any ctrl setting you know?
[Android Apps and Games] Twodordan:
Correct me if I'm wrong about this app, but if you stay home like 5 days a week, isn't it better to heep the phone at 100% than to constantly cycle between 70% and 80% every few hours?
[Android Apps and Games] diorlee90:
no bro, keep your phone active between 40% and 90% make your battery better so you can charge your phone everytime between 40 and 90%. i had tested on many phones
[Android Apps and Games] the bolt of thunder:
On OnePlus 9 Pro my phone keeps charging to 100%. The app works on my OnePlus 6T perfectly.
[Android Apps and Games] Flyview:
I just wanted to add for anyone using a Pixel 4 XL, this is the custom control file data you want to set up:

Path Data: /sys/class/power_supply/charger/charge_disable

Enable Value: 0

Disabled Value: 1

Enforce charge limit: disabled

Always Write CFTRL File: enabled

Source: https://xdaforums.com/t/any-way-to-control-charging.4086265/