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

How to "allow force discharging" is supposed to work? #314

Open
romu70 opened this issue Nov 6, 2024 · 4 comments
Open

How to "allow force discharging" is supposed to work? #314

romu70 opened this issue Nov 6, 2024 · 4 comments

Comments

@romu70
Copy link

romu70 commented Nov 6, 2024

What is the issue? (required)
I can't figure how the option "Allow force discharging" is supposed to work.

I thought I would have to define a low level battery target to work on battery, while plugged-in, until this level is reached, to then charge the battery. But obviously, it doens't work this way. It's works this way with the terminal command only.

Any help?

The terminal command "battery discharge XX" work well though.

What exactly did you do to produce the issue? (required)
Steps to reproduce the behavior:

  1. Set the "Allow force discharging" option

Expected behavior (required)
I don't know what to expect exactly, it's just not clear enough.

Screenshots (optional)

On this 1st screenshot, one sees the option is activated, but the mac is still shown as "plugged in".

Screenshot 2024-11-06 at 16 51 06

Error logs

Additional context (optional)
"battery discharge 30" output:

11/06/24-16:54:22 - Discharging to 30% from 80%
11/06/24-16:54:22 - 🔽🪫 Enabling battery discharging
Error: SMCWriteKey() = e00002bc
11/06/24-16:54:22 - Battery at 80% (target 30%)
@romu70
Copy link
Author

romu70 commented Nov 6, 2024

Logs:

🖥️	Battery GUI logs:

{"percentage":"80","remaining":"unknown","charging":false,"discharging":false,"maintain_percentage":"80","battery_state":"80% (unknown remaining)","daemon_state":"smc charging disabled"}
Generate app menu percentage: 80 (discharge allowed, limited on)
Found image: /Applications/battery.app/Contents/Resources/battery-active-80-Template.png
Display percentage 80 based on 80
Refreshing interface update timer
Get active logo for 80
Limiter status message: 
11/06/24-16:50:10 - Battery at 80% (attached; remaining), 12.144V, smc charging disabled
11/06/24-16:50:10 - Your battery is currently being maintained at 80%

Force discharge setting: boolean true
Executing PATH=/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin battery status_csv
Resetting interface timer speed
Battery status: 
{"percentage":"80","remaining":"unknown","charging":false,"discharging":false,"maintain_percentage":"80","battery_state":"80% (unknown remaining)","daemon_state":"smc charging disabled"}
Setting interface refresh speed to 10 minutes
Executing PATH=/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin battery status_csv
Refreshing tray icon...
Battery status: 
{"percentage":"80","remaining":"unknown","charging":false,"discharging":false,"maintain_percentage":"80","battery_state":"80% (unknown remaining)","daemon_state":"smc charging disabled"}
Executing PATH=/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin battery status
Force discharge setting: boolean true
Display percentage 80 based on 80
Get active logo for 80
Resetting interface timer speed
Refreshing interface update timer
Executing PATH=/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin battery status_csv
Found image: /Applications/battery.app/Contents/Resources/battery-active-80-Template.png
Generate app menu percentage: 80 (discharge allowed, limited on)
Limiter status message: 
11/06/24-16:50:41 - Battery at 80% (attached; remaining), 12.145V, smc charging disabled
11/06/24-16:50:41 - Your battery is currently being maintained at 80%

@romu70
Copy link
Author

romu70 commented Nov 6, 2024

Even the terminal discharge command doesn't really work as expected.

user@mac ~ % battery discharge 30
11/06/24-17:48:39 - Discharging to 30% from 80%
11/06/24-17:48:39 - 🔽🪫 Enabling battery discharging
Error: SMCWriteKey() = e00002bc
11/06/24-17:48:39 - Battery at 80% (target 30%)
11/06/24-17:49:39 - Battery at 80% (target 30%)
11/06/24-17:50:39 - Battery at 80% (target 30%)
11/06/24-17:51:40 - Battery at 80% (target 30%)
11/06/24-17:52:40 - Battery at 80% (target 30%)
11/06/24-17:53:40 - Battery at 80% (target 30%)
11/06/24-17:54:40 - Battery at 80% (target 30%)
11/06/24-17:55:40 - Battery at 80% (target 30%)
11/06/24-17:56:40 - Battery at 80% (target 30%)
11/06/24-17:57:40 - Battery at 80% (target 30%)
11/06/24-17:58:40 - Battery at 80% (target 30%)
11/06/24-17:59:40 - Battery at 79% (target 30%)
11/06/24-18:00:40 - Battery at 79% (target 30%)
11/06/24-18:01:40 - Battery at 79% (target 30%)
11/06/24-18:02:40 - Battery at 79% (target 30%)
11/06/24-18:03:40 - Battery at 79% (target 30%)
11/06/24-18:04:40 - Battery at 79% (target 30%)
11/06/24-18:05:40 - Battery at 79% (target 30%)
11/06/24-18:06:41 - Battery at 80% (target 30%)

As one can sees, the battery starts to get drained, and then, it's charged again to the 80% limits.

@romu70
Copy link
Author

romu70 commented Nov 15, 2024

Got a new mac. This one doesn't have the SMC error, but the discharge behavior is the same. Once at 79%, it charges again.

@nsomaru
Copy link

nsomaru commented Jan 22, 2025

I use battery charge X and then battery maintain X once I'm close to X. Once "maintain" has been set, it usually hovers around the desired value

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants