godly-devotion / charge-limiter

macOS app to set battery charge limit for Intel MacBooks
GNU General Public License v3.0
649 stars 28 forks source link

Charge indicator LED on Magsafe connector #10

Closed fnarfbargle closed 4 years ago

fnarfbargle commented 4 years ago

While this software works brilliantly to limit the final charge on the battery, on my MacbookPro 11,1 the charge led on the magsafe connector always remains orange.

After a bit of a poke around on my machine the BFCL key sets the level at which the SMC turns the led green. So to set the battery limit at 75%, BCLM=4b. If I set BFCL=4a then the battery charge led works correctly.

Hope this helps.

godly-devotion commented 4 years ago

Hmm, do you know what values the BFCL is taking? Is it a hex value?

fnarfbargle commented 4 years ago

It is on my machine. Takes the same format as BCLM. By default it was 5f. I found as long as it was at least the BCLM value -1 it did the job. I simply set it with smcutil -w BFCL 4a This is an excerpt reading the SMC in Linux (the integers at the end are simply the index into the list, not values) :

BCLM  [ui8 ]  4b 80
BFCL  [ui8 ]  4a 83
godly-devotion commented 4 years ago

Interesting. Seeing how the BFCL value is defaulted to 5f (95%), I wonder if it should be safe to set it to BCLM-5. At least then when the user resets the BCLM back to 100 we will revert the BFCL to 95. I will test this out on my machine and if it looks good I will add this feature to the app. Thanks for your help!

godly-devotion commented 4 years ago

@fnarfbargle It seems that the BFCL value doesn't exist for some combo of MacBook & macOS. Could you tell me what version of macOS are you running?

fnarfbargle commented 4 years ago

Product Name: MacBookPro11,1 OSX : 10.15.7 Boot ROM Version: 162.0.0.0.0 SMC Version (system): 2.16f68

I assume I'm running the latest firmware and EFI. I'd have thought if it supported BCLM it'd support BFCL, but perhaps the hardware or SMC firmware doesn't support it on some models.

godly-devotion commented 4 years ago

Hmm I’m not seeing a pattern as to which ones have BFCL available. Thank you anyway.