Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make MagSafe charging LED green when 80% #71

Closed
jakjakob opened this issue Feb 14, 2023 · 25 comments
Closed

Make MagSafe charging LED green when 80% #71

jakjakob opened this issue Feb 14, 2023 · 25 comments
Labels
help wanted (PR welcome) Extra attention is needed

Comments

@jakjakob
Copy link

Is your feature request related to a problem? Please describe.
I want to have my battery at 80%, but since there is the possibility to check even if the computer is closed (the MagSafe LED), I don't want to miss it out using battery

Describe the solution you'd like
Whenever the battery reaches 80% (the charging limit) the MagSafe LED should turn green

Describe alternatives you've considered
Opening the MacBook (but impractical)

@NdR91
Copy link

NdR91 commented Feb 22, 2023

I'm not sure this is possible...

@jakjakob
Copy link
Author

It is! Al Dente did it.

@omniwired
Copy link

not sure how they did it but here is more information about it.
https://apphousekitchen.com/feature-explanation-control-magsafe-led/

Is part of the paid version, so the code is not open source.

@jonahclarsen
Copy link

This would be amazing! I wonder if anyone has open-sourced any code to do this. I personally would prefer to just disable the Magsafe LED altogether, at least while charged.

@actuallymentor actuallymentor added the help wanted (PR welcome) Extra attention is needed label Mar 15, 2023
@actuallymentor
Copy link
Owner

If you can find the SMC key for it I'm happy to add it.

@jonahclarsen
Copy link

I looked more into it and I couldn't find the SMC key but it seems like the AlDente team may have taken the code from an open-source project, so it shouldn't be too hard to find. I asked about it on stackoverflow and the answer I got seems to point in the right direction: https://stackoverflow.com/questions/75738532/control-magsafe-leds-on-apple-silicon-macbook/75738890#75738890

@omniwired
Copy link

Nice find!
It seems that is different for M1 macs and intel macs

@jonahclarsen
Copy link

@omniwired It seems that app is Intel only, but I don't see any indication that the SMC key for MagSafe LEDs is different on Apple Silicon macs, are you seeing that somewhere?

@omniwired
Copy link

I have an M1 mac and use the key used in https://github.com/zackelia/bclm/blob/master/Sources/bclm/main.swift#L56

I've got this:

 /usr/local/bin/smc -k BFCL -r  
  BFCL  [    ]  no data

That makes me think it might be different.

@actuallymentor this is the key to use BFCL.

@actuallymentor
Copy link
Owner

@omniwired ah thank you for finding it! Are you open to creating a PR for this?

@whiterock whiterock mentioned this issue Aug 3, 2023
@ibrado
Copy link

ibrado commented Aug 23, 2023

If you can find the SMC key for it I'm happy to add it.

From the batt project,

ACLC
03, 04

        sudo smc -k ACLC -w 04 # orange
        sudo smc -k ACLC -w 03 # green

Tried the above; they work! 😄

@jakjakob
Copy link
Author

If you can find the SMC key for it I'm happy to add it.

From the batt project,

ACLC 03, 04

        sudo smc -k ACLC -w 04 # orange
        sudo smc -k ACLC -w 03 # green

Tried the above; they work! 😄

obv. with sudo sec -k ACLC -w

01 off
06 slow blinking orange
07 fast blinking orange
16 blinking
17 blinking

25 blinks off (blinks a few times and LED gets off)

It would be nice to have an option to turn it completely off, or keep it blinking while in battery maintain? (and maybe add a no-blink option bc it is prob. a bit distracting)

@jakjakob
Copy link
Author

jakjakob commented Aug 24, 2023

I tried it until 25, may try other later on; for the people wondering the other codes just are repetitions from before (plain green, plain orange, off). The blinking are all different speed, that's why I mentioned them all

@actuallymentor
Copy link
Owner

@jakjakob I might play with this today. Is there a code for "resume automatic behaviour"?

@jakjakob
Copy link
Author

@jakjakob I might play with this today. Is there a code for "resume automatic behaviour"?

I don't know, since I haven't tested it yet with battery full loaded. Maybe try the first few codes and see if they change behavior with battery at 100% and not. It could be 02 or 00, since both gave orange output while having battery under 100%. I'll try also if maybe replugging the charger resets it. Do you know any way to find out which code it is currently running? Maybe so we can find out what the dafault(s) are

@actuallymentor
Copy link
Owner

Allright, new release published!

Could you test it @jakjakob? I'm coding in a car without power.

@omniwired
Copy link

I think you meant 71 on the release notes

@actuallymentor
Copy link
Owner

actuallymentor commented Aug 24, 2023

@omniwired, yes, yes I did. Edited, thanks for pointing that out.

And added you as thanks, I overlooked you, sorry :)

@tchajed
Copy link

tchajed commented Aug 24, 2023

This worked for me; after updating and restarting my MagSafe LED changed from orange to green. It seems like such a small thing but it feel great to have a green LED. Thanks for your work on this everyone!

@actuallymentor
Copy link
Owner

Thanks for confirming @tchajed! I will close this issue. If anyone encounters an issue I will reopen it.

@omniwired
Copy link

it works really well!

@ibrado
Copy link

ibrado commented Aug 26, 2023

Needs a little improvement... if you connect the MagSafe charger when the battery is already at 80%+ , it will show an orange LED that doesn't eventually turn green. Menu correctly says "Power: smc charging disabled"

@omniwired
Copy link

@ibrado @actuallymentor if you disable and then re-enable the limit, it changes to green

@ibrado
Copy link

ibrado commented Sep 19, 2023

Submitted PR #184

@bmarkkkkk
Copy link

hey guys! thanks for the great work. so this definitely does work, but one issues is if the battery is already at 80% or above, and you plug the charger, it will remain orange forever, would be great if you can poll the charge status and set the LED to green whenever it is 80% or greater, rather than crossing. thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted (PR welcome) Extra attention is needed
Projects
None yet
Development

No branches or pull requests

8 participants