Bug 492159 - System Monitor's "Charging Rate" always negative (when charging or discharging)
Summary: System Monitor's "Charging Rate" always negative (when charging or discharging)
Status: RESOLVED DUPLICATE of bug 472603
Alias: None
Product: ksystemstats
Classification: Frameworks and Libraries
Component: General (show other bugs)
Version: unspecified
Platform: Fedora RPMs Linux
: NOR normal
Target Milestone: ---
Assignee: Plasma Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-08-25 11:13 UTC by davor.virag
Modified: 2024-08-27 21:55 UTC (History)
3 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description davor.virag 2024-08-25 11:13:39 UTC
SUMMARY
The System Monitor's charging rate is always a negative value, e.g.
 - while discharging, the value is around -10W (correct)
 - while charging, the value is around -36W (incorrect)

STEPS TO REPRODUCE
1. Open System Monitor
2. Add "Lithium Polymer Battery Charging Rate"
3. Observe values when the charger is disconnected/connected

OBSERVED RESULT
 - While discharging, the value is around -10W (correct)
 - While charging, the value is around -36W (incorrect)

EXPECTED RESULT
While charging, the value should reflect battery charge change, i.e. positive if battery charge is increasing.

SOFTWARE/OS VERSIONS
(available in the Info Center app, or by running `kinfo` in a terminal window)
Operating System: Fedora Linux 40
KDE Plasma Version: 6.1.4
KDE Frameworks Version: 6.5.0
Qt Version: 6.7.2
Kernel Version: 6.10.6-200.fc40.x86_64 (64-bit)
Graphics Platform: Wayland

ADDITIONAL INFORMATION
I'm not sure how the System Monitor gets the values, but `upower` always shows positive values with a "charging"/"discharging" note, e.g.:
While charging:
```
$ upower -i `upower -e | grep 'BAT'`
  native-path:          BAT0
  vendor:               SMP
  model:                L22M3PG5
  serial:               1956
  power supply:         yes
  updated:              Sun 25 Aug 2024 13:11:00 CEST (2 seconds ago)
  has history:          yes
  has statistics:       yes
  battery
    present:             yes
    rechargeable:        yes
    state:               charging
    warning-level:       none
    energy:              50.19 Wh
    energy-empty:        0 Wh
    energy-full:         59.36 Wh
    energy-full-design:  57 Wh
    energy-rate:         29.948 W
    voltage:             13.118 V
    charge-cycles:       2
    time to full:        18.4 minutes
    percentage:          84%
    capacity:            100%
    technology:          lithium-polymer
    icon-name:          'battery-full-charging-symbolic'
  History (charge):
    1724584230  84.000  charging
    1724584170  83.000  charging
  History (rate):
    1724584260  29.948  charging
    1724584230  30.760  charging
    1724584200  31.396  charging
    1724584170  32.679  charging
```
While discharging:
```
$ upower -i `upower -e | grep 'BAT'`
  native-path:          BAT0
  vendor:               SMP
  model:                L22M3PG5
  serial:               1956
  power supply:         yes
  updated:              Sun 25 Aug 2024 13:12:01 CEST (6 seconds ago)
  has history:          yes
  has statistics:       yes
  battery
    present:             yes
    rechargeable:        yes
    state:               discharging
    warning-level:       none
    energy:              50.25 Wh
    energy-empty:        0 Wh
    energy-full:         59.36 Wh
    energy-full-design:  57 Wh
    energy-rate:         10.333 W
    voltage:             12.587 V
    charge-cycles:       2
    time to empty:       4.9 hours
    percentage:          84%
    capacity:            100%
    technology:          lithium-polymer
    icon-name:          'battery-full-symbolic'
  History (charge):
    1724584230  84.000  charging
  History (rate):
    1724584321  10.333  discharging
    1724584290  0.000   pending-charge
    1724584260  29.948  charging
    1724584230  30.760  charging
```
Also, this seems to be similar to an existing problem reported in a discussion by a KDE user in 2023:
https://discuss.kde.org/t/laptop-system-monitor-never-gives-charge-rate-0w-bug/332
Comment 1 Nate Graham 2024-08-27 21:54:43 UTC
Can reproduce with current git master. If I add a System Monitor Sensor, make it a Line Chart, and add "Lithium Polymer Battery Charging Rate", the rate is always negative both while discharging, and also while charging.
Comment 2 Nate Graham 2024-08-27 21:55:06 UTC

*** This bug has been marked as a duplicate of bug 472603 ***