Skip to content

About

AI battery-life forecast for Windows: learns your habits with Timestral, runs entirely on your PC. Windows fork of Till Dusk.

Topics

Resources

Stars

2 stars

Watchers

0 watching

Forks

 
 

Latest commit

 

History

49 Commits

Folders and files

Repository files navigation

Battery Forecast: how long will your laptop really last today? An AI battery forecast that learns how you use your PC, on battery and while charging. Local AI with Timestral, works offline, free

Battery Forecast

How long will your Windows laptop really last today?
An AI battery forecast that learns how you use your PC, and runs entirely on it.
Powered by Timestral · a Windows fork of Till Dusk

Website · Download · Italiano · ♥ GitHub Sponsors · Ko-fi

Windows 10 and 11 x64 and ARM64 Release Project code: MIT; bundled components have separate terms GitHub Sponsors Ko-fi

Forecast accuracy. Battery Forecast works and is being tested on real laptops. Its accuracy has not been measured yet, so it does not claim any: it shows a range and tells you where each number comes from.

Two forecasts, one panel

Windows shows a percentage. Battery Forecast tells you what that percentage means for the rest of your day, on battery and on the charger. Both forecasts come from the same local AI model, which reads your own battery history as context; nothing is uploaded and the model is not retrained.

On battery: until 14:20, about 13 hours, with range and 24-hour chart Charging: target 80% at 01:40, about 31 minutes, with range and chart Plugged in with the charge held at 80% by a charge limit: if you unplug now, until 16:50
On battery: until when. The time your battery reaches the reserve (5% by default), with an indicative range from cautious to optimistic, the level expected at your evening time and a 24-hour chart. Charging: when you reach your target. When you will reach 80% (or the target you choose), learned from your past charges, slowdown near full included, next to the current charging rate. Plugged in, charge held. With a charge limit (such as the 80% battery care of many laptops) or a full battery: how long it would last if you unplugged now, with the same chart.

Demo mode: synthetic history; the forecasts are computed by the real local model.

  • Never a fake exact number. Estimated times are rounded to 5 minutes and always come with a range and their source: your habits, the current rate, and Windows' own estimate side by side.
  • Your evening. The level expected at 22:00 or at any time you choose (up to four more), and a suggestion to turn on battery saver when it would not last.
  • Calm alerts. About 60, 30 and 15 minutes before the reserve, at low battery, when charged, and when the PC suddenly uses twice as much power. One alert per threshold per discharge, never on the adapter. Quiet hours.
  • Always at hand. Hover the tray icon, click it, or press a shortcut you record (initially Ctrl+Alt+B, press again to close). Choose the panel size and width.
  • History and health. Observed discharges and full-charge capacity vs design capacity, with source and date.
  • At home next to the clock. Tray icon with the exact level, four themes (Dawn, Mist, Dusk, Midnight) or Windows' own, Italian and English, keyboard and screen-reader friendly.
  • Updates from the app. One click checks GitHub, downloads the installer and verifies its SHA-256.

History and battery health window   Preferences, organized in sections with icons

One glance from the tray

Your forecast stays beside the clock. Open it when you need it, then return to what you were doing.

  • Hover over the battery icon to open the panel.
  • Move away to let it close; click to keep it open.
  • Use the keyboard with your own shortcut — press again to close.
Hover preview · demo with simulated battery history.

Hover preview · demo with simulated battery history.

How it works

Windows battery API ──► local history (SQLite, 1 sample/min) ──► Timestral (local, CPU) ──► 24-hour forecast
        │                                                                 ▲
        └──────────────► estimate at the current rate ────────────────────┴──► panel, tray, alerts
  1. While it runs, Battery Forecast records your battery level and power source every minute, plus sleep, resume and charger events. Gaps stay gaps: nothing is invented for the time the PC was off.
  2. Timestral, a time-series model by Mistral AI, reads up to 110 days of that history on a 5-minute grid and forecasts the next 24 hours, with percentiles.
  3. Each forecast answers one clear scenario. On battery, or plugged in with the charge held: your usual use, without plugging in from now on, so the curve never rises. While charging: staying plugged in, so the curve never falls and stops at 100%. The scenario is given to the model as a known future input.
  4. When your habits say you usually plug in (or unplug) at a certain time, the model cannot know what would happen after it. The panel says so and the chart continues at the expected average rate, drawn dashed.
  5. Until there is enough history (a couple of hours of discharges, or a few recorded charges), the estimate at your current rate is shown instead, and the panel says that too.

