Clevo laptop & battery healthy charging

I came across a gnome-shell-extension-battery-health-charging on pamac / AUR AUR (en) - gnome-shell-extension-battery-health-charging-git. This is what I have been looking for for the past 2 months. Imagine my disappointment when I was told the extension is not compatible with my machine :frowning: I am using Manjaro Gnome, Ver 47, on a Clevo, Notebook NS5x_NS7xPU, Intel i7120-1260P x 16, Kernel 6.6.65. Tried TLP, doesn’t work. Tried Upower, doesn’t work. Anybody got any Ideas? The objective is either; a) automatically limit charging to between 20% and 80% when plugged into AC
OR
b) give me flags / notifications when 20% or 80% are reached when unplugged or plugged in respectively

with the basic plan to limit the battery charging cycles and thus extend the lifespan of the battery. I have something similar on my Android phone that does the job - GitHub - vbresan/HealthyBatteryCharging: Prolong the battery life of your android phone by keeping it charged between 40% and 80%

Any help, suggestions, from anyone, especially from @maniacx or @yochananmarqos would be great.
Thanks

Warning, popup and flags can be scripted regardless of desktop or hardware. But it will not help much. You will still make a cycle if you unplug. Wearing the battery just in a different way.
The real solution is to cut the charging at 80% and that is entirely dependend on the hardware in the motherboard and bios. You cannot make it with purely software tools.

2 Likes

I don’t use gnome and don’t have a clevo.
What is the output of
ls /sys/class/power_supply/BAT0 | grep charge

Indeed.

This machine (Lenovo T440 ThinkPad) supports it — and I have set charge thresholds — but the other (the IdeaPad) does not; neither do several old scraptops. I think the Dell 1525 does but the battery for that was barely serviceable anyway when I acquired it. Always used on AC with the battery used like a UPS.

You are more likely to find this feature on business-grade machines (like the T440) than on consumer-grade ones (like the IdeaPad).

Nowadays it is more and more common, 10 years ago it was pretty much thinkpad exclusive, now it has trickled down to many ideapads, some asus, acers, dells. No idea about hp. But the smaller companies like clevo, one has to do his own research. Probably not, because it is one more controller and makes the motherboard more expensive with maybe a dollar or so and that matters in the emerging smaller brands like clevo - they have to be cheaper lacking a very recognizable brandname.

A good starting point is to see if the laptop is sold with winboze oem and what oem software suite comes with it. If it is available in the proprietary soft there it is hardware supported and the only question is can it be exposed in acpi on linux, it is a matter of drivers and reverse engineering.

1 Like

Have you looked into the laptop’s BIOS settings? Two of my laptops (Toshiba, HP) have 80% charging limit settings in BIOS.

2 Likes

An example of what I see in Plasma:


I don’t use Gnome, but there should be something similar?

Thanks @Teo

You’ve pretty much summarised what I understand needs to be done. Particularly to cut charging at ~ 80%. My next step is to try and establish whether my motherboard / BIOS can handle the power management. Presumably through the Intel ACPI.

charge_full
charge_full_design
charge_now

Thanks @dhs

I looked at the BIOS but couldn’t find any battery management settings. Hence, I’ve been wondering if I can get an updated / extended BIOS from Insyde. dmidecode tells me:

PCI is supported
                BIOS is upgradeable
                BIOS shadowing is allowed
                Boot from CD is supported
                Selectable boot is supported
                EDD is supported
                8042 keyboard services are supported (int 9h)
                CGA/mono video services are supported (int 10h)
                ACPI is supported
                USB legacy is supported
                BIOS boot specification is supported
                Targeted content distribution is supported

There is mention of “winboze” in the BIOS though I bought it ‘bare bones’ from Clevo in Germany (who appears to have disappeared) and requested a Manjaro installation done by them. Seems like I should have done more research before buying.

@BG405 Perhaps I should try Plasma. If I could get that, I’d be a happy man.

Mod note: I’ve concatenated (merged) your posts to keep things tidy on the Forum. Please let us know if you would like things done differently!

1 Like

Typically it would be better to request that help and/or suggestions on the respective GitHub sites.

However, we may have the next best thing: @Yochanan


Plus, some useful System information could be helpful.

inxi --admin --verbosity=8 --filter --no-host --width

Regards.

Only a few vendors have support for charging within specific parameters to avoid deep discharge or overcharge.

This has been known for years and one of the reasons I created a utility script for such systems.

3 Likes

@soundofthunder

a) concatenated posts are fine with me. thanks
b) thanks for your post and help. I am intrigued to know what the next best thing is. I hope @Yochanan can solve my challenges :smile:

Here’s info on

inxi --admin --verbosity=8 --filter --no-host --width
System:
  Kernel: 6.6.65-1-MANJARO arch: x86_64 bits: 64 compiler: gcc v: 14.2.1
    clocksource: tsc avail: acpi_pm
    parameters: BOOT_IMAGE=/boot/vmlinuz-6.6-x86_64
    root=UUID=79b2c671-4620-4b24-a55f-7dfc0a208453 rw quiet splash apparmor=1
    security=apparmor udev.log_priority=3
  Desktop: GNOME v: 47.2 tk: GTK v: 3.24.43 wm: gnome-shell
    tools: gsd-screensaver-proxy dm: GDM v: 47.0 Distro: Manjaro base: Arch Linux
Machine:
  Type: Laptop System: Notebook product: NS5x_NS7xPU v: N/A
    serial: <superuser required> Chassis: No Enclosure type: 10
    serial: <superuser required>
  Mobo: Notebook model: NS5x_NS7xPU serial: <superuser required>
    uuid: <superuser required> UEFI: INSYDE v: 1.07.09 date: 09/06/2022
Battery:
  ID-1: BAT0 charge: 38.0 Wh (71.8%) condition: 52.9/73.9 Wh (71.6%) volts: 7.8
    min: 7.7 model: Notebook BAT type: Li-ion serial: <filter>
    status: discharging
Memory:
  System RAM: total: 16 GiB available: 15.33 GiB used: 4.87 GiB (31.8%)
  Message: For most reliable report, use superuser + dmidecode.
  Array-1: capacity: 32 GiB slots: 2 modules: 1 EC: None
    max-module-size: 16 GiB note: est.
  Device-1: Controller0-ChannelA-DIMM0 type: DDR4 detail: synchronous
    size: 16 GiB speed: 3200 MT/s volts: curr: 1 width (bits): data: 64 total: 64
    manufacturer: Patriot Memory (PDP Systems) part-no: PSD416G320081S
    serial: <filter>
  Device-2: Controller1-ChannelA-DIMM0 type: no module installed
PCI Slots:
  Permissions: Unable to run dmidecode. Root privileges required.
CPU:
  Info: model: 12th Gen Intel Core i7-1260P bits: 64 type: MST AMCP
    arch: Alder Lake level: v3 note: check built: 2021+
    process: Intel 7 (10nm ESF) family: 6 model-id: 0x9A (154) stepping: 3
    microcode: 0x435
  Topology: cpus: 1x dies: 1 clusters: 6 cores: 12 threads: 16 mt: 4 tpc: 2
    st: 8 smt: enabled cache: L1: 1.1 MiB desc: d-8x32 KiB, 4x48 KiB; i-4x32
    KiB, 8x64 KiB L2: 9 MiB desc: 4x1.2 MiB, 2x2 MiB L3: 18 MiB desc: 1x18 MiB
  Speed (MHz): avg: 552 min/max: 400/4700:3400 scaling: driver: intel_pstate
    governor: powersave cores: 1: 552 2: 552 3: 552 4: 552 5: 552 6: 552 7: 552
    8: 552 9: 552 10: 552 11: 552 12: 552 13: 552 14: 552 15: 552 16: 552
    bogomips: 79888
  Flags: 3dnowprefetch abm acpi adx aes aperfmperf apic arat
    arch_capabilities arch_lbr arch_perfmon art avx avx2 avx_vnni bmi1 bmi2
    bts clflush clflushopt clwb cmov constant_tsc cpuid cpuid_fault cx16 cx8
    de ds_cpl dtes64 dtherm dts epb ept ept_ad erms est f16c flexpriority
    flush_l1d fma fpu fsgsbase fsrm fxsr gfni hfi ht hwp hwp_act_window
    hwp_epp hwp_notify hwp_pkg_req ibpb ibrs ibrs_enhanced ibt ida intel_pt
    invpcid lahf_lm lm mca mce md_clear mmx monitor movbe movdir64b movdiri
    msr mtrr nonstop_tsc nopl nx ospke pae pat pbe pclmulqdq pdcm pdpe1gb pebs
    pge pku pln pni popcnt pse pse36 pts rdpid rdrand rdseed rdtscp rep_good
    sdbg sep serialize sha_ni smap smep smx split_lock_detect ss ssbd sse sse2
    sse4_1 sse4_2 ssse3 stibp syscall tm tm2 tpr_shadow tsc tsc_adjust
    tsc_deadline_timer tsc_known_freq umip user_shstk vaes vme vmx vnmi
    vpclmulqdq vpid waitpkg x2apic xgetbv1 xsave xsavec xsaveopt xsaves
    xtopology xtpr
  Vulnerabilities:
  Type: gather_data_sampling status: Not affected
  Type: itlb_multihit status: Not affected
  Type: l1tf status: Not affected
  Type: mds status: Not affected
  Type: meltdown status: Not affected
  Type: mmio_stale_data status: Not affected
  Type: reg_file_data_sampling mitigation: Clear Register File
  Type: retbleed status: Not affected
  Type: spec_rstack_overflow status: Not affected
  Type: spec_store_bypass mitigation: Speculative Store Bypass disabled via
    prctl
  Type: spectre_v1 mitigation: usercopy/swapgs barriers and __user pointer
    sanitization
  Type: spectre_v2 mitigation: Enhanced / Automatic IBRS; IBPB: conditional;
    RSB filling; PBRSB-eIBRS: SW sequence; BHI: BHI_DIS_S
  Type: srbds status: Not affected
  Type: tsx_async_abort status: Not affected
Graphics:
  Device-1: Intel Alder Lake-P Integrated Graphics vendor: CLEVO/KAPOK
    driver: i915 v: kernel arch: Xe process: Intel 10nm built: 2021-22+ ports:
    active: eDP-1 empty: DP-1, DP-2, DP-3, DP-4, HDMI-A-1 bus-ID: 00:02.0
    chip-ID: 8086:4626 class-ID: 0300
  Device-2: Chicony USB2.0 Camera driver: uvcvideo type: USB rev: 2.0
    speed: 480 Mb/s lanes: 1 mode: 2.0 bus-ID: 3-7:2 chip-ID: 04f2:b6f9
    class-ID: 0e02 serial: <filter>
  Display: wayland server: X.org v: 1.21.1.14 with: Xwayland v: 24.1.4
    compositor: gnome-shell driver: gpu: i915 display-ID: 0
  Monitor-1: eDP-1 model: BOE Display 0x07d8 built: 2018 res: 1920x1080
    dpi: 142 gamma: 1.2 chroma: red: x: 0.651 y: 0.345 green: x: 0.333 y: 0.620
    blue: x: 0.149 y: 0.059 white: x: 0.314 y: 0.329
    size: 344x194mm (13.54x7.64") diag: 395mm (15.5") ratio: 16:9
    modes: 1920x1080
  API: EGL v: 1.5 hw: drv: intel iris platforms: device: 0 drv: iris
    device: 1 drv: swrast gbm: drv: iris surfaceless: drv: iris wayland:
    drv: iris x11: drv: iris
  API: OpenGL v: 4.6 compat-v: 4.5 vendor: intel mesa v: 24.2.8-arch1.1
    glx-v: 1.4 direct-render: yes renderer: Mesa Intel Graphics (ADL GT2)
    device-ID: 8086:4626 memory: 7.49 GiB unified: yes display-ID: :0.0
  Info: Tools: api: eglinfo,glxinfo x11: xprop,xrandr
Audio:
  Device-1: Intel Alder Lake PCH-P High Definition Audio vendor: CLEVO/KAPOK
    driver: snd_hda_intel v: kernel alternate: snd_sof_pci_intel_tgl
    bus-ID: 00:1f.3 chip-ID: 8086:51c8 class-ID: 0403
  API: ALSA v: k6.6.65-1-MANJARO status: kernel-api with: aoss
    type: oss-emulator tools: alsactl,alsamixer,amixer
  Server-1: JACK v: 1.9.22 status: off tools: N/A
  Server-2: PipeWire v: 1.2.7 status: off with: wireplumber status: active
    tools: pw-cli,wpctl
  Server-3: PulseAudio v: 17.0-43-g3e2bb status: active with: pulseaudio-alsa
    type: plugin tools: pacat,pactl
Network:
  Device-1: Intel Alder Lake-P PCH CNVi WiFi driver: iwlwifi v: kernel
    bus-ID: 00:14.3 chip-ID: 8086:51f0 class-ID: 0280
  IF: wlp0s20f3 state: up mac: <filter>
  IP v4: <filter> type: dynamic noprefixroute scope: global
    broadcast: <filter>
  IP v6: <filter> type: dynamic noprefixroute scope: global
  IP v6: <filter> type: noprefixroute scope: link
  Device-2: Realtek RTL8111/8168/8211/8411 PCI Express Gigabit Ethernet
    vendor: CLEVO/KAPOK driver: r8169 v: kernel pcie: gen: 1 speed: 2.5 GT/s
    lanes: 1 port: 3000 bus-ID: 2c:00.0 chip-ID: 10ec:8168 class-ID: 0200
  IF: enp44s0 state: up speed: 1000 Mbps duplex: full mac: <filter>
  IP v4: <filter> type: dynamic noprefixroute scope: global
    broadcast: <filter>
  IP v6: <filter> type: dynamic noprefixroute scope: global
  IP v6: <filter> type: noprefixroute scope: link
  Info: services: NetworkManager, systemd-timesyncd, wpa_supplicant
  WAN IP: <filter>
