91

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?

2

10 Answers 10

66

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.

9
  • 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! Commented Oct 11, 2023 at 19:51
  • The "real battery charge level" command no longer works on Apple Silicone macs. Anyone know how to update it?
    – Joy Jin
    Commented Oct 12, 2023 at 1:28
  • 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
    Commented Jan 26 at 9:17
  • 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
    Commented Jan 29 at 4:42
  • 1
    Correction: blcm read to bclm read
    – WoLfPwNeR
    Commented Feb 7 at 19:19
22

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

7
  • 60
    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) Commented Jan 7, 2021 at 12:14
  • 30
    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.
    Commented Nov 9, 2021 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
    Commented Mar 6, 2023 at 7: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
    Commented Jan 10 at 4: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
    Commented Jan 10 at 5:09
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.
0
8

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%.

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

0
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%

2
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.

0
0

I use this shortcut that I run when I'm working at my desk and need to plug-in:

Repeat 120 times(Get Battery Level, If Battery State is greater than or equal to 80, Show notification, End if, wait 60 seconds)

0
0

This shortcut will run in the background once activated. It will detect if your Mac is charging within 15 minutes based on an increased battery percentage. You can program it to perform any action. For instance, I have programmed it to notify me to charge my laptop when the battery percentage drops below 25% (Battery Level) and to remove the charging adapter when the battery percentage exceeds 75% (Charging Level).

You can adjust the wait time to anything between 5 and 20 minutes for optimal resource consumption.

To add a new shortcut on a Mac, follow these steps:

  1. Open the Shortcuts App:
    Click on the Launchpad icon in the Dock. Type "Shortcuts" in the search bar and press Enter.

  2. Create a New Shortcut:
    In the Shortcuts app, click the + button or the Create Shortcut button.

  3. Add Actions to the Shortcut:
    Click Add Action. Browse or search for the action you want to add to your shortcut (e.g., open an app, send a message, etc.). Click on the desired action to add it to your shortcut.

  4. Configure Actions:
    Customize the actions according to your needs (e.g., specify the app to open, the message to send, etc.).

  5. Save the Shortcut:
    Click Done to save your new shortcut. Give your shortcut a name by clicking on the shortcut name at the top of the editor and typing a new name.

  6. Use the Shortcut:
    You can run your new shortcut by opening the Shortcuts app and clicking on the shortcut, or you can add it to the Dock, Menu Bar, or use a keyboard shortcut to run it quickly.

Screenshot of the steps in a Shortcut to charge a Mac to 80 percent

0

Try BatteryOptimizer for MAC. It is a light-weight CLI tool that I made from battery, but with new features such as supporting both Apple and Intel Macs, and providing scheduled calibration. More details below

New features

  1. support both Apple and Intel CPU Macs
  2. sail mode, allowing the battery to sail from maintain percentage to sail target without charging
  3. scheduled calibration, starting automatic calibration on specified days per month (at most four days) or specified weekday every 1~4 weeks
  4. charging limiter still works even when macbook sleep or shutdown
    • Intel CPU: limit is at maintain percentage
    • Apple CPU: limit is fixed at 80% (Note: MacOS Sequoia not supported because Apple no longer provide this function. Still works when macbook is not sleep or shutdown)
  5. add battery daily log and notification to show battery capacity, voltage, temperature, health, and cycle count

Enhancements

  1. replace inaccurate macOS battery percentage with real hardware charging percentage.
  2. send notifications when each step of calibration is completed
  3. notify user to open macbook lid before calibration is started, and start calibration immediately when macbook lid is open
  4. prohibit discharge when macbook lid is closed to prevent entering sleep mode unexpectedly

Usage

  • battery maintain 80 50
    means maintain at 80% with sailing to 50%
  • battery schedule day 6 16 26 hour 18 minute 30
    means calibrate on Day 6, 16, 26 at 18:30*
  • battery schedule weekday 0 week_period 2 hour 21 minute 30
    means calibrate on Sunday every 2 weeks at 21:30*

Basically BatteryOptimizer for MAC is a free open-source light-weight tool to replace AlDente and coconutBattery.

3
  • While self-promotion is (within limits) acceptable, you need to clearly indicate that it is your product.
    – nohillside
    Commented Oct 27 at 8:33
  • Also, "macOS Sequoia not supported because Apple no longer provide this function" restricts its usefulness, somehow.
    – nohillside
    Commented Oct 27 at 8:34
  • @nohillside It still works when the macbook is not sleep or shutdown, though. Even AlDente can not work for Sequoia when sleep or shutdown. I just edited it to indicate I'm the author of this project, not product since there's no charge
    – JS Jiang
    Commented Oct 27 at 9:59

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .