Power profiles and charging threshold in fedora 39

Probably a more gnome question but I will appreciate if there are any clues for solving this problem:

What is the thing/daemon responsible for managing the power profiles charging threshold? In my last fedora 38 installation the threshold at 80% just worked on my thinkpad l14 gen 1, but I’ve just updated to fedora 39 and upgraded my system memory and this stopped working.

I don’t know for sure what can be causing this. In gnome-software I have the option to update the firmware (maybe swapping ram I did something and updating can solve?), but I simply don’t know how to search for this. Any tips?

Thanks!

From what I know, Gnome is not able to define battery charge thresholds

(power-profiles-daemon is what manages this in Gnome, Bastien Nocera / power-profiles-daemon · GitLab, it will soon be replaced)

On my systems (thinkpads T and X series), I use tlp to define battery thresholds, and that is working perfectly fine.

Install: dnf remove power-profiles-daemon followed by sudo dnf install tlp
Start by default: systemctl enable tlp.service

You find more information here: Fedora — TLP 1.6 documentation

1 Like

Hello @pinguim ,
Welcome to :fedora: ,
I had to replace ppd with tuned on my system since it incorrectly identified it and would interfere with being able to get into performance mode for instance. Now, with tuned, things work as expected.

1 Like

Does tuned support battery charging thresholds?

I just installed the thinkpad battery threshold extension to see what’s going on, and the battery threshold was defined as “disabled”, after enabling everything worked… For some reason the config was not enabled by default.

I’ve used tlp before and it worked as intended, this is definitely a good alternative!

Really want to try tuned in the future, but do you know if the charging threshold is supported?

I’m not sure, I use it on my desktop. It does support power profiles and lists low power consumption profiles among others.

1 Like

I’m not using it on a laptop, but it may. It uses profiles for different use modes.

1 Like

You don’t need a program for this at all:

# /etc/systemd/system/battery-charge-thresholds.service
[Unit]
Description=Set battery charge thresholds
After=multi-user.target
StartLimitBurst=0

[Service]
Type=oneshot
Restart=on-failure
RemainAfterExit=yes
ExecStart=/bin/bash -c 'echo 90 > /sys/class/power_supply/BAT0/charge_control_start_threshold; echo 95 > /sys/class/power_s>
ExecStop=/bin/bash -c 'echo 100 > /sys/class/power_supply/BAT0/charge_control_end_threshold; echo 99 > /sys/class/power_sup>

[Install]
WantedBy=multi-user.target
1 Like

It looks like my last post was truncated so here’s the full version:

# /etc/systemd/system/battery-charge-thresholds.service
[Unit]
Description=Set battery charge thresholds
After=multi-user.target
StartLimitBurst=0

[Service]
Type=oneshot
Restart=on-failure
RemainAfterExit=yes
ExecStart=/bin/bash -c 'echo 90 > /sys/class/power_supply/BAT0/charge_control_start_threshold; echo 95 > /sys/class/power_supply/BAT0/charge_control_end_threshold'
ExecStop=/bin/bash -c 'echo 100 > /sys/class/power_supply/BAT0/charge_control_end_threshold; echo 99 > /sys/class/power_supply/BAT0/charge_control_start_threshold'

[Install]
WantedBy=multi-user.target

Start and enable the service on boot:
sudo systemctl daemon-reload
sudo systemctl enable --now battery-charge-thresholds

If you want to temporarily disable the service (for a full-charge): sudo systemctl stop battery-charge-thresholds