Bluetooth:
  Device-1: Intel AX201 Bluetooth driver: btusb v: 0.8 type: USB rev: 2.0
    speed: 12 Mb/s lanes: 1 mode: 1.1 bus-ID: 3-10:3 chip-ID: 8087:0026
    class-ID: e001
  Report: rfkill ID: hci0 rfk-id: 0 state: down bt-service: enabled,running
    rfk-block: hardware: no software: yes address: see --recommends
Logical:
  Message: No logical block device data found.
RAID:
  Message: No RAID data found.
Drives:
  Local Storage: total: 1.4 TiB used: 273.85 GiB (19.1%)
  SMART Message: Unable to run smartctl. Root privileges required.
  ID-1: /dev/nvme0n1 maj-min: 259:3 vendor: Patriot model: M.2 P400 512GB
    size: 476.94 GiB block-size: physical: 512 B logical: 512 B speed: 63.2 Gb/s
    lanes: 4 tech: SSD serial: <filter> fw-rev: V1.1A temp: 31.9 C scheme: GPT
  ID-2: /dev/nvme1n1 maj-min: 259:0 vendor: Patriot model: M.2 P300 1024GB
    size: 953.87 GiB block-size: physical: 512 B logical: 512 B speed: 31.6 Gb/s
    lanes: 4 tech: SSD serial: <filter> fw-rev: 400fAA13 temp: 35.9 C
    scheme: GPT
  Message: No optical or floppy data found.
Partition:
  ID-1: / raw-size: 476.64 GiB size: 468.09 GiB (98.21%)
    used: 183.7 GiB (39.2%) fs: ext4 dev: /dev/nvme0n1p2 maj-min: 259:5
    label: N/A uuid: 79b2c671-4620-4b24-a55f-7dfc0a208453
  ID-2: /boot/efi raw-size: 300 MiB size: 299.4 MiB (99.80%)
    used: 288 KiB (0.1%) fs: vfat dev: /dev/nvme0n1p1 maj-min: 259:4 label: N/A
    uuid: 3ED5-682C
  ID-3: /mnt/8316404c-66de-4c32-bdcf-0674f10e231f raw-size: 297.46 GiB
    size: 292.7 GiB (98.40%) used: 90.15 GiB (30.8%) fs: ext4 dev: /dev/nvme1n1p1
    maj-min: 259:1 label: Patriot 1T_backu
    uuid: 8316404c-66de-4c32-bdcf-0674f10e231f
  ID-4: /mnt/e6f42593-dce4-4cb6-b768-1ba239a168d9 raw-size: 656.41 GiB
    size: 645.04 GiB (98.27%) used: 2 MiB (0.0%) fs: ext4 dev: /dev/nvme1n1p2
    maj-min: 259:2 label: BH Extra uuid: e6f42593-dce4-4cb6-b768-1ba239a168d9
Swap:
  Alert: No swap data was found.
Unmounted:
  Message: No unmounted partitions found.
USB:
  Hub-1: 1-0:1 info: hi-speed hub with single TT ports: 1 rev: 2.0
    speed: 480 Mb/s (57.2 MiB/s) lanes: 1 mode: 2.0 chip-ID: 1d6b:0002
    class-ID: 0900
  Hub-2: 2-0:1 info: super-speed hub ports: 1 rev: 3.1
    speed: 20 Gb/s (2.33 GiB/s) lanes: 2 mode: 3.2 gen-2x2 chip-ID: 1d6b:0003
    class-ID: 0900
  Hub-3: 3-0:1 info: hi-speed hub with single TT ports: 12 rev: 2.0
    speed: 480 Mb/s (57.2 MiB/s) lanes: 1 mode: 2.0 chip-ID: 1d6b:0002
    class-ID: 0900
  Device-1: 3-7:2 info: Chicony USB2.0 Camera type: video driver: uvcvideo
    interfaces: 4 rev: 2.0 speed: 480 Mb/s (57.2 MiB/s) lanes: 1 mode: 2.0
    power: 500mA chip-ID: 04f2:b6f9 class-ID: 0e02 serial: <filter>
  Device-2: 3-10:3 info: Intel AX201 Bluetooth type: bluetooth driver: btusb
    interfaces: 2 rev: 2.0 speed: 12 Mb/s (1.4 MiB/s) lanes: 1 mode: 1.1
    power: 100mA chip-ID: 8087:0026 class-ID: e001
  Hub-4: 4-0:1 info: super-speed hub ports: 4 rev: 3.1
    speed: 10 Gb/s (1.16 GiB/s) lanes: 1 mode: 3.2 gen-2x1 chip-ID: 1d6b:0003
    class-ID: 0900
Sensors:
  System Temperatures: cpu: 41.0 C mobo: N/A
  Fan Speeds (rpm): N/A
Repos:
  Packages: pm: pacman pkgs: 1506 libs: 407 tools: gnome-software,pamac
    pm: flatpak pkgs: 0
  Active pacman repo servers in: /etc/pacman.d/mirrorlist
    1: https://ipng.mm.fcix.net/manjaro/stable/$repo/$arch
    2: https://manjaro.kurdy.org/stable/$repo/$arch
    3: https://mirrors.manjaro.org/repo/stable/$repo/$arch
    4: https://mirrors2.manjaro.org/stable/$repo/$arch
    5: https://uvermont.mm.fcix.net/manjaro/stable/$repo/$arch
    6: https://mirror.easyname.at/manjaro/stable/$repo/$arch
    7: https://ask4.mm.fcix.net/manjaro/stable/$repo/$arch
    8: https://mirror.alpix.eu/manjaro/stable/$repo/$arch
Processes:
  CPU top: 5 of 374
  1: cpu: 50.0% command: ps pid: 20495 mem: 3.62 MiB (0.0%)
  2: cpu: 4.1% command: gnome-shell pid: 1232 mem: 319.7 MiB (2.0%)
  3: cpu: 4.0% command: firefox pid: 3662 mem: 561.5 MiB (3.5%)
  4: cpu: 3.8% command: portmaster-core_v1-6-10 pid: 984
    mem: 167.0 MiB (1.0%)
  5: cpu: 1.1% command: nautilus pid: 14418 mem: 215.2 MiB (1.3%)
  Memory top: 5 of 374
  1: mem: 561.5 MiB (3.5%) command: firefox pid: 3662 cpu: 4.0%
  2: mem: 473.8 MiB (3.0%) command: soffice.bin pid: 4696 cpu: 0.0%
  3: mem: 319.7 MiB (2.0%) command: gnome-shell pid: 1232 cpu: 4.1%
  4: mem: 286.4 MiB (1.8%) command: dmidecode started-by: masterpdfeditor5
    pid: 7018 cpu: 0.0%
  5: mem: 248.1 MiB (1.5%) command: firefox pid: 4889 cpu: 0.1%
Info:
  Processes: 374 Power: uptime: 2h 53m states: freeze,mem,disk suspend: s2idle
    avail: deep wakeups: 1 hibernate: platform avail: shutdown, reboot, suspend,
    test_resume image: 6.12 GiB services: gsd-power,upowerd Init: systemd
    v: 256 default: graphical tool: systemctl
  Compilers: clang: 18.1.8 gcc: 14.2.1 Shell: Zsh v: 5.9
    running-in: terminator inxi: 3.3.37

If any of that is helpful to suggest a solution, I’d be happy to hear it.
Thanks

Thanks @linux-aarhus

a) yes, it seems a limited number of vendors provide the parameters out of the box
b) Charger Notifier script looks likely to give me my second option. Thanks. I’ll look into that soon

Thanks for your help

Well, as it turns out, our @Yochanan happens to be the very same:

that you linked to at GitHub. :smile_cat:

So, no doubt he will see this topic in due course; especially now that we both have pinged him.

Regards.

Thanks for the clarification @soundofthunder Here’s hoping :crossed_fingers:

1 Like

He did and has already communicated with the developer of the Battery Health Charging extension, not sure why it wasn’t linked here thus far.

Indeed. The TLP documentation lists various hardware vendors that do: Battery Care Vendor Specifics — TLP 1.7.0 documentation

Either Clevo added support in their proprietary BIOS or they didn’t.

It appears the NS5x_NS7xPU may be the same or very close to the Tuxedo InfinityBook S 15 Gen 7.

As maniax mentioned in the above issue, you might try Tuxedo’s drivers. They’re in the repo as tuxedo-drivers-dkms. You can also install the GUI tool, tuxedo-control-center.

1 Like