Skip to content

Idea: battery history with drain per mode and time left #148

Closed as not planned

Description

@jonasevcik

Not a maintainer. I read through the code and docs; nothing below is built or tested on a player.

What would you like?

A history on the Battery page:

  • A graph of the battery level for the last 24 hours or 7 days, with markers underneath for playback, screen on, Bluetooth on, Wi-Fi on and sleep.
  • Drain per mode, worked out from that history: for example "Sleeping", "Playing, screen off", "Playing + Bluetooth", "Screen on + Wi-Fi", each in %/h, shown only once enough hours were recorded.
  • An estimated time left for what is on right now.

Why?

Drain reports today are an overnight guess plus a manual log. #116 needed "% and time when you put it down, % and time in the morning, what was on". Y2Linux #42 needed least-squares fits on power-journal.jsonl. A player that records this itself would show what is using the battery without a report, and the next drain report could be a screenshot.

Where would you look for it?

On the existing Battery page (Screen::Battery), not on Home and not in the status bar. It is a service page, so it stays clear of the "more status bar items" entry on the not-planned list.

How it could plug in (from reading the code, untested)

  • power::battery already reads /run/y2/power.json every 2 s. The record has estimate.remaining_uah_estimate and design_capacity_uah, which are finer than whole percent.
  • The runtime already knows playback, dark_since, Wi-Fi, Bluetooth and charging state (runtime/idle.rs). The platform's power journal has no playback, and Reborn shouldn't read /data/system, so a small Reborn-side ring file under /data/reborn fits the architecture guard: one record per 5 minutes for 7 days is a few thousand records, tens of KB.
  • Reborn stays alive across sleep, and prepare_sleep() / restore_sleep() in runtime/sleep.rs bracket it. Those two hooks could record sleep start and end with the level at each, which gives sleep drain directly. Instant doesn't advance while asleep, so the timestamps would need wall-clock time.
  • The graph is the new part: I found no chart renderer in reborn-ui.

Limits

The level is voltage-estimated and there is no current measurement, so the rates are rough and need days of use to settle; an aged cell reads high. I would show "≈", hide a rate until a mode has a few hours behind it, and leave charging intervals out.

Version

1.0 Beta 9.3.31

Activity

  1. SchulzCode commented on Nov 19, 2026

    @SchulzCode
    Owner

    Thanks for the detailed write-up! I'm not going to build this. The Y2 has no way to measure the current going in or out of the battery; the level is estimated from the battery's voltage. A history graph would look precise, but "drain per mode" and "time left" would be guesses, and voltage swings with load (it drops while playing, recovers in sleep), so the numbers would mislead more than they help. It's on the list of ideas that won't be built, next to the other battery ideas with the same reason. Closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions