3

Most of the time, I am running my HP laptop all day keeping it plugged into the AC power. So, keep the battery quality, I am thinking of limiting the battery charge thresholds in an HP laptop with Ubuntu 24.04 LTS. I have tried to do it with tlp.

I installed tlp using the following commands:

sudo apt update
sudo apt install tlp tlp-rdw
sudo systemctl enable tlp
sudo systemctl start tlp

I then edited the /etc/tlp.conf configuration file to set the charging thresholds:

START_CHARGE_THRESH_BAT0=35
STOP_CHARGE_THRESH_BAT0=80

After saving the changes and restarting TLP (sudo tlp start), I get this:

$ sudo tlp-stat -b
--- TLP 1.6.1 --------------------------------------------

+++ Battery Care
Plugin: generic
Supported features: none available

+++ Battery Status: BAT0
/sys/class/power_supply/BAT0/manufacturer                   = Hewlett-Packard
/sys/class/power_supply/BAT0/model_name                     = Primary
/sys/class/power_supply/BAT0/cycle_count                    =      0 (or not supported)
/sys/class/power_supply/BAT0/charge_full_design             =   1248 [mAh]
/sys/class/power_supply/BAT0/charge_full                    =   1248 [mAh]
/sys/class/power_supply/BAT0/charge_now                     =   1056 [mAh]
/sys/class/power_supply/BAT0/current_now                    =    528 [mA]
/sys/class/power_supply/BAT0/status                         = Charging

/sys/class/power_supply/BAT0/charge_control_start_threshold = (not available) 
/sys/class/power_supply/BAT0/charge_control_end_threshold   = (not available) 

Charge                                                      =   84.6 [%]
Capacity                                                    =  100.0 [%]

It appears this method doesn't work. What else can I do?

3 Answers 3

3

In Terminal:

ls /sys/class/power_supply/BAT*/charge_control_end_threshold

(verify the ***** after BAT, replace with your battery, e.g.: 0)

If this command returns the path to charge_control_end_threshold, then your notebook supports limiting battery charging. If the command returns an error, saying there's no such file or directory, then your laptop doesn't support setting a charge threshold.

Details: https://www.linuxuprising.com/2021/02/how-to-limit-battery-charging-set.html

I've the same issue on my Macbook 2016

4
  • Thank you. But it is already mentioned in my question. Commented Dec 31, 2024 at 6:25
  • Not sure you understood my answer? Why would you ask a question if you know your hardware does not support the feature you want? It's not a software issue. Commented Jan 10, 2025 at 8:01
  • Oh, ok. I thought it could be changed or updated somehow. That's why I asked. Thanks. Commented Jan 10, 2025 at 16:32
  • My Framework laptop only has no charge_control_end_threshold yet it does support limiting battery charging, so I don't think the absence of that file means anything. Commented Aug 22, 2025 at 7:12
1

My Ubuntu based laptop does not support it, so I have written a service that maintains battery threshold with a cheap smart plug: https://gitlab.com/yakopov/battery-threshold-smart-plug

-1

It appears this method doesn't work. What else can I do?

Try going into your laptop's BIOS settings. You can usually access the BIOS settings by pressing a key like F2 or F12 during boot POST (Power On Self Test). You'll need to look up the specific key used by your computer. Once in the BIOS, look for a Power, Battery, or Charging section. Sometimes it will be tucked in under System. In the appropriate section, you may see an option like "Primarily used on AC Power". If so, that's what you want. If not, take a look for settings that allow you to specify the battery charging thresholds. There will often be minimum and maximum values that you can specify as percentages.

Not every laptop features such useful settings in its BIOS configuration UI, but when they do, such options are wonderful.

If you don't see these settings, make sure the system's BIOS is up to date. Sometimes manufacturers add new features like this via BIOS updates. If they are not available, ask the manufacturer to include them. Perhaps they will add the functionality via an update, and even if not, it will encourage them to include this in new laptops.

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.