Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

[HowTo] Battery thresholds on Thinkpads (TLP/Buster)

Share your HowTo, Documentation, Tips and Tricks. Not for support questions!.
Post Reply
Message
Author
User avatar
Hallvor
Global Moderator
Global Moderator
Posts: 2020
Joined: 2009-04-16 18:35
Location: Kristiansand, Norway
Has thanked: 138 times
Been thanked: 204 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 a Lenovo, but not a ThinkPad, this may work: https://gist.github.com/linrunner/4a687 ... 5d0582a945

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.
* Edit: 01.01.2023: Updated with link for other Lenovos. Thanks to Ahmed_samy!

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.
[HowTo] Install and configure Debian bookworm
Debian 12 | KDE Plasma | ThinkPad T440s | 4 × Intel® Core™ i7-4600U CPU @ 2.10GHz | 12 GiB RAM | Mesa Intel® HD Graphics 4400 | 1 TB SSD

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
Global Moderator
Global Moderator
Posts: 2020
Joined: 2009-04-16 18:35
Location: Kristiansand, Norway
Has thanked: 138 times
Been thanked: 204 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
[HowTo] Install and configure Debian bookworm
Debian 12 | KDE Plasma | ThinkPad T440s | 4 × Intel® Core™ i7-4600U CPU @ 2.10GHz | 12 GiB RAM | Mesa Intel® HD Graphics 4400 | 1 TB SSD

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
Global Moderator
Global Moderator
Posts: 2020
Joined: 2009-04-16 18:35
Location: Kristiansand, Norway
Has thanked: 138 times
Been thanked: 204 times

Re: Howto: Battery thresholds on Thinkpads (TLP)

#5 Post by Hallvor »

Do you have config files on both paths?
[HowTo] Install and configure Debian bookworm
Debian 12 | KDE Plasma | ThinkPad T440s | 4 × Intel® Core™ i7-4600U CPU @ 2.10GHz | 12 GiB RAM | Mesa Intel® HD Graphics 4400 | 1 TB SSD

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
Global Moderator
Global Moderator
Posts: 2020
Joined: 2009-04-16 18:35
Location: Kristiansand, Norway
Has thanked: 138 times
Been thanked: 204 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.
[HowTo] Install and configure Debian bookworm
Debian 12 | KDE Plasma | ThinkPad T440s | 4 × Intel® Core™ i7-4600U CPU @ 2.10GHz | 12 GiB RAM | Mesa Intel® HD Graphics 4400 | 1 TB SSD

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
Global Moderator
Global Moderator
Posts: 2020
Joined: 2009-04-16 18:35
Location: Kristiansand, Norway
Has thanked: 138 times
Been thanked: 204 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!
[HowTo] Install and configure Debian bookworm
Debian 12 | KDE Plasma | ThinkPad T440s | 4 × Intel® Core™ i7-4600U CPU @ 2.10GHz | 12 GiB RAM | Mesa Intel® HD Graphics 4400 | 1 TB SSD

Post Reply