[ffe] Power indicator does not combine multiple battery status

Bug #880881 reported by Mathieu De Zutter on 2011-10-24
90
This bug affects 18 people
Affects Status Importance Assigned to Milestone
indicator-power
Fix Released
Medium
Charles Kerr
indicator-power (Ubuntu)
Medium
Charles Kerr

Bug Description

I have an EliteBook 8540w with internal and external battery running Ubuntu 11.10 (oneiric).
Linux #### 3.0.0-12-generic #20-Ubuntu SMP Fri Oct 7 14:56:25 UTC 2011 x86_64 x86_64 x86_64 GNU/Linux

The power indicator (indicator-power, version 0.9-0ubuntu2) does not combine the status of both batteries.
E.g. if one battery still has 1 hour left, and the other has 2 hours left, it will show 1:00 or 2:00, instead of 3:00.
E.g. When the external battery is almost run out (but the internal one is still charged), the indicator becomes red, instead of staying white/grey. It should only be red when both batteries are almost drained.
E.g. when the internal one is fully charged, and the external one is discharging, the estimated time show is the estimated time that the external one will be discharged, not taking into account the internal one. see attached screenshot (total time show should be around 4 hours)

The original applet provided by gnome (I re-enabled the notification area) does (still) have the behavior as I expect. In other words, this is a regression compared to 10.10 (pre-unity).

<https://wiki.ubuntu.com/Power#multiple-batteries>: "If a device has multiple batteries and uses only one of them at a time, they should be presented as separate items inside the battery menu, but everywhere else they should be aggregated. Their percentages should be averaged. If any are discharging, the aggregated time remaining should be the maximum of the times for all those that are discharging, plus the sum of the times for all those that are idle. Otherwise, the aggregated time remaining should be the the maximum of the times for all those that are charging."

Related branches

Changed in indicator-power:
status: New → Confirmed
Changed in indicator-power (Ubuntu):
status: New → Confirmed
Changed in indicator-power:
status: Confirmed → Triaged
importance: Undecided → Low
Changed in indicator-power (Ubuntu):
status: Confirmed → Triaged
Changed in indicator-power:
importance: Low → Medium
Changed in indicator-power (Ubuntu):
importance: Undecided → Medium
Matthew Paul Thomas (mpt) wrote :

Specification updated. <https://wiki.ubuntu.com/Power?action=diff&rev2=30&rev1=29> "If a device has multiple batteries and uses only one of them at a time, they should be presented as separate items inside the menu, but should be totalled for the purpose of the menu title."

Charles Kerr (charlesk) on 2012-03-05
Changed in indicator-power:
assignee: nobody → charles (charlesk)
Charles Kerr (charlesk) on 2012-04-03
tags: added: backlog

For me the situation is even worse: Since 12.10 the power indicator displays my laptop battery and my MOUSE battery (Belkin bluetooth mouse) as second battery. Unfortunately it always chooses the mouse battery for display in the panel.

This is of course completely useless, as I want to see how long the laptop battery lasts, not how long the mouse battery lasts. It seems to be impossible to select which battery to display in the panel?

I don't know if my problem should be defined as "new" bug as it seems closely related to the old one here?

(PS: reported this to bug #1026432 also)

Just installed 13.10 on my laptop with two batteries (previously running Gentoo). Got worried when battery seemed to be draining much faster than Gentoo/Gnome, but realised it was basing it's calculations on a single battery. It just went from "0%" to "98%" as the laptop switched between batteries. Both were present in the dropdown, as in the initial bug report. Any news?

Kai Mast (kai-mast) wrote :

Still occurs in trusty.

Charles Kerr (charlesk) wrote :

> For me the situation is even worse: Since 12.10 the power indicator displays my laptop battery and my MOUSE battery (Belkin bluetooth mouse) as second battery. Unfortunately it always chooses the mouse battery for display in the panel.
>
> This is of course completely useless, as I want to see how long the laptop battery lasts, not how long the mouse battery lasts. It seems to be impossible to select which battery to display in the panel?

Selecting the mouse battery over the desktop battery is by design iff the mouse is reporting it will run empty sooner than the laptop. From the spec:

> "The menu title should tell you at a glance what you need to know most: what device will lose power soonest (and optionally when), or otherwise which device will take longest to charge, optionally how long it will take, and optionally its current charge level. More detailed information can be accessed inside the menu itself. "

Rob Tongue (robtongue) wrote :

I will add my comments, Charles, you say this is by design, but it is a design flaw. The battery gets down to about 5 minutes remaining, and stops discharging. That means, it will ALWAYS show 5 minutes remaining in the panel, but it is really only discharging from the second battery at that point. It..never...goes.....away.

Rob Tongue (robtongue) wrote :

I forgot to mention this is a laptop with two batteries that I am speaking of. My bug got closed as a duplicate of this one... #1290623

Charles Kerr (charlesk) wrote :

Rob, the choice of selecting the mouse battery over the laptop battery in the use case in omeil's comment #3 is by design, since the specification is to choose the battery that will be empty soonest.

However, I believe that's a separate issue from the two-laptop-batteries case reported by Mathieu here and by you in bug #1290623. It makes sense to combine two laptop batteries into a totaled representation; it doesn't make sense to do that for a laptop battery + mouse battery. :)

So, I sat down to code on this yesterday and realized there are still cases where I'm not sure what the Right Thing is.

The spec's revised form says to total together multiple batteries iff "a device has multiple batteries and uses only one of them at a time" but judging from Rob's upower dump yesterday <https://launchpadlibrarian.net/169021213/UPowerDump.txt> another valid use case is two laptop batteries that are both discharging.

