Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?

TLP 1.4 Test: Battery Care for Lenovo Laptops (non-ThinkPad series)

Read the overview document first.

Supported Features

Lenovo laptop series using the ideapad_laptop driver have a feature called 'battery conservation mode', basically a fixed stop charge threshold at 60%. The hardware behaviour is:

  1. Connected to the charger, charging stops when the charge level reaches the stop threshold

  2. If the charge level is higher than the stop threshold, the battery will not discharge automatically; it will only be discharged when the charger is removed i.e. the laptop runs on battery

When suitable hardware has been detected, tlp-stat -b shows:

+++ Battery Care
Plugin: ideapad
Supported features: charge threshold
Driver usage:
* vendor (ideapad_wmi) = active (charge threshold)
Parameter value range:
* STOP_CHARGE_THRESH_BAT0: 0(off)..1(on) -- battery conservation mode

/sys/bus/platform/drivers/ideapad_acpi/VPC2004:00/conservation_mode = 1

How it works

Battery charging is a process not controlled by TLP itself, but by the laptop's embedded controller (EC). This makes the process work even when switched off or no operating system is running. You cannot change the basic behavior, it is hard-coded into the EC firmware by the vendor. TLP just writes the charge threshold into the EC with the help of the kernel driver, the EC takes care of the rest.

Installation

Packages are provided at the download page.

Linux kernel 4.14 or higher required.

Test Cases

Important: please provide all terminal input and output from the test cases via an individual Gist and link it in your post below.

1. Configure and enable battery conservation mode

Edit /etc/tlp.conf (or a config file of your choice under /etc/tlp.d/):

STOP_CHARGE_THRESH_BAT0="1"

Note: 0=conservation mode off/1=conservation mode on

Connect the charger.

Enter the following commands in a terminal (as root or with sudo):

tlp start
tlp-stat -s -c -b

Verify that conservation_mode = 1.

2. Verify the charging process

  1. Let the laptop run on battery power until the charge level falls below at least 50%
  2. Connect the charger and see if charging starts
  3. Verify that charging stops at 60%

Enter the command (as root or with sudo):

tlp-stat -b

3. Disable battery conservation mode and return to full charge

Edit the config file used above:

STOP_CHARGE_THRESH_BAT0="0"

Enter the commands (as root or with sudo):

tlp fullcharge
tlp-stat -b

Verify that conservation_mode = 0 and the battery gets fully charged.

What else should I check?

  • Please report if the conservation mode takes effect at a value other than 60%
  • Are there Lenovo laptops with more than one battery (tlp-stat -b should show)?
@whenov

This comment has been minimized.

Copy link

@whenov whenov commented Apr 21, 2021

Thank you for this new feature!

Here's my output:
https://gist.github.com/whenov/6c4fbba0bfed9d35f404c2251734f0f3

@linrunner

This comment has been minimized.

Copy link
Owner Author

@linrunner linrunner commented Apr 21, 2021

Looks great. Thank you for testing.

Hardware: Lenovo Legion R7000P2020H 82GR
Threshold: 60%

@Admicos

This comment has been minimized.

Copy link

@Admicos Admicos commented Apr 21, 2021

Seems to be working on my Lenovo G50-70.

https://gist.github.com/Admicos/93eaefd48e796b3b0e28690ef9fa1b6f

@linrunner

This comment has been minimized.

Copy link
Owner Author

@linrunner linrunner commented Apr 22, 2021

@Admicos: looks good. Thank you for testing.

Hardware: Lenovo G50-70 20351
Threshold: 60%

@runbmp

This comment has been minimized.

Copy link

@runbmp runbmp commented Apr 25, 2021

worked great

Hardware: LENOVO IdeaPad Flex 5 14ARE05 81X2
Threshold: 60%

https://gist.github.com/runbmp/8a70dae1e65bc889982f55ac422a5b98

@linrunner

This comment has been minimized.

Copy link
Owner Author

@linrunner linrunner commented Apr 25, 2021

Very well, thank you.

@AlftheElf

This comment has been minimized.

Copy link

@AlftheElf AlftheElf commented May 5, 2021

Working perfectly on Lenovo g50-30. Thanks so much. 🦄
https://gist.github.com/AlftheElf/e97155e5ad185d3b0e6c155b76470eab

@linrunner

This comment has been minimized.

Copy link
Owner Author

@linrunner linrunner commented May 6, 2021

Fine. Thanks for testing.

Hardware: Lenovo G50-30 80G0
Threshold: 60%

@linrunner

This comment has been minimized.

Copy link
Owner Author

@linrunner linrunner commented May 6, 2021

@AlftheElf: TLP checks and applies conservation mode on boot when configured with STOP_CHARGE_THRESH_BAT0="1" , no need to reinvent the wheel ...

@Manichayan

This comment has been minimized.

Copy link

@Manichayan Manichayan commented May 9, 2021

Battery Conservation mode works fine now. Charge threshold successfully set at 60% on Lenovo Legoin Y540.

https://gist.github.com/Manichayan/a591071737f6af550c0cb1d6cedbd0b5

@linrunner

This comment has been minimized.

Copy link
Owner Author

@linrunner linrunner commented May 9, 2021

@Manichayan: looks fine. Thanks for testing.

Remember to enable tlp.service --> https://linrunner.de/tlp/installation/arch.html#service-units

@pmgying

This comment has been minimized.

Copy link

@pmgying pmgying commented Aug 11, 2021

Works on Ideapad 310
Thanks.

@byq77

This comment has been minimized.

Copy link

@byq77 byq77 commented Aug 15, 2021

@linrunner

This comment has been minimized.

Copy link
Owner Author

@linrunner linrunner commented Aug 15, 2021

Great. Thanks for your participation.

@stavros-k

This comment has been minimized.

Copy link

@stavros-k stavros-k commented Aug 21, 2021

@linrunner

This comment has been minimized.

Copy link
Owner Author

@linrunner linrunner commented Aug 22, 2021

@stavros-k: thank you for your detailed report.

@rduttshukla

This comment has been minimized.

Copy link

@rduttshukla rduttshukla commented Aug 23, 2021

Works great on Lenovo Ideapad V130-14IKB even when powered off. Ready to reduce e-waste ✊🏼✊🏼

Threshold: 60%

@linrunner

This comment has been minimized.

Copy link
Owner Author

@linrunner linrunner commented Sep 10, 2021

Beta 2 is out. Enjoy!

@wojexe

This comment has been minimized.

Copy link

@wojexe wojexe commented Sep 11, 2021

Working properly on Lenovo IdeaPad Gaming 3 15ARH05 82EY! 😄
https://gist.github.com/wojexe/e99d2a1dbf591f87d62f41fd257a22bc

@linrunner

This comment has been minimized.

Copy link
Owner Author

@linrunner linrunner commented Sep 12, 2021

@wojexe: thank you.

@fsheidaiee

This comment has been minimized.

Copy link

@fsheidaiee fsheidaiee commented Sep 19, 2021

Hi
Can I use this app with wsl2 on windows 10?

@linrunner

This comment has been minimized.

Copy link
Owner Author

@linrunner linrunner commented Sep 19, 2021

@fsheidaiee : no.

@bLd75

This comment has been minimized.

Copy link

@bLd75 bLd75 commented Sep 21, 2021

LENOVO Legion Y540 on Debian 11 Bullseye : everything works great, love it! ❤️
https://gist.github.com/bLd75/26c2380d6c591b6ae65eaf4e18d62198

@linrunner

This comment has been minimized.

Copy link
Owner Author

@linrunner linrunner commented Sep 24, 2021

TLP 1.4 is released. Have fun!

@bLd75 : thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment