Bug 479173 - Energy Savings setting for On Low Battery has no effect with multiple batteries (two battery Thinkpad)
Summary: Energy Savings setting for On Low Battery has no effect with multiple batteri...
Status: REPORTED
Alias: None
Product: Powerdevil
Classification: Plasma
Component: general (show other bugs)
Version: 5.27.10
Platform: Arch Linux Linux
: NOR major
Target Milestone: ---
Assignee: Plasma Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-12-29 19:43 UTC by Marcool
Modified: 2024-02-16 04:29 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Marcool 2023-12-29 19:43:24 UTC
SUMMARY

This is on an up to date Arch Linux with KDE Plasma on a Lenovo Thinkpad T480, which has two batteries an internal (fixed) one, and an "external" (removable) one.

When using just a single battery, the actions configured in Power Management > Energy Savings for "On Low Battery" and in Power Management > Advances Power Settings for "At critical level" function well if only the internal battery is present.

However, when a second battery is inserted, passing below these thresholds no longer produces any action. This has been verified to be the case then the global percentage passes the threshold, when one battery, or even both batteries pass the threshold. The result is that the system will, if left unchecked, run both its batteries dry and perform a hard power off with loss of data (which is what prompted me to set the severity of this bug report to "major").


STEPS TO REPRODUCE

1. Find a laptop with two batteries, such as the Lenovo Thinkpad T480.
2. Remove the external battery.
3. Set some actions in Power Management > Energy Savings for "On Low Battery".
4. Set a threshold in Power Management > Advances Power Settings for "Low level".
5. Let the battery discharge below that threshold.
6. Observe action being triggered.

7. Insert external battery.
8. Let batteries discharge below threshold
9. Observe that no action is triggered.


OBSERVED RESULT

As in 9. above, the actions are not triggered.


EXPECTED RESULT

One would expect that, like in 6. actions would be triggered in accordance with user settings.


SOFTWARE/OS VERSIONS

Operating System: Arch Linux 
KDE Plasma Version: 5.27.10
KDE Frameworks Version: 5.113.0
Qt Version: 5.15.11
Kernel Version: 6.6.8-arch1-1 (64-bit)
Graphics Platform: X11
Processors: 8 × Intel® Core™ i7-8550U CPU @ 1.80GHz
Memory: 15,4 GiB of RAM
Graphics Processor: Mesa Intel® UHD Graphics 620
Manufacturer: LENOVO
Product Name: 20L6S8FB00
System Version: ThinkPad T480


ADDITIONAL INFORMATION

Output of `upower -d` with only one battery:

Device: /org/freedesktop/UPower/devices/line_power_AC
  native-path:          AC
  power supply:         yes
  updated:              Fri 29 Dec 2023 06:14:24 PM GMT (3091 seconds ago)
  has history:          no
  has statistics:       no
  line-power
    warning-level:       none
    online:              no
    icon-name:          'ac-adapter-symbolic'

Device: /org/freedesktop/UPower/devices/battery_BAT0
  native-path:          BAT0
  vendor:               LGC
  model:                01AV420
  serial:               3964
  power supply:         yes
  updated:              Fri 29 Dec 2023 07:05:32 PM GMT (23 seconds ago)
  has history:          yes
  has statistics:       yes
  battery
    present:             yes
    rechargeable:        yes
    state:               discharging
    warning-level:       none
    energy:              15.27 Wh
    energy-empty:        0 Wh
    energy-full:         17.06 Wh
    energy-full-design:  23.94 Wh
    energy-rate:         5.953 W
    voltage:             11.93 V
    charge-cycles:       18
    time to empty:       2.6 hours
    percentage:          89%
    capacity:            71.2615%
    technology:          lithium-polymer
    icon-name:          'battery-full-symbolic'
  History (charge):
    1703876702  89.000  discharging
  History (rate):
    1703876732  5.953 discharging
    1703876702  5.862 discharging
    1703876672  6.079 discharging
    1703876642  5.663 discharging

Device: /org/freedesktop/UPower/devices/line_power_ucsi_source_psy_USBC000o001
  native-path:          ucsi-source-psy-USBC000:001
  power supply:         yes
  updated:              Fri 29 Dec 2023 06:14:24 PM GMT (3091 seconds ago)
  has history:          no
  has statistics:       no
  line-power
    warning-level:       none
    online:              no
    icon-name:          'ac-adapter-symbolic'

Device: /org/freedesktop/UPower/devices/line_power_ucsi_source_psy_USBC000o002
  native-path:          ucsi-source-psy-USBC000:002
  power supply:         yes
  updated:              Fri 29 Dec 2023 06:14:24 PM GMT (3091 seconds ago)
  has history:          no
  has statistics:       no
  line-power
    warning-level:       none
    online:              no
    icon-name:          'ac-adapter-symbolic'