My thoughts on it:

* If the laptop has two or more DISCHARGING batteries (Rob's case), we could use an average of their percentages and the maximum of their time-remaining values.

* Otherwise, if the laptop has one DISCHARGING and one or more IDLE batteries (Mathieu's case), we could use an average of their percentages and the sum of time-remaining.

* Otherwise, if the laptop has one CHARGING and one or more IDLE batteries, we could use an average of their percentages and the maximum of the CHARGING time-remaining values.

* Otherwise, if the laptop has both CHARGING and DISCHARGING batteries at the same time... first off, I'm not sure this is a meaningful use case? What icon would we use? :) We could use an average of the batteries' percentages and either not report a time, or use the maximum of the DISCHARGING time-remaining values.

* Otherwise, do not average batteries together in the header.

Punting back to mpt for a second opinion on this. ;)

Changed in indicator-power:
assignee: Charles Kerr (charlesk) → Matthew Paul Thomas (mpt)
status: Triaged → Confirmed
Charles Kerr (charlesk) wrote :

That previous summary doesn't handle the two batteries charging, which should be a common occurrence. Let's try that again:

* If the laptop has two or more DISCHARGING batteries (Rob's case), we could use an average of their percentages and the maximum of their time-remaining values.

* Otherwise, if the laptop has one DISCHARGING and one or more IDLE batteries (Mathieu's case), we could use an average of their percentages and the sum of time-remaining.

* Otherwise, if the laptop has one or more CHARGING or IDLE batteries, we could use an average of their percentages and the maximum of the CHARGING time-remaining values.

* Otherwise, if the laptop has both CHARGING and DISCHARGING batteries at the same time... first off, I'm not sure this is a meaningful use case? What icon would we use? :) We could use an average of the batteries' percentages and either not report a time, or use the maximum of the DISCHARGING time-remaining values.

* Otherwise, do not average batteries together in the header.

Rob Tongue (robtongue) wrote :

I thank you for your help on this. It's always nice to get confirmation that you aren't crazy when bugs like this happen. :) Yes those options sound nice, and I believe KDE handles this in similar ways.

Matthew Paul Thomas (mpt) wrote :
Changed in indicator-power:
assignee: Matthew Paul Thomas (mpt) → nobody
status: Confirmed → Triaged
description: updated
Charles Kerr (charlesk) on 2014-03-19
Changed in indicator-power:
assignee: nobody → Charles Kerr (charlesk)
Changed in indicator-power (Ubuntu):
assignee: nobody → Charles Kerr (charlesk)
Sebastien Bacher (seb128) wrote :

Thanks Charles&Matthew. That's somewhat a non trivial change and border line a feature (though a bugfix in spirit I think), doing a ffe from the bug just to get some review from the release team before landing that

Changed in indicator-power (Ubuntu):
status: Triaged → New
summary: - Power indicator does not combine multiple battery status
+ [ffe] Power indicator does not combine multiple battery status
Charles Kerr (charlesk) on 2014-03-21
Changed in indicator-power:
status: Triaged → In Progress
Changed in indicator-power (Ubuntu):
status: New → In Progress
Changed in indicator-power (Ubuntu):
status: In Progress → New
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in indicator-power (Ubuntu):
status: New → Confirmed
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package indicator-power - 12.10.6+14.04.20140328-0ubuntu1

---------------
indicator-power (12.10.6+14.04.20140328-0ubuntu1) trusty; urgency=low

  [ Charles Kerr ]
  * If there are two batteries detected, combine their percentages and
    their time-remainings as per the revised spec. (LP: #880881)

  [ Lars Uebernickel ]
  * Use com.canonical.indicator.basic menu item for device items That
    menu item can handle non-square icons. (LP: #1263228)
 -- Ubuntu daily release <email address hidden> Fri, 28 Mar 2014 16:10:45 +0000

Changed in indicator-power (Ubuntu):
status: Confirmed → Fix Released
SG (st-gross) wrote :

Unfortunately the fix is still not working on my Thinkpad X240 on trusty :-/ Any hints?

Michele (mikeserviceemail) wrote :

Hi - I confirm what SG said. In the lenovo x240 the remaining battery life of the two batteries is not summed up. Moreover, it appears to me that the remaining time displayed is too low.... After a full charge, I get 1h 30min in one battery and just over two hours in the other. this laptop is supposed to run for 8 hours.... Thanks for your help

Changed in indicator-power:
status: In Progress → Fix Released
status: Fix Released → Fix Committed
Charles Kerr (charlesk) on 2014-09-07
Changed in indicator-power:
status: Fix Committed → Fix Released
Kai Mast (kai-mast) wrote :

I don't feel like this is fixed.

I have two batteries: one has 1 minute left and the other one 21. Now I get a notification that I have 5 minutes left. I am confused....

tags: added: trusty utopic vivid wily
Matthew Paul Thomas (mpt) wrote :

Kai, please report that as a separate bug.

zven (flangerzvenson) wrote :

same bug for me on my x240 with ubuntu gnome 15.04. The combination of the two batteries seems to be not working properly - battery life is very low and the power indicator does not combine the two batteries.

Pedro Côrte-Real (pedrocr) wrote :

Similar thing on a T460s. It seems the joining of the two batteries is not really done. I currently have one battery with 0:07 left and another with 1:37 and the total result is shown as 1:37. It seems the summing up has regressed.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Related blueprints

Bug attachments