The details, limits and the meaning of the range are in the model card.

Light on your battery

The AI is not a background service. It starts, computes, and closes.

Background forecasts on battery at most every 30 minutes (or only when you open the panel, or every 10 minutes)
With battery saver on the model never starts by itself
Cost of one forecast about 3 s of CPU, measured on the development laptop
Between forecasts no engine process, no CPU: it closes one minute after answering

Privacy

  • No account, no telemetry. Battery history stays in %LOCALAPPDATA%\BatteryForecast; you can export it as CSV or delete it from Preferences.
  • Forecasts work offline: Python, PyTorch and the model weights are inside the installer.
  • The only network request is the optional daily update check to api.github.com (you can turn it off). Installers are downloaded only from GitHub and kept only if they match the published SHA-256.

Install

  1. Download BatteryForecast-Setup-<version>-x64.exe (Intel/AMD) or -arm64.exe (Snapdragon and other ARM PCs) from Releases.
  2. Optional: check the file against the .sha256 next to it:
    Get-FileHash .\BatteryForecast-Setup-*.exe
  3. Run it. It installs for your user only, without administrator rights. The installer is not digitally signed, so SmartScreen may warn you: choose More info → Run anyway.
  4. The battery icon appears next to the clock. If Windows hides it, drag it out of the ^ overflow area.

Requirements: Windows 10 2004 or Windows 11, x64 or ARM64, about 280 MB download (800 MB installed, mostly PyTorch). Uninstall from Settings → Apps; you will be asked whether to keep your battery history.

Build from source

You need Windows x64, the .NET 10 SDK, Python 3.12 and Inno Setup 6.

# engine environment (CPU wheels) and model weights at the pinned revision
py -3.12 -m venv forecast\.venv
forecast\.venv\Scripts\python -m pip install -r forecast\requirements.lock --extra-index-url https://download.pytorch.org/whl/cpu
forecast\.venv\Scripts\python -m pip install pyinstaller pytest
forecast\.venv\Scripts\python tools\fetch_model.py --model 28M

# tests
dotnet test windows\tests\BatteryForecast.Tests
forecast\.venv\Scripts\python -m pytest -q forecast

# run from source (demo mode: simulated discharge, separate data folder)
dotnet run --project windows\src\BatteryForecast.App -- --demo

# full offline package and installer in artifacts\
powershell -NoProfile -File tools\package.ps1 -Version 0.9.7

ARM64 installers are built natively on Windows ARM by the release workflow, because PyInstaller packages the Python it runs on.

Folder What is inside
windows/src/BatteryForecast.Core battery readings, history, forecast coordination, alerts, texts, updates
windows/src/BatteryForecast.App WPF tray app, panel, chart, preferences, history window
forecast/ local Timestral engine (Python), JSON Lines protocol over stdin/stdout
tools/ packaging, icons, themes, texts, licenses
site/ the website, published with GitHub Pages

Credits and licenses

  • Battery Forecast is a fork of Till Dusk by Matteo Bonfanti, the original macOS menu-bar app, released under the MIT license. The idea, the forecast approach and the wording of many messages come from it.
  • Timestral by Mistral AI: code under Apache 2.0, Timestral-28M weights under a modified MIT license (its exact text is in licenses/ and inside the installer; it includes a company/employer revenue condition detailed below). Battery Forecast is not affiliated with Mistral AI.
  • Python, PyTorch, NumPy, .NET and the other bundled components keep their own licenses; the installer ships every original legal files in its licenses folder. Native Intel OpenMP/oneMKL (x64), ArmPL (ARM64) and Microsoft Visual C++ runtimes have separate supplier terms; new installers display the applicable component agreements.
  • Battery Forecast's own code is MIT, see LICENSE.

The Windows package contains third-party components under their own terms. In particular, the Timestral weights' Modified MIT license restricts exercising its rights when the global consolidated monthly revenue of your company or employer exceeds USD 20 million (or equivalent) for the preceding month; the full original text also addresses derivatives and combined works. This is not standard MIT. Read the original terms and distribution audit. The MIT license applies to project code for which the contributors hold the relevant rights.

Battery Forecast is an independent adaptation and is not an official or endorsed product of Matteo Bonfanti or Mistral AI. Donations to Mattboxx through GitHub Sponsors or Ko-fi fund this Windows port; they are not donations to the original authors. Their copyright and attribution notices are preserved in every package.

Support

If Battery Forecast is useful to you, you can support its development through GitHub Sponsors or Ko-fi. Bug reports and ideas are welcome in Issues.

New in 0.9.5: one clear forecast, separate comparisons

The chart and main duration describe the same AI forecast. Compare other estimates opens the recent-consumption and Windows calculations separately: they use different inputs and assumptions and can disagree substantially. An AI forecast still learning is labelled explicitly. When history is insufficient, recent consumption remains the main fallback. Beyond-horizon text follows the actual remaining curve rather than always claiming 24 hours. Model weights and estimator calculations are unchanged.

New in 0.9.2: learn from comparable use

  • Recognise recurring apps and their load. Enable optional app-workload recording in Data and privacy to keep executable names, measured CPU load and working sets locally. Timestral receives distinct historical channels for up to six currently observed apps and recurring app combinations. Power associations show whole-PC consumption in similar conditions; they do not measure a process's own watts.
  • Learn from past forecast errors. Optional local correction compares original saved forecasts with later uninterrupted readings under similar battery, CPU, display and app-load conditions. It starts after at least eight non-overlapping comparisons across three operating sessions, adjusts the forecast rate by at most ±25%, and can be switched off or reset. Original and issued curves remain saved; model weights are unchanged.
  • Treat sleep as an interruption. Old cached and in-flight estimates are invalidated on wake. Unobserved sleep/hibernation duration does not become hours of zero-consumption active use. Forecast hours mean continued use of the PC; screen-off background activity is still recorded.
  • Zoom Battery trend. Use the wheel at the point of interest, the middle button to pan, and the visible
    • / − / reset controls. The percentage scale adapts; navigation does not run the model again.

Optional brightness collection now works independently of unavailable temperature providers. Battery and sensor history is weighted by represented time, so rapid diagnostic readings do not distort the five-minute means. Known sleep/wake and app interruptions stop interpolation and session continuity; held/interpolated target points are explicitly masked for Timestral. These are functional corrections, not a measured prediction-accuracy improvement.

To try it with your own PC, install the update normally: existing battery history and preferences are retained. In Data and privacy, enable context collection and its use by the model; optional probes also enable supported brightness/temperature readings. Leave the tray app running during normal use and use Recalculate now, then compare the saved forecast with later observations in Battery trend. New CPU intervals need at least six varying five-minute bins (about thirty minutes). Unsupported sensors remain unavailable. Schema 7 cannot be read by 0.9.1; keep a backup of %LOCALAPPDATA%\BatteryForecast before downgrading.

Future app activity is unknown. Correction needs new comparable observations after upgrading and may remain inactive when workloads change often. A faster correction can shorten the chart's supported horizon. Functional tests cover the data path and error exclusions; no scientific accuracy gain has been measured. See the calculation method.

