Battery percentage incorrectly displayed on panel

I don’t know exactly when this started (I’d say since I upgraded to GNOME 42), but from time to time the indicator of battery percentage on the panel (or dash to panel) “freezes” and stops updating.

Now, for example, although my battery is charging (as acpi correctly shows), the indicator is frozen at the value of when I plugged my charger.

But it doesn’t happen only when charging. Sometimes when discharging as well. The main problem is that I haven’t found a way to reset the indicator and synchronize it again. Any ideas?

Hi! Maybe this can workaround your problem.

Thanks, but it doesn’t work for me, as acpi isn’t the problem. Acpi correctly displays the percentage when it’s run. The panel probably reads the battery status from somewhere else.

The battery value is updated when the charger is plugged or unplugged.

Same problem here, any suggestion to fix my problem?

ACPI is showing an accurate percentage, but the battery widget is stuck at a random value from previous shutdown. Also, while charging the laptop, battery indicator works fine

1 Like

I think I got a little bit closer to the solution. The battery indicator probably reads the percentage from

upower -i /org/freedesktop/UPower/devices/battery_BAT0

which in my case doesn’t show the correct value. Right now, for instance, acpi shows 55% while upower -i /org/freedesktop/UPower/devices/battery_BAT0 is stuck at 64% (and will probably remain so until I plug in the charger).

So the problem to be fixed, apparently, is the value at /org/freedesktop/UPower/devices/battery_BAT0 not being updated.

Some more info. The command that should force upower to refresh the battery status

busctl call --system org.freedesktop.UPower /org/freedesktop/UPower/devices/battery_BAT0 org.freedesktop.UPower.Device Refresh

returns an error:

Call failed: Method Refresh is not implemented on interface org.freedesktop.UPower.Device

my battery is charging, KDE can display it, but acpi does not recognize.

acpi
Battery 0: Not charging, 97%
Battery:
  ID-1: BAT0 charge: 53.5 Wh (97.8%) condition: 54.7/54.7 Wh (100.0%)
    volts: 17.1 min: 15.4 model: Sunwoda 5B10W51820 type: Li-poly
    serial: <filter> status: not charging cycles: 127

No, what you show is that KDE shows the same as acpi (status: not charging). In this case, this is different from the issues reported by previous users. Previous users report acpi gets it right, but DE doesn’t. You should try the solution I suggested earlier.

I have the same problem. I ran the command “upower --monitor” and nothing was displayed. I figured out that restarting upower.service fixes the problem.

sudo systemctl restart upower.service

I do not know why the service has to be restarted when resuming from suspend.

2 Likes

I’ll test your solution when the problem occurs and let you know. Thanks.