15

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. Is there any command or setting that would let me disable charging from the power adapter?

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.

0
10

Use osx_battery_charge_limit.

Follow the instructions on github:

# 1. Install command-line tools
xcode-select --install

# 2. Install Homebrew
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

# 3. Install Python3
# Alternatively, you can also get python3 from python.org
brew install python3

# 4. Download battery tool
# Grab project for "Intel only Macbook (OSX) limit maximum battery charge"
git clone --recursive https://github.com/DevNulPavel/osx_battery_charge_limit
cd osx_battery_charge_limit
sudo python3 main.py -s 80

I think 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, sudo python3 main.py -r. You can automate this switching between 80% and full using cron.

There is also a GUI version: https://github.com/godly-devotion/charge-limiter. Both work by setting the BCLM key in SMC to a custom value.

For M1 Macs and macOS 11 (Big Sur), use AlDente.

3
  • If I understand the process you've described, it would seem that Homebrew isn't actually required - is it? Have you tried this yourself? Anyway - good answer I think - I've searched for something like this, but hadn't had any luck.
    – Seamus
    Nov 21 '20 at 4:45
  • Why not just download python3 from python.org/downloads as they do have a macOS 64-bit installer! Nov 21 '20 at 10:43
  • +1 to GUI Version, no fuss, no weird steps
    – WurmD
    Sep 6 at 10:42
9

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

1
  • 5
    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) Jan 7 at 12:14

You must log in to answer this question.

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