Bug 497354

Summary: Bluetooth and battery widgets give inconsistent info about mouse battery
Product: [Plasma] plasmashell Reporter: Coacher <itumaykin+kde>
Component: Power and Battery widgetAssignee: Plasma Bugs List <plasma-bugs-null>
Status: CONFIRMED ---    
Severity: normal CC: kde, kdedev, natalie_clarius, nate
Priority: NOR    
Version First Reported In: 6.2.4   
Target Milestone: 1.0   
Platform: Fedora RPMs   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: Battery widget
Bluetooth widget

Description Coacher 2024-12-12 06:55:39 UTC
SUMMARY

Bluetooth and battery widgets give inconsistent info about mouse battery: the former shows 100% and never changes, the latter shows 55% and never changes.

STEPS TO REPRODUCE
1. Connect mouse via bluetooth
2. Look at widgets

OBSERVED RESULT

Battery levels are inconsistent and are not updated

EXPECTED RESULT

Battery levels are consistent and are updated.

SOFTWARE/OS VERSIONS
Operating System: Fedora Linux 41
KDE Plasma Version: 6.2.4
KDE Frameworks Version: 6.8.0
Qt Version: 6.8.0
Kernel Version: 6.11.11-300.fc41.x86_64 (64-bit)
Graphics Platform: Wayland
Processors: 8 × 11th Gen Intel® Core™ i7-1165G7 @ 2.80GHz
Memory: 15.3 GiB of RAM
Graphics Processor: Mesa Intel® Xe Graphics
Comment 1 Coacher 2024-12-12 06:56:05 UTC
Created attachment 176547 [details]
Battery widget
Comment 2 Coacher 2024-12-12 06:56:20 UTC
Created attachment 176548 [details]
Bluetooth widget
Comment 3 TraceyC 2025-01-17 00:22:42 UTC
The widgets only show the information sent by the device. If that's sent incorrectly, the UI will reflect that.
I tested with 2 bluetooth devices on Plasma 6.2.5 and git-master. These are the power levels I saw, they are correct, and match:

6.2.4
1. Sony WF-1000XM4
Bluetooth: 90%
Battery: 90%

2. Arteck keyboard
Bluetooth: No power level shown
Battery: 39% 

git-master (a few minutes later)
1. Sony WF-1000XM4
Bluetooth: 80%
Battery: 80%

2. Arteck keyboard
Bluetooth: No power level shown
Battery: 39% 

This leads me to believe that there are a few variables here
- The device needs to support sending power information over both bluetooth and power separately
- It needs to send the correct information

To test the power information sent from your mouse over bluetooth use bluetoothctl:
1. Get your mouse's MAC address from System Settings - Bluetooth
2. On command line type in  this, after "info", type in the first few characters of the MAC address and press TAB to complete it
bluetoothctl info <TAB>

Look for a line that says "Battery". If there is one, let us know what it says.

Another way to get battery information from the device is from upower:

1. Get the device name with 
upower -e

e.g. my earbuds are 
/org/freedesktop/UPower/devices/headset_dev_AC_80_0A_08_3B_7B

2. Use this command with the device path e.g.
upower -i /org/freedesktop/UPower/devices/headset_dev_AC_80_0A_08_3B_7B

For my earbuds I see this, which corresponds to the level shown by the battery widget;
    percentage:          80%

If you see this, let us know what it says. 

Thanks!
Comment 4 Bug Janitor Service 2025-02-01 03:47:21 UTC
🐛🧹 ⚠️ This bug has been in NEEDSINFO status with no change for at least 15 days. Please provide the requested information, then set the bug status to REPORTED. If there is no change for at least 30 days, it will be automatically closed as RESOLVED WORKSFORME.

For more information about our bug triaging procedures, please read https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging.

Thank you for helping us make KDE software even better for everyone!
Comment 5 Coacher 2025-02-03 06:30:21 UTC
(In reply to TraceyC from comment #3)
> To test the power information sent from your mouse over bluetooth use
> bluetoothctl:
> 1. Get your mouse's MAC address from System Settings - Bluetooth
> 2. On command line type in  this, after "info", type in the first few
> characters of the MAC address and press TAB to complete it
> bluetoothctl info <TAB>
> 
> Look for a line that says "Battery". If there is one, let us know what it
> says.

# bluetoothctl info D2:5C:71:97:CF:6F
Device D2:5C:71:97:CF:6F (random)
        Name: M720 Triathlon
        Alias: M720 Triathlon
        Appearance: 0x03c2 (962)
        Icon: input-mouse
        Paired: yes
        Bonded: yes
        Trusted: yes
        Blocked: no
        Connected: yes
        LegacyPairing: no
        UUID: Generic Access Profile    (00001800-0000-1000-8000-00805f9b34fb)
        UUID: Generic Attribute Profile (00001801-0000-1000-8000-00805f9b34fb)
        UUID: Device Information        (0000180a-0000-1000-8000-00805f9b34fb)
        UUID: Battery Service           (0000180f-0000-1000-8000-00805f9b34fb)
        UUID: Human Interface Device    (00001812-0000-1000-8000-00805f9b34fb)
        UUID: Vendor specific           (00010000-0000-1000-8000-011f2000046d)
        Modalias: usb:v046DpB015d0009
        Battery Percentage: 0x64 (100)

> Another way to get battery information from the device is from upower:
> 
> 1. Get the device name with 
> upower -e
> 
> e.g. my earbuds are 
> /org/freedesktop/UPower/devices/headset_dev_AC_80_0A_08_3B_7B
> 
> 2. Use this command with the device path e.g.
> upower -i /org/freedesktop/UPower/devices/headset_dev_AC_80_0A_08_3B_7B
> 
> For my earbuds I see this, which corresponds to the level shown by the
> battery widget;
>     percentage:          80%
> 
> If you see this, let us know what it says.

# upower -i /org/freedesktop/UPower/devices/battery_hidpp_battery_0
  native-path:          hidpp_battery_0
  model:                M720 Triathlon
  serial:               d2:5c:71:97:cf:6f
  power supply:         no
  updated:              Пн 03 фев 2025 09:28:58 (30 seconds ago)
  has history:          yes
  has statistics:       yes
  mouse
    present:             yes
    rechargeable:        yes
    state:               discharging
    warning-level:       none
    battery-level:       normal
    percentage:          55% (should be ignored)
    icon-name:          'battery-low-symbolic'
Comment 6 TraceyC 2025-02-03 17:36:48 UTC
Thanks for the information. It confirms that the UI is showing what the mouse reports to the OS.

I found from a little research that the M720 Triathlon mouse uses non-rechargeable AA batteries. I also found someone in an older Reddit thread with that mouse who said the mouse also incorrectly reports 100% battery in Windows 10, in Bluetooth.
https://www.reddit.com/r/MouseReview/comments/o4xb3k/comment/ichx2sg/

Unfortunately, this isn't something KDE Plasma can control or fix. If you'd like to report the issue to Logitech, you can use their Support portal.
https://support.logi.com/hc/en-ca/requests/new?ticket_form_id=360000621393
Comment 7 Coacher 2025-02-04 07:12:09 UTC
(In reply to TraceyC from comment #6)
> Thanks for the information. It confirms that the UI is showing what the
> mouse reports to the OS.
> 
> I found from a little research that the M720 Triathlon mouse uses
> non-rechargeable AA batteries. I also found someone in an older Reddit
> thread with that mouse who said the mouse also incorrectly reports 100%
> battery in Windows 10, in Bluetooth.
> https://www.reddit.com/r/MouseReview/comments/o4xb3k/comment/ichx2sg/
> 
> Unfortunately, this isn't something KDE Plasma can control or fix. If you'd
> like to report the issue to Logitech, you can use their Support portal.
> https://support.logi.com/hc/en-ca/requests/new?ticket_form_id=360000621393

Indeed it uses regular AA batteries. On Windows mouse reports batteries charge status somewhat accurately: indicator only, no exact numbers. Currently the batteries should be around 70-80% and the indicator shows about the same. Definitely not 100% or near 50%.

Where this problem should be solved? bluetoothctl? upower? Could you please give me a hint where to go next?
Comment 8 Coacher 2025-02-04 07:39:03 UTC
(In reply to TraceyC from comment #6)
> Unfortunately, this isn't something KDE Plasma can control or fix. If you'd
> like to report the issue to Logitech, you can use their Support portal.
> https://support.logi.com/hc/en-ca/requests/new?ticket_form_id=360000621393

I understand that raw reported numbers are not controlled by KDE. I've noticed that upower says
>    percentage:          55% (should be ignored)

This is something KDE can control. Should this number be ignored than? One less incorrect number to report to the user.
Comment 9 TraceyC 2025-02-04 16:15:05 UTC
(In reply to Coacher from comment #8)
> (In reply to TraceyC from comment #6)
> I understand that raw reported numbers are not controlled by KDE. I've
> noticed that upower says
> >    percentage:          55% (should be ignored)
> 
> This is something KDE can control. Should this number be ignored than? One
> less incorrect number to report to the user.

Unfortunately, KDE doesn't control the upower software either. You can raise an issue with that project about the confusing battery percentage on their bug tracker here:
https://gitlab.freedesktop.org/upower/upower/-/issues
Comment 10 Coacher 2025-02-05 06:45:17 UTC
(In reply to TraceyC from comment #9)
> Unfortunately, KDE doesn't control the upower software either. You can raise
> an issue with that project about the confusing battery percentage on their
> bug tracker here:
> https://gitlab.freedesktop.org/upower/upower/-/issues

It seems I didn't articulate my thoughts clear enough.

upower reports raw data and says that this data should be ignored, KDE can choose to ignore it in this case, KDE can control whether to report this number to the user or not.
Comment 11 TraceyC 2025-02-05 16:39:10 UTC
That's a valid point. My apologies for misunderstanding.  I'll reopen this so the developers can take a look at a fix.
Comment 12 TraceyC 2025-02-05 16:39:18 UTC
.
Comment 13 Coacher 2025-04-28 07:59:29 UTC
Now it is even more annoying. Upower incorrectly thinks my battery level is 10%. Plasma shows warning about discharged mouse battery on every mouse connect. This is annoying and misleading UX.

I don't want to disable discharged battery warning as this is a laptop.

Please remove reporting upower values when upower says to ignore them.