Skip to content

Battery time estimate is extremely unstable due to stateless calculation #4755

@jannickj

Description

@jannickj

The remaining battery time estimate reported by the Waybar battery module fluctuates wildly, often jumping between values like ~8h and ~19h within a short period of time, even under relatively stable system load.

From inspecting the code, it appears that the time remaining is calculated in a stateless manner based only on the current power draw and remaining capacity, without any form of smoothing, averaging, or historical prediction. Because instantaneous power usage varies significantly, this approach produces highly unstable and misleading estimates.

Observed behavior:

  • Battery time remaining rapidly swings by several hours
  • Small, momentary changes in power usage cause large jumps in the estimate
  • The value rarely converges to something realistic during normal use

Expected behavior:

  • Battery time should change gradually
  • Short-term spikes in power usage should not dramatically affect the estimate
  • Some form of averaging or prediction over time would produce more usable results

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions