Can I tell my Mac to charge to 80% only?

Solution 1:

Use osx_battery_charge_limit (Intel MacBook only).

Follow the instructions on github:

# 1. Install python3
# Alternatively, you can also get python3 from python.org
# Install command-line tools
xcode-select --install
# Install Homebrew
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
# Install python3
brew install python3

# 2. Download battery tool
git clone --recursive https://github.com/DevNulPavel/osx_battery_charge_limit

# 3. Set battery limit
# Note: you do not need to restart for the command to work; just wait a few seconds for the change to be reflected.
cd osx_battery_charge_limit
sudo python3 main.py -s 80

# 4. Reset the limit when needed
sudo python3 main.py -r

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, sudo python3 main.py -r. You can automate this switching between 80% and full using ]launchd (read man launchd.plist).
  • macOS might 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:"?")}' to calculate real battery capacity.
  • If you are using macOS Catalina, you need to turn off the "Optimised battery charging" function for the tool to work properly.
  • 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.

Solution 2:

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