80

I leave my MacBook plugged in for days at a time, so the battery stays charged to 100%. Despite Apple claims to the contrary*, I believe that the battery's capacity would be better preserved if I could keep it at an 80% state-of-charge, so that is my goal unless someone can convince me that taking it above 80% charge has benefits to counterbalance any drawbacks.

https://www.apple.com/batteries/maximizing-performance/

Here are various options, (1) being my most preferred:

  1. A setting to automatically maintain battery at 80% SoC (like my Tesla has)
  2. A setting/command to use the AC adapter for running power only ("not charging" state)
  3. A command to tell my Mac to totally ignore the AC adapter power

(2) could be cobbled into (1) with some kind of script. Even if not possible from the Mac itself, (3) could be cobbled together with an IOT switch. But with (3), it's unclear the lower maintained SoC would outweigh the cost of the additional cycling.

* As of 11 Feb 2022, I can no longer find Apple claims that it's best to fully charge the battery.

Is there any app, command or setting that would let me disable charging from the power adapter?

bmike
  • 235,889
Doug
  • 991

7 Answers7

57

Use bclm (Apple Silicon with macOS 13.0 or higher and Intel Macs)

Follow the instructions on GitHub:

  1. Download signed and notarized binary from releases.
    (Alternatively, you can also get it from Homebrew or compile it manually. Read the GitHub readme for more details.)

  2. Extract battery tool

$ unzip bclm.zip
$ sudo cp bclm /usr/local/bin
  1. Set battery limit
$ sudo bclm write 80
  1. Verify battery limit to 80%
$ bclm read
  1. Reset the limit back to 100% when needed
$ sudo bclm write 100

Notes:

  • It might be better if you set it even lower, for example, 60% or 70%. Then, before you need to use it on battery for a long time, bclm write 100. You can automate this switching between 80% and full using launchd (read man launchd.plist).
  • macOS show charge approximately 3-5% greater than the real value, so it may feel like the tool is not working initially. Use coconutbattery (GUI) or ioreg -l | awk '$3~/Capacity/{c[$3]=$5}END{OFMT="%.3f";max=c["\"MaxCapacity\""];print(max>0?100*c["\"CurrentCapacity\""]/max:"?")}'[1] to calculate real battery charge level.
  • If you are using macOS Catalina or higher, you need to turn off the "Optimised battery charging" function for the tool to work properly, otherwise, the value you set might be overwritten.
  • There is also a GUI version: charge-limiter. Both work by setting the BCLM key in SMC to a custom value.

For Apple Silicon Macs and macOS 11 (Big Sur) and higher, use AlDente.

Alternatively, there is a more lightweight tool with a command line version: battery.

[1] No longer works with Apple Silicon Macs.

Joy Jin
  • 2,733
  • My M1 Pro 16 inch Ventura 13.6 no longer self calibrates it's battery optimization ever since I installed Workspace One Intelligent Hub from VMWare for my corporation. I am using AlDente to force the 80% battery optimization. Thank you! – Weston A. Greene Oct 11 '23 at 19:51
  • The "real battery charge level" command no longer works on Apple Silicone macs. Anyone know how to update it? – Joy Jin Oct 12 '23 at 01:28
  • Have you tried the latest version of bclm? – Seamus Jan 19 '24 at 02:16
  • @Seamus Could you please explain what you mean by your question? I think it might be valuable to still keep the link to battery tool since it works well with Apple Silicon macs which actually only have a binary charging on/off switch – Joy Jin Jan 26 '24 at 03:53
  • 1
    I was just curious about your recent experience - if you have an Apple Si Mac. My system doesn't work as expected. I filed an issue, but it was dismissed. But yes - by all means - keep any links you have to battery; they seem to be more interested in functionality than bclm. – Seamus Jan 26 '24 at 09:17
  • @Seamus I actually haven't tried bclm on my m1 max 16'' macbook since when I got it bclm seems to not support Apple Silicon yet (it seems like support is added recently)and battery seems to be written for Apple Silicon specifically, and I just stick with battery since because it works. I can try bclm but it seems like it requires a newer firmware version (not sure what that refers to specifically). If you can monitor the value of CHWA key using smc and see if that changes, that might give a clue as to why it's not charging. If it doesn't change then it's not an issue with bclm. – Joy Jin Jan 29 '24 at 03:44
  • 2
    No - bclm definitely "supports" Apple Si Macs... they state this on their GitHub repo. Wrt firmware version, this statement from the bclm README.md file: "For Apple silicon machines, only the values 80 and 100 are supported and firmware >= 13.0 is required." But - I think you've made the better choice in using battery. WRT firmware: Yeah - I'm also unsure. I know firmware updates are included with OS upgrades, but have no idea where to get the version #. – Seamus Jan 29 '24 at 04:42
  • 1
    Correction: blcm read to bclm read – WoLfPwNeR Feb 07 '24 at 19:19
21

macOS 10.15.5 on a Mac notebook with Thunderbolt 3 ports has this option (even a bit smarter) embedded, see Optimised battery charging.

https://support.apple.com/kb/HT211094

System Preferences: Battery

grg
  • 201,078
Jarek
  • 396
  • 54
    Unfortunately, "even a bit smarter" is failing for me. The OS has yet to figure out when to stop at 80%, and I doubt it ever will (my routines are unpredictable) – Johannes Hoff Jan 07 '21 at 12:14
  • 26
    Indeed. Not very smart at all :) I would much prefer to have a manual setting, instead of having to rely on hacks like given earlier. – Faruk D. Nov 09 '21 at 14:09
  • If your 'routines are unpredictable', then that suggests you are actually unplugging it every now and again and using the battery, which means you don't need to keep it at 80% so much. By far a bigger factor in ageing is heat. – benwiggy Mar 06 '23 at 07:50
  • My routines are also unpredictable, but along the lines of draining it around 30% per week. I hardly use the battery, but this unpredictability has prevented Optmizing Battery Charging from reliably kicking in. Also, MacBooks are generally very good at keeping battery temperatures low despite the temperature of other parts of the laptop. – Oion Akif Jan 10 '24 at 04:57
  • 1
    Case in point: here is my battery usage for the last two weeks. I hardly use battery power but that's enough to prevent Optimized Battery Charging from kicking in (which has always been enabled). – Oion Akif Jan 10 '24 at 05:09
  • Yeah, the OS seems really bad at handling if you unplug only occasionally, even after many months to learn — third-party software seems to be the way to go.  Having had batteries die in more than one previous MacBook, I'm happy to sacrifice 20% for longevity! – gidds Jan 19 '24 at 15:49
  • Same problem here on M3 MBP, the "Optimized" charger sometimes decides to charge it up to 100% and sometimes if it's at 100% it actually lets it run on battery down to 80% even though the charger is connected. It's like it can't make up its mind. I've only had it for 3 weeks though so maybe it's "learning" still.. – BjornW Feb 12 '24 at 09:37
12

You can try AlDente (there is also a Pro Version):

  • Charge Limiter allows you to set your maximum charging percentage between 20 and 100 percent. You can either set it by using the slide bar or by typing in the desired percentage in the field above and pressing enter afterwards.
  • Discharge - This feature allows your MacBook to run completely on Battery even if it is plugged in. Therefore, you can actively discharge your MacBook to a more healthy percentage. Unfortunately, while Discharge is activated, clamshell mode is not supported due to technical limitations.
nohillside
  • 100,768
  • 5
    AlDente has downsides, though. It's an app that runs, consumes noticeable amounts of CPU time, occupies space in the menu bar and overall does many more things. I wish there was a simpler solution for only limiting the charge to 80% on Apple Silicon macs. – Jan Rychter Sep 07 '22 at 16:41
  • @JanRychter I added a simpler solution to my answer. – Joy Jin Jan 02 '23 at 03:56
7

There are some new options for Macs with Apple Silicon. Apple refers to their system for battery charging as "Optimized Battery Charging"; the OP's question seems to be asking about "Limited Battery Charging". I feel that many of the issues reported with Apple's "Optimized Battery Charging" have to do with how Apple has optimized it.

Apple's software is mostly all proprietary and closed-source, so there's no way to know for sure what's going on, but we do know that Apple relies on periodic "battery calibration" for reporting the state of charge. We also know that battery calibration requires occasional charging the battery to 100%.

Therein lies the problem:

Achieving the battery longevity benefits of maintaining an 80% charge level
VS.
When & how often to re-calibrate the battery by charging to 100% to maintain accurate reporting?

How well Apple has balanced these competing objectives may depend quite a lot on the individual user's usage profile. Which may explain the number of questions/complaints.

Also: Given that Apple's "calibration" keeps the battery between 80% charge and 100% charge, one might wonder how effective a calibration can be if it's kept in such a narrow range. There's a good article at the Battery University explaining how calibration works, and why it's valuable. But this is not how Apple does it... suffice it to say that apparently Apple has not read (or doesn't believe) this article.

If your experience with Apple's "Optimized Battery Charging" leaves you feeling less than enthusiastic, perhaps you should investigate one of the apps that implements "Limited Battery Charging". Here's a short list of apps that implement "Limited Battery Charging" for Macs with Apple Silicon:

  1. AlDente - Charge Limiter, commercial edition

  2. AlDente - Charge Limiter, open-source edition

  3. Battery-Toolkit; fm 'mhaeuser'

  4. battery; fm 'actuallymentor'

  5. batt; fm 'charlie0129'

  6. bclm; fm 'zackelia' - see this issue before installing

In general, these "Limited Battery Charging" apps focus almost entirely on battery longevity, and leave the periodic calibration function to the user. This may amount to simply disabling the charge limiting function, and allowing the charger to charge to 100%.

Seamus
  • 4,547
6

There is also Energiza Pro. It supports Apple silicon MacBooks and allows you to set flexible charging limits. (Disclaimer: I'm the developer.)

enter image description here

2

Tried below and it worked.

Open Terminal and run

xcode-select --install
git clone --recursive https://github.com/DevNulPavel/osx_battery_charge_limit
cd osx_battery_charge_limit
sudo python3 main.py -s 80

I set limit to 70 and it does stop charging until 72%

nohillside
  • 100,768
2

If you don’t like the many open source options in this Q&A - one more lightweight app that works well is Charge Limiter. It doesn’t work on Apple Silicon, so it’s for Intel based macOS systems.

bmike
  • 235,889