What are you looking for?

Showing results for 
Search instead for 
Did you mean: 

Automation: how to charge the battery dynamically

(Topic created on: 22-03-2022 03:34 PM)

As I wade through the murky waters of the internet, I've occasionally come across complaints that other phones can do something Samsung can't. In this particular case, dynamic battery charging. What is it? The way the phone charges at night is that it charges to a certain level and then charges the rest of its capacity just moments before you wake up. In theory, this protects the battery. Practically? I don't know.

In any case, our phones can only set the charge to a maximum of 85%. It's done in Settings -> Battery and Device Care -> Battery -> More Battery Settings -> Protect Battery

Screenshot_20220322-114821_Settings.jpg Screenshot_20220322-114834_Device care.jpg Screenshot_20220322-114842_Device care.jpg Screenshot_20220322-114849_Device care.jpg

But what if we want similar behaviour to, say, iPhones? That is, the phone charges to 85% at night and 100% in the morning?

How do you do that?

The solution is automation. The idea is simple: create a rule where the phone charges to a maximum of 85% during the night and then allows charging to 100% in the morning. This can then be tweaked, of course, e.g. different times during the week, different times at the weekend, only at home, etc. But the basis is given.

We will only create a profile to disable protection for a short time, and this is so that we don't show an active profile all day. I will show two options and compare their advantages and disadvantages.


As usual, I'll start with my favorite Tasker. We create a profile based on time and as an entry point we create a task that sets active/inactive battery protection in the system. We select Settings, Custom setting as the action and let Tasker find the correct setting. The strange thing is that with the S22 Ultra this setting is in Global, with the Flip it was in System. A bit of tinkering will be required here. We want to turn protection off, so we set the protect_battery propert to 0. Then we create an exit task with the same command, only this time the value will be 1.

If you are working with the settings for the first time, you will need to enable permissions. Then try manually running the task. If you get a message that you need to authorize the Tasker, you can follow the online help or I can make it easier for you: enable developer options, enable USB debugging, connect your phone to the PC and authorize debugging from that PC. Then you run this command:

adb shell pm grant android.permission.WRITE_SECURE_SETTINGS

If you got lost in the last paragraph, either study more information or go to the next chapter where I describe a more user-friendly procedure.

Note: I recorded the video in czech environment but I hope it's understandable.

Bixby routines

Activate Bixby routines, add a custom routine based on time, and select Battery -> Battery Protection as the action. Done.

Note: I recorded the video in czech environment but I hope it's understandable. 


Why make it complicated in Tasker when it's easy in Bixby routines, you ask? Tasker has two advantages:

  • More extensive condition options. You can play around a lot more with activation conditions. You can do more things. Plus, if you're already using Tasker, there's no reason to have two automation systems.
  • Exit task. This is something that Bixby routines don't have, it just goes to restore the previous state. This means that if you deactivated battery protection and forgot about it, your routine would stop working. Tasker will set everything up as it needs to.
  • You don't need OneUI 4.1 which is required for Bixby routine "Protect battery"


This is what the charging graph looked like tonight, Tasker was used (I didn't test Bixby, but I don't see why it wouldn't work):

Screenshot_20220322-061441_Battery Tracker.jpg

As you can see, the charging stopped at 85% and only continued at the set time.

There is a more advanced method using IFTTT and a smart socket, but this solution is sufficient in my opinion.

Samsung S24 Ultra Black 1 TB | Pixel 8a Bay 128 GB | Samsung Galaxy Tab S9 256GB
Samsung Galaxy Watch Ultra | Samsung Galaxy Buds / Buds2 / Buds2 Pro


The last screenshot highlights a bit of a flaw in the protect battery system.

When phones reach 100% charge, they switch to AC power and the 'charger' becomes a power supply. The battery is only drained if the current draw of the device exceeds what the power supply can deliver. This is good because it reduces wear on the battery when connected to a power source.

During the period protect battery is active in the last screenshot we see the battery is draining. The phone is not switching to AC power mode. This means the battery is draining and the phone will top it up to keep it around 85%. Doesn't sound like a big deal, but once you crunch the numbers you see how damaging this can be.

A phone overnight will likely drain what, about 0.8-1%/hour being generous? Given the phone will reach 85% within 1-2 hours and most people sleep 7-8 hours we can say the phone will be held for 5-6 hours, so at least 5% drain will occur while the battery is being held. That is 5% of a charge cycle the battery sees. Doesn't sound big, but sound adds up.

If you keep a device for 2 years that adds an addition ~37 charge cycles to the battery. (0.05*365.25*2). If you keep it for 3 years it's over 50 additional charge cycles. That will increase battery degradation at those levels, large offsetting what 'protect battery' is even gaining you. Quite disappointing for something designed to help the battery longevity.

One addition factor is if you hold the battery at 15% and then run demanding tasks on the phone. Then the situation is /significantly/ worse if it continues to operate in the same manner.


I wrote that I don't know if it is useful, I just tried if I'm able to emulate the behavior of iPhones by automation. 

I'm not sure that phones are switching to AC, I believe that not and I don't know reasons. Maybe more stable curent?

Samsung S24 Ultra Black 1 TB | Pixel 8a Bay 128 GB | Samsung Galaxy Tab S9 256GB
Samsung Galaxy Watch Ultra | Samsung Galaxy Buds / Buds2 / Buds2 Pro

Samsung Members Star ★★

Thanks for the input @Libb , interesting and informative, obviously remains to be see n how effective.  Know that many customers charge battery overnight but not really a pattern for me.

I do not work for Samsung or make Samsung Products but provide independent advice and valuable contributions.

Samsung Members Star ★★

Thank you for this interesting information @Libb  👍 

I do opt to charge my phone's overnight and they are also powered down too as I have no requirement to have them turned On during the night period.

I've always let my phone's charge to 100% and never let them discharge below 15% ,which has always stood me in good stead.

I was under the impression the phone's charge to 100% and then full charging stops and trickle charging comes into effect to top up the battery if it drops below 100% while on charge.

Daily Driver > Samsung Galaxy s²⁴ Ultra 512Gb ~ Titanium Black.

The advice I offer is my own and does not represent Samsung’s position.
I'm here to help. " This is the way. "

Samsung Members Star ★
Google pixels have that facility as well, no idea why Samsung didn't implement it either way I have always charged overnight all my phones with no issues.
"WI-FI went down for five minutes, so I had to talk to my family.
They seem like nice people"
First Poster

I also use the alarm (Samsun) of my phone (Samsun) because it is very convenient with its scheduling function. Samsung could also simply use that wake-up time to reach 100%.


I'm not so sure it's actually using battery while plugged in and on "protect battery".  I have run my S22+ for considerable amounts of time (months straight!) on AC power the whole time with "protect battery" on.  Every time I check the current in/out of the battery it has said 0.00 amps (not charging or depleting).




I think what the above graph might show is "open circuit voltage" which will be higher right after a battery is charged, then decline a bit as the battery sits and cools down .