New in 0.9.1: more control and context

  • Optional time goals: switch off the evening goal and extra times without losing saved hours. The main forecast and chart remain available.

  • Recalculate now: the small button at the far right of the forecast header takes a fresh reading and starts the local model, including in on-open mode or battery saver. It is disabled while calculating.

  • Data and privacy tools: inspect current sensor availability, saved observation counts and the channels used by the last forecast. Observed battery watts, CPU and memory have separate history charts with a manual 1–168 hour window. Context sampling is configurable from 30–120 seconds; optional temperature/brightness probes can be switched off independently. These details stay in Preferences, outside the compact popup.

  • Explore the chart: hover to move the dot along the forecast; read the local date/time, expected battery percentage and indicative range. Focus it and use Left/Right, Home or End from the keyboard. Click to keep a small outlined diamond as a reference while the hover point continues moving. Click outside the chart to clear it. A compact caption appears on hover; pinned details remain inline below the chart. No focus frame.

  • Set any time: enter the main target and up to four additional targets as HH:mm, including overnight targets. A past time explicitly refers to tomorrow. Save custom settings with the button or Enter. Reserve percentages and alert minute thresholds are also editable.

  • Open it instantly: a global shortcut (initially Ctrl+Alt+B) opens the panel and, pressed again, closes it. To change it, click Change in Preferences and press the keys: Ctrl, Alt or Win with a letter, digit, F key (except F12), Space, arrows or the numeric keypad. If Windows or another app already uses it, the previous one is kept.

  • Open on hover (optional): rest the pointer on the tray icon and the panel opens without a click, without stealing focus, and closes when the pointer moves away; a click keeps it open.

  • Your size: scale (80–160%) and width of the panel, applied as you move the sliders.

  • Charging forecast, too: choose a target from 50–100% (default 80%). While charging, Timestral learns from your past charges and forecasts when you will reach it, with the same range, chart and honesty as the discharge forecast, including the slowdown near full. The current charging rate is shown next to it as a comparison and used alone until enough charges are recorded. It does not control a hardware charge limit.

  • Give the local model more context: optionally collect aggregate CPU load/frequency, memory, battery charge/discharge watts, brightness, power profile and temperatures exposed by the device. Timestral receives eligible historical sensor channels; the panel names those actually used. Missing sensors stay unavailable. CPU temperature needs a compatible provider already installed; an ACPI zone is labelled separately. No driver, administrator helper, window titles, process paths/arguments, online telemetry or invented future sensor values are introduced. Optional app-workload recording is off by default: it keeps executable names, CPU and working sets locally, with separate historical model channels for recurring apps and matched whole-PC power summaries. It is an observed association, not a claim of per-process watt measurement. Context CSV/history deletion covers it.

  • Make it yours: quiet notification hours, custom alert thresholds, chart visibility and a persistent keep-open preference. Export battery/system-context CSV files, or create an explicit local diagnostic ZIP that excludes history and logs and is never uploaded automatically.

Charging and extra sensor context are experimental. The functional tests exercise the real local model, but an accuracy improvement has not been measured. See MODEL_CARD for methodology and limitations. Collection/model use can be disabled independently in Preferences.

The tray tooltip is hidden while its panel is visible. Data and privacy also records the Windows session display on/off/dimmed state, with an observed-state chart. Unknown or mixed five-minute states stay missing. This is not a per-monitor measurement, and it does not reconstruct old history. Recording and model-use switches apply to this channel too. Hover captions occupy a dedicated line outside each chart.

The 0.9.1 calculation corrections keep forecasts anchored to the actual reading time, preserve unknown power states and use contiguous recent trends. Calculation details. Functional regression checks do not establish predictive superiority.

The first settings page, Battery trend, overlays observed battery readings with a forecast saved when it was issued. Gold shows observations; purple shows the original prediction and indicative band. Choose a saved forecast to inspect individual differences, with warnings for changed power scenarios and interruptions. New curves are saved locally under the same retention/deletion controls; older summary-only records cannot reconstruct missing past curves. The popup's gold dot is labelled as the time goal. The interface uses the original vector app icon at every size; the copy-summary action has been removed. Available in 0.9.1. The last genuine cached forecast is also preserved when upgrading.

In Battery trend, the observed and predicted curves have independent checkboxes. Their visibility is saved; hiding a curve never changes saved data or starts inference. The refresh button explanation is inline, without a tooltip.

Battery trend settings with independent observed and forecast checkboxes. Demo with synthetic battery history and a real local-model forecast.

About

AI battery-life forecast for Windows: learns your habits with Timestral, runs entirely on your PC. Windows fork of Till Dusk.

Topics

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages