Howto: Battery thresholds on Thinkpads (TLP/Buster)

Share your own howto's etc. Not for support questions!
Post Reply
Message
Author
User avatar
Hallvor
Posts: 1179
Joined: 2009-04-16 18:35
Location: Kristiansand, Norway
Has thanked: 3 times
Been thanked: 2 times

Howto: Battery thresholds on Thinkpads (TLP/Buster)

#1 Post by Hallvor »

What is a battery threshold?

A battery threshold will stop the computer from charging the battery once it reaches a certain level and increase the lifespan of your battery.


Disclaimer


The following will/should only work on most IBM/Lenovo Thinkpads. If you have any other IBM or Lenovo laptops, this will not work.

OK, let’s do this

In this howto, we’ll use TLP. It will give you optimized power saving out of the box. If you already have laptop-mode-tools installed, you must uninstall it:

Code: Select all

# apt remove laptop-mode-tools
Then we’ll install TLP and the required firmware. Most Thinkpads will only need one module. Newer Thinkpads will generally only need the acpi-call package, while older models will need tp-smapi-dkms. We’ll install both of them and then find the correct kernel module later.

Code: Select all

# apt install tlp tlp-rdw tp-smapi-dkms acpi-call-dkms
Reboot.

Now we’ll look for the correct kernel module.

Code: Select all

# tlp-stat -b
Look for the module that says unsupported hardware:

Code: Select all

tp-smapi = inactive (unsupported hardware)
tpacpi-bat = inactive (unsupported hardware)
Then just delete the module (tpacpi-bat is acpi-call):

Code: Select all

# apt remove tp-smapi-dkms


OR

Code: Select all

# apt remove acpi-call-dkms

Configuration


All tlp settings are stored in /etc/default/tlp * Let’s edit it:

Code: Select all

# nano /etc/default/tlp
Look for the following lines. Thinkpads usually have two batteries, one internal and one external. BAT0 is the internal battery, and BAT1 is the external battery:

Code: Select all

START_CHARGE_THRESH_BAT0=75 
STOP_CHARGE_THRESH_BAT0=80 

START_CHARGE_THRESH_BAT1=75
STOP_CHARGE_THRESH_BAT1=80
These settings are fine if you use your computer on battery power a lot. Even if your computer is connected to AC power, it will not charge until the battery level drops to 75%, and will not charge above 80%.

If your computer almost always is connected to AC power, I recommend setting the charge threshold closer to 50% to maximize battery life.


Getting a full charge

Even if you have set the threshold to 80%, or even 50%, sometimes you just need a full charge. You can achieve this by entering the following:

Code: Select all

# tlp fullcharge
After a full charge, the computer will start respecting the charge thresholds again.

You can also charge just one of the batteries, for example:

Code: Select all

# tlp fullcharge BAT1

* Edit: 14.05.2020: The path for Sid is /etc/tlp.conf. See below.

Credits:
https://linrunner.de/en/tlp/docs/tlp-li ... ement.html
https://linrunner.de/en/tlp/docs/tlp-configuration.html
Last edited by Hallvor on 2020-05-14 12:17, edited 2 times in total.
Lenovo ThinkPad T440S, Intel Core i7-4600U CPU @ 2.10GHz, 8 GB RAM, 256 GB SSD, Debian Bullseye (KDE)
Lenovo ThinkPad X240, Intel Core i5-4300U CPU @ 2.90GHz, 8 GB RAM, 120 GB SSD, Debian Bullseye (KDE)

otas.pe
Posts: 49
Joined: 2010-04-03 16:51
Location: Czech

Re: Howto: Battery thresholds on Thinkpads (TLP)

#2 Post by otas.pe »

On my Thinkpad T540p there is tp-smapi module inactive because not supported. It is OK or anything wrong?

Code: Select all

# tlp-stat -b
--- TLP 1.3.1 --------------------------------------------

+++ Battery Features: Charge Thresholds and Recalibrate
natacpi    = active (data, thresholds)
tpacpi-bat = active (recalibrate)
tp-smapi   = inactive (ThinkPad not supported)
Debian Sid 64bit Gnome

User avatar
Hallvor
Posts: 1179
Joined: 2009-04-16 18:35
Location: Kristiansand, Norway
Has thanked: 3 times
Been thanked: 2 times

Re: Howto: Battery thresholds on Thinkpads (TLP)

#3 Post by Hallvor »

It looks fine. The correct module is loaded. Just remove tp-smapi.

Code: Select all

# apt remove tp-smapi-dkms
Lenovo ThinkPad T440S, Intel Core i7-4600U CPU @ 2.10GHz, 8 GB RAM, 256 GB SSD, Debian Bullseye (KDE)
Lenovo ThinkPad X240, Intel Core i5-4300U CPU @ 2.90GHz, 8 GB RAM, 120 GB SSD, Debian Bullseye (KDE)

otas.pe
Posts: 49
Joined: 2010-04-03 16:51
Location: Czech

Re: Howto: Battery thresholds on Thinkpads (TLP)

#4 Post by otas.pe »

OK, thanks. Only small correction, in Sid the config file path is /etc/tlp.conf not /etc/default/tlp. Any tips how to change config file?
Debian Sid 64bit Gnome

User avatar
Hallvor
Posts: 1179
Joined: 2009-04-16 18:35
Location: Kristiansand, Norway
Has thanked: 3 times
Been thanked: 2 times

Re: Howto: Battery thresholds on Thinkpads (TLP)

#5 Post by Hallvor »

Do you have config files on both paths?
Lenovo ThinkPad T440S, Intel Core i7-4600U CPU @ 2.10GHz, 8 GB RAM, 256 GB SSD, Debian Bullseye (KDE)
Lenovo ThinkPad X240, Intel Core i5-4300U CPU @ 2.90GHz, 8 GB RAM, 120 GB SSD, Debian Bullseye (KDE)

otas.pe
Posts: 49
Joined: 2010-04-03 16:51
Location: Czech

Re: Howto: Battery thresholds on Thinkpads (TLP)

#6 Post by otas.pe »

No, only on /etc/tlp.conf
Debian Sid 64bit Gnome

User avatar
Hallvor
Posts: 1179
Joined: 2009-04-16 18:35
Location: Kristiansand, Norway
Has thanked: 3 times
Been thanked: 2 times

Re: Howto: Battery thresholds on Thinkpads (TLP)

#7 Post by Hallvor »

I may be thick here, because I can't understand what the problem is. Are you asking how to change the path of the config file from /etc/tlp.conf to /etc/default/tlp?
Last edited by Hallvor on 2020-05-14 12:12, edited 1 time in total.
Lenovo ThinkPad T440S, Intel Core i7-4600U CPU @ 2.10GHz, 8 GB RAM, 256 GB SSD, Debian Bullseye (KDE)
Lenovo ThinkPad X240, Intel Core i5-4300U CPU @ 2.90GHz, 8 GB RAM, 120 GB SSD, Debian Bullseye (KDE)

otas.pe
Posts: 49
Joined: 2010-04-03 16:51
Location: Czech

Re: Howto: Battery thresholds on Thinkpads (TLP)

#8 Post by otas.pe »

No, in your procedure there is config file path /etc/default/tlp. But in Sid I could not find there because location is /etc/tlp.conf
Debian Sid 64bit Gnome

User avatar
Hallvor
Posts: 1179
Joined: 2009-04-16 18:35
Location: Kristiansand, Norway
Has thanked: 3 times
Been thanked: 2 times

Re: Howto: Battery thresholds on Thinkpads (TLP)

#9 Post by Hallvor »

Yes, I saw that. I'll make the appropriate edit in the OP. Thanks!
Lenovo ThinkPad T440S, Intel Core i7-4600U CPU @ 2.10GHz, 8 GB RAM, 256 GB SSD, Debian Bullseye (KDE)
Lenovo ThinkPad X240, Intel Core i5-4300U CPU @ 2.90GHz, 8 GB RAM, 120 GB SSD, Debian Bullseye (KDE)

Post Reply