How to fix missing battery charge thresholds?

Hello everyone,

I have a Lenovo Thinkpad which supports setting the battery charging thresholds in /sys/class/power_supply/BAT0. This allows me to stop charging the battery at a certain threshold when I’m using it plugged in to not wear it out so fast.

The problem is this feature keeps disappearing with various updates that come in. The files in that directory that control the thresholds will simply disappear, I will get a permission denied error if I try to sudo touch anything in that directory, and the battery will charge up to 99% and keep trying to top itself off. Usually a later update will cause everything to reappear and go back to the way it was, but it’s been missing for months now.

I’m not a developer and I have no idea how to troubleshoot this on my own, nor can I pinpoint exactly which updates fix/break it because I’m usually plugged in and not constantly watching my battery %.

1 Like

Added atomic-desktops, battery, rpm, rpm-ostree

Removed rpm, rpm-ostree

This used to work, but dont work anymore.
I have not found a solution yet.

sudo tee /etc/udev/rules.d/10-battery.rules <<<‘SUBSYSTEM==“power_supply”, KERNEL==“macsmc-battery”, ATTR{charge_control_end_threshold}=“80”’

I receive permission denied when I try this!