Bug 443573 - Energy page: Problems with update of battery values
Summary: Energy page: Problems with update of battery values
Status: REPORTED
Alias: None
Product: kinfocenter
Classification: Applications
Component: general (show other bugs)
Version: 5.22.4
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: Kai Uwe Broulik
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-10-10 22:00 UTC by Frank Steinmetzger
Modified: 2023-11-23 21:08 UTC (History)
7 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
Outdated charge values (169.31 KB, image/png)
2021-10-10 22:00 UTC, Frank Steinmetzger
Details
Battery charge status is not correctly shown at the top of the screen (162.78 KB, image/png)
2021-10-10 22:00 UTC, Frank Steinmetzger
Details
AC connected but battery discharging (18.46 KB, image/png)
2021-11-03 10:45 UTC, Chirag Anand
Details
Output of `upower -d` with battery at 17% (3.61 KB, text/plain)
2023-11-23 21:07 UTC, garrett
Details
Notification of low battery appearing next to applet icon falsely suggesting AC is connected (102.80 KB, image/png)
2023-11-23 21:08 UTC, garrett
Details
Battery and Brightness panel correctly indicating battery is discharging, next to applet icon suggesting AC is connected (53.91 KB, image/png)
2023-11-23 21:08 UTC, garrett
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Frank Steinmetzger 2021-10-10 22:00:16 UTC
Created attachment 142318 [details]
Outdated charge values

The battery statistics page shows some current power values, such as charging status (charging, discharging), charge power going in and out, battery voltage and so on.

But it appears unclear to me how and when the values at the bottom are being updated. For instance: I charge the battery and the screen correctly shows 22 W of charge going in. Then I disconnect AC power, and the display of the battery voltage does change, but the power value is still at 22 W. Now I reconnect AC, and power “changes” to 7 or 8 W, which is the system’s consumption on battery power. This is not fully reproducible, often the value does not change at all. See first screenshot as proof.

The values also are not consistent across batteries. My ThinkPad has two batteries, and currenlty it shows a consumption value != 0 for both, which is not possible, because only one is ever used at any given time (if at all).

Also, when the AC status changes, it is shown for both batteries at the top of the screen (see second screenshot).

Perhaps the underlying library which provides these information is not capable of discerning this. Outside of KDE I use a small script which parses the content of /sys/class/power_supply/BAT?/uevent directly and the values do differ.

For another test I used tpacpi-bat to disable charging and restarted KInfocenter. The POWER_SUPPLY_STATUS in the above mentioned uevent reflects that the batteries are neither charged nor discharged (it shows “unkown”), yet KInfocenter shows “Charging” and the wattage that last went into each battery (around 20 W), even though the actual current is 0 at that moment.
Comment 1 Frank Steinmetzger 2021-10-10 22:00:55 UTC
Created attachment 142319 [details]
Battery charge status is not correctly shown at the top of the screen
Comment 2 Chirag Anand 2021-11-03 10:44:44 UTC
I am facing one issue which you have mentioned in this bug, KDE doesn't recognise when the battery is disconnected even though the values inside /sys/class/power_supply/BAT0 are fine (correct power and energy numbers). UPower says `state: discharging` but the battery applet says that the battery is plugged in but discharging (screenshot attached). Because of this the machine doesn't suspend when it should.
Comment 3 Chirag Anand 2021-11-03 10:45:32 UTC
Created attachment 143167 [details]
AC connected but battery discharging
Comment 4 Eric Donkersloot 2021-12-24 18:57:01 UTC
The bug described at comment #2 is still present on my system, confirmed on 5.23.4

Operating System: openSUSE Tumbleweed 20211222
KDE Plasma Version: 5.23.4
KDE Frameworks Version: 5.89.0
Qt Version: 5.15.2
Kernel Version: 5.15.8-1-default (64-bit)
Graphics Platform: X11
Processors: 8 × Intel® Core™ i7-8550U CPU @ 1.80GHz
Memory: 15,5 GiB of RAM
Graphics Processor: Mesa Intel® UHD Graphics 620
Comment 5 sudoLife 2022-06-18 09:45:13 UTC
I am still having this problem.

When my laptop is charging  / discharging, the numbers on the battery icon lag behind, sometimes by a few percent, other times by a lot or get stuck; I once had my laptop fully discharge while the icon showed 54%.

Operating System: Arch Linux
KDE Plasma Version: 5.24.5
KDE Frameworks Version: 5.95.0
Qt Version: 5.15.4
Kernel Version: 5.15.47-1-lts (64-bit)
Graphics Platform: X11
Processors: 16 × AMD Ryzen 7 4800H with Radeon Graphics
Memory: 62.2 GiB of RAM
Graphics Processor: AMD RENOIR
Comment 6 sudoLife 2022-06-18 09:46:33 UTC
I am still having this problem.

When my laptop is charging  / discharging, the numbers on the battery icon lag behind, sometimes by a few percent, other times by a lot or get stuck; I once had my laptop fully discharge while the icon showed 54%.

Operating System: Arch Linux
KDE Plasma Version: 5.24.5
KDE Frameworks Version: 5.95.0
Qt Version: 5.15.4
Kernel Version: 5.15.47-1-lts (64-bit)
Graphics Platform: X11
Processors: 16 × AMD Ryzen 7 4800H with Radeon Graphics
Memory: 62.2 GiB of RAM
Graphics Processor: AMD RENOIR
Comment 7 garrett 2023-11-23 21:07:13 UTC
Battery applet icon on the panel suggests the laptop is plugged in, but it isn't connected to AC. Battery and Brightness panel appears when clicked and contains the correct information. Plugging in AC and unplugging it has no effect. Plasma pops up a warning notification when the battery `percentage` is 20%. With `percentage` at 17%, `upower` reports the battery `state` as `discharging` and `icon-name` as `battery-caution-symbolic`.

Operating System: Fedora Linux 39
KDE Plasma Version: 5.27.9
KDE Frameworks Version: 5.111.0
Qt Version: 5.15.11
Kernel Version: 6.5.11-300.fc39.x86_64 (64-bit)
Graphics Platform: Wayland
Processors: 12 × AMD Ryzen 5 7640U w/ Radeon 760M Graphics
Memory: 27.1 GiB of RAM
Graphics Processor: AMD Radeon Graphics
Manufacturer: Framework
Product Name: Laptop 13 (AMD Ryzen 7040Series)
System Version: A5
Comment 8 garrett 2023-11-23 21:07:51 UTC
Created attachment 163406 [details]
Output of `upower -d` with battery at 17%
Comment 9 garrett 2023-11-23 21:08:27 UTC
Created attachment 163407 [details]
Notification of low battery appearing next to applet icon falsely suggesting AC is connected
Comment 10 garrett 2023-11-23 21:08:58 UTC
Created attachment 163408 [details]
Battery and Brightness panel correctly indicating battery is discharging, next to applet icon suggesting AC is connected