Device: /org/freedesktop/UPower/devices/DisplayDevice
  power supply:         yes
  updated:              Fri 29 Dec 2023 07:05:32 PM GMT (23 seconds ago)
  has history:          no
  has statistics:       no
  battery
    present:             yes
    state:               discharging
    warning-level:       none
    energy:              15.27 Wh
    energy-full:         17.06 Wh
    energy-rate:         5.953 W
    charge-cycles:       N/A
    time to empty:       2.6 hours
    percentage:          89%
    icon-name:          'battery-full-symbolic'

Daemon:
  daemon-version:  1.90.2
  on-battery:      yes
  lid-is-closed:   no
  lid-is-present:  yes
  critical-action: HybridSleep


Output of `upower -d` with both batteries:

Device: /org/freedesktop/UPower/devices/line_power_AC
  native-path:          AC
  power supply:         yes
  updated:              Fri 29 Dec 2023 07:31:19 PM GMT (197 seconds ago)
  has history:          no
  has statistics:       no
  line-power
    warning-level:       none
    online:              no
    icon-name:          'ac-adapter-symbolic'

Device: /org/freedesktop/UPower/devices/battery_BAT0
  native-path:          BAT0
  vendor:               LGC
  model:                01AV420
  serial:               3964
  power supply:         yes
  updated:              Fri 29 Dec 2023 07:34:20 PM GMT (16 seconds ago)
  has history:          yes
  has statistics:       yes
  battery
    present:             yes
    rechargeable:        yes
    state:               pending-charge
    warning-level:       none
    energy:              15.18 Wh
    energy-empty:        0 Wh
    energy-full:         17.06 Wh
    energy-full-design:  23.94 Wh
    energy-rate:         0 W
    voltage:             12.292 V
    charge-cycles:       18
    percentage:          88%
    capacity:            71.2615%
    technology:          lithium-polymer
    icon-name:          'battery-full-charging-symbolic'

Device: /org/freedesktop/UPower/devices/battery_BAT1
  native-path:          BAT1
  vendor:               SANYO
  model:                01AV428
  serial:               1025
  power supply:         yes
  updated:              Fri 29 Dec 2023 07:34:20 PM GMT (16 seconds ago)
  has history:          yes
  has statistics:       yes
  battery
    present:             yes
    rechargeable:        yes
    state:               discharging
    warning-level:       none
    energy:              44.63 Wh
    energy-empty:        0 Wh
    energy-full:         65.94 Wh
    energy-full-design:  72.36 Wh
    energy-rate:         8.806 W
    voltage:             11.378 V
    charge-cycles:       115
    time to empty:       5.1 hours
    percentage:          67%
    capacity:            91.1277%
    technology:          lithium-ion
    icon-name:          'battery-full-symbolic'
  History (charge):
    1703878370	67.000	discharging
  History (rate):
    1703878460	8.806	discharging
    1703878430	6.145	discharging
    1703878400	6.572	discharging
    1703878370	7.684	discharging

Device: /org/freedesktop/UPower/devices/line_power_ucsi_source_psy_USBC000o001
  native-path:          ucsi-source-psy-USBC000:001
  power supply:         yes
  updated:              Fri 29 Dec 2023 07:31:19 PM GMT (197 seconds ago)
  has history:          no
  has statistics:       no
  line-power
    warning-level:       none
    online:              no
    icon-name:          'ac-adapter-symbolic'

Device: /org/freedesktop/UPower/devices/line_power_ucsi_source_psy_USBC000o002
  native-path:          ucsi-source-psy-USBC000:002
  power supply:         yes
  updated:              Fri 29 Dec 2023 07:31:19 PM GMT (197 seconds ago)
  has history:          no
  has statistics:       no
  line-power
    warning-level:       none
    online:              no
    icon-name:          'ac-adapter-symbolic'

Device: /org/freedesktop/UPower/devices/DisplayDevice
  power supply:         yes
  updated:              Fri 29 Dec 2023 07:34:20 PM GMT (16 seconds ago)
  has history:          no
  has statistics:       no
  battery
    present:             yes
    state:               discharging
    warning-level:       none
    energy:              59.81 Wh
    energy-full:         83 Wh
    energy-rate:         8.806 W
    charge-cycles:       N/A
    time to empty:       6.8 hours
    percentage:          72.0602%
    icon-name:          'battery-full-symbolic'

Daemon:
  daemon-version:  1.90.2
  on-battery:      yes
  lid-is-closed:   no
  lid-is-present:  yes
  critical-action: HybridSleep
Comment 1 Marcool 2023-12-30 10:20:07 UTC
Just wanted to note here that there is apparently a long history of upower being a bit tricky to manage with two batteries present: https://gitlab.freedesktop.org/upower/upower/-/issues/62#note_378215

The latest comments on that issue are not so old (2022) and suggest things aren't all fixed.