Bug 413192

Summary: org-kde-powerde shows incorrect battery percentage
Product: [Plasma] Powerdevil Reporter: xpert45689
Component: generalAssignee: Plasma Bugs List <plasma-bugs>
Status: RESOLVED UPSTREAM    
Severity: normal CC: bharatchandra291101, nate
Priority: NOR    
Version: 5.17.0   
Target Milestone: ---   
Platform: Arch Linux   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: Battery showing 0% charged at 100%

Description xpert45689 2019-10-19 14:13:58 UTC
Created attachment 123340 [details]
Battery showing 0% charged at 100%

SUMMARY
org-kde-powerde shows incorrect battery percentage (0%) sometimes (after a reboot) and a successive reboot fixes this bug. If I'm on battery, laptop immdediately powers off but it doesn't do that on AC. I installed fresh kubuntu on this laptop and saw this same bug.

OBSERVED RESULT
Happens like every 4th reboot (not so rare).

EXPECTED RESULT
Didn't use to happen on my old laptop.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Yes(Arch) 
(available in About System)
KDE Plasma Version: 5.17.0
KDE Frameworks Version: 5.63.0
Qt Version: 5.13.1

ADDITIONAL INFORMATION
Observed on DELL Latitude E5540.
I changed my laptop but didn't change the SSD(put old laptop's SSD into this one).
Comment 1 xpert45689 2019-10-19 15:46:35 UTC
It appears to be a upower bug. 
I ran upower -d after seeing the same bug (the empty battery icon, this time without a restart) and this was the result:

Device: /org/freedesktop/UPower/devices/battery_BAT0
  native-path:          BAT0
  vendor:               Samsung SDI
  model:                DELL P8TC727
  serial:               57965
  power supply:         yes
  updated:              Sat 19 Oct 2019 08:40:39 PM PKT (104 seconds ago)
  has history:          yes
  has statistics:       yes
  battery
    present:             yes
    rechargeable:        yes
    state:               charging
    warning-level:       none
    energy:              0 Wh
    energy-empty:        0 Wh
    energy-full:         48.84 Wh
    energy-full-design:  48.84 Wh
    energy-rate:         0 W
    percentage:          0%
    capacity:            100%

After a minute or two, the battery icon changed to full and I ran upower -d again and got this:

Device: /org/freedesktop/UPower/devices/battery_BAT0
  native-path:          BAT0
  vendor:               Samsung SDI
  model:                DELL P8TC727
  serial:               57965
  power supply:         yes
  updated:              Sat 19 Oct 2019 08:42:51 PM PKT (36 seconds ago)
  has history:          yes
  has statistics:       yes
  battery
    present:             yes
    rechargeable:        yes
    state:               charging
    warning-level:       none
    energy:              47.7633 Wh
    energy-empty:        0 Wh
    energy-full:         48.84 Wh
    energy-full-design:  48.84 Wh
    energy-rate:         1.6095 W
    voltage:             12.586 V
    time to full:        40.1 minutes
    percentage:          97%
    capacity:            100%
Comment 2 Nate Graham 2019-10-20 14:27:35 UTC
Thanks, please report this to the upower devs: https://gitlab.freedesktop.org/groups/upower/-/issues