Open SylChamber opened 1 month ago
Uh... actually, I think I got the threshold backwards. I'm comparing with values on my Asus ROG Strix G15. It only has one value: charge_control_end_threshold
. And I set it to 80
. There is no start
threshold.
My Lenovo ThinkPad T14 G1 has two thresholds:
charge_control_end_threshold
charge_control_start_threshold
as well as two legacy APIs that are supposedly synchronized with those two.
Thank you for reporting this. Do you have any idea how charge_control_start_threshold
should be handled? It seems like it could be set by the user, but maybe there is a sane default, depending on charge_control_end_threshold
..?
Yes, I found the way it works in the Device Compatibility section on ThinkPad in the Battery Health Charging GNOME extension documentation. It depends on the direction of the movement of the thresholds: up or down. The threshold closest to the target must be modified first. That's why bat
failed to lower my ThinkPad's threshold from 100 to 80. It was decreasing the end
threshold to a lower value than the start
. And manually setting the start
threshold to a lower value allowed bat
to set the end
threshold.
Battery Health Charging supports 3 profiles and their defaults define 5 percent windows with the sart/end thresholds:
55-60
75-80
95-100
If the thresholds are decreased (e.g. from 100
to 60
), then charge_control_start_threshold
must be set first (e.g. to 55
), then charge_control_end_threshold
(e.g. to 60
):
echo '55' | sudo tee /sys/class/power_supply/BAT0/charge_control_start_threshold
echo '60' | sudo tee /sys/class/power_supply/BAT0/charge_control_end_threshold
If the thresholds are increased (e.g. from 60
to 80
), then charge_control_end_threshold
must be set first (e.g. to 80
), then charge_control_start_threshold
(e.g. to 75
):
echo '80' | pkexec tee /sys/class/power_supply/BAT0/charge_control_end_threshold
echo '75' | pkexec tee /sys/class/power_supply/BAT0/charge_control_start_threshold
OK, I think just set the start value 5 lower than the end, and check which one needs to be set first.
Computer: Lenovo ThinkPad T14 Gen 1 AMD (manufactured in 2021) CPU: AMD Ryzen PRO 7 4750U OS: Ubuntu 24.04
I could not set a battery threshold on my Lenovo ThinkPad T14 Gen1 (while it works on my Asus ROG Strix G15 2021). I got the following error:
with the
debug
flag:When searching on the battery system path, I found the UbuntuHandbook page on setting battery threshold. Trying to set the
end
threshold manually failed as well:It led me to try manually setting the lower charging threshold to a lower value than the
end
value:Which I unfortunately did before trying to read the current value. :-( I don't know what it was before. Afterwards, I could set the
end
threshold, manually or withbat
.I gather that the
end
threshold must not be lower than thestart
threshold.