[App] ML Forecast Lab — Machine-learning time-series forecasting for any HA sensor

Hi all,

I've just opened the repo on ML Forecast Lab — a Home Assistant app that brings machine-learning time-series forecasting to any sensor in your HA instance, without the cloud bill, the GPU, or the data-science background.

A core goal of the app is transparency about how good the forecast actually is. Most ML tools hand you a number and ask you to trust it. ML Forecast Lab instead ranks every model against the others on identical folds of your data, shows you the per-model error breakdown, and publishes calibrated 80% prediction bands alongside the point forecast — so you can see when the model is confident, when it isn't, and which architecture earned its place in production.

The mindset is benchmark once, run forever. You point it at a sensor and appropriate covariates, promote the winning model, and from then on it just keeps a fresh forecast in HA. Re-benchmark when the sensor's behaviour changes or you want to try newer architectures.

What you can forecast

Anything that's a numeric sensor.* with a few weeks of history. Some examples could be:

  • Solar / PV production
  • Indoor temperature / humidity per room
  • Daily and weekly home energy consumption
  • Heat-pump COP and flow temperature
  • Battery state-of-charge trajectory
  • Water tank temperatures, well-pump runtime, anything seasonal

What's under the hood

24 backends are currently wired in:

  • Trees: LightGBM, XGBoost, CatBoost
  • Recurrent: LSTM, GRU
  • Convolutional: CNN, TimesNet
  • Linear / MLP: DLinear, NLinear, TSMixer, TimeMixer, TiDE, SparseTSF
  • N-BEATS family: N-BEATS, N-HiTS
  • Transformers: PatchTST, iTransformer, Crossformer, TFT
  • Classical: AutoARIMA, AutoETS, AutoTheta
  • Frequency-domain: FITS
  • Baseline: Seasonal Naive

Honest evaluation

Every benchmark uses the same walk-forward cross-validation folds across all 24 models, so no backend gets a quietly easier test set. Models are ranked by a composite Demšar score across MAE, RMSE, and MASE — no single metric can hand a model a fake win, and the full per-fold scores are visible in the UI rather than collapsed to one number. The published 80% bands are conformal , calibrated empirically on held-out folds rather than derived from a parametric assumption about the error distribution — so if the band says 80%, the true value actually lands inside it ~80% of the time, regardless of whether your sensor's errors happen to be Gaussian.

Hardware reality

Built and tuned for the Pi 5 / 8 GB RAM / no GPU / ARM64 sweet spot. Also runs on amd64 and armv7. First build is 10–15 minutes on a Pi 5 due to PyTorch install; subsequent updates use the cached image.

Install

Add the repo: Settings → Apps → Install app → ⋮ → Repositories, Add:

https://github.com/psweens/ml-forecast-lab

Then install ML Forecast Lab from the store. Full docs render on the Info / Documentation tabs once installed.

Status & what I'm looking for

It's a first public release after a lot of iterations on my private repo, so the codebase is relatively stable but the public user base is nil. So it would be great to hear what everyone thinks!

GitHub: GitHub - psweens/ml-forecast-lab: Multi-model ML forecasting for Home Assistant — benchmark, promote, and publish calibrated forecasts as HA sensors. Pi 5 ready. · GitHub

Happy to answer questions in the thread.

2 Likes

Suggestion:
Add-ons have been renamed to Apps some months ago now.
Using the term Add-on with new software can cause some confusion because people have been trying to find add-on in the HA UI, and it is no longer there. Confusion = more issues for you to deal with.

This don't work: **Or add the repository manually: Settings → Add-ons → Add-on store **
Please consider a wording revision.

What an oversight by me! I hadn’t noticed. I’ve now corrected this here and in the repo docs. Thanks :folded_hands:t2:

1 Like

Would it be possible to have this as an integration?
I think a lot of people are just deploying home assistant containers where access to apps is harder. I tend to try to avoid apps in favor of integrations.

Can I double check that I’ve understood? Two things: (1) HA Container users can’t reach the App store, and (2) you’d prefer integrations over apps even where apps are available.

A pure integration isn’t really viable here — ML Forecast Lab currently pulls in ~2 GB of deps (PyTorch etc)) and theoretically could run multiple hour-long benchmarks (say if a user selected several transformer models, heavy cross validation and hyper parameter tuning etc). Putting that inside HA core’s Python process would slow HA boot and risk blocking the event loop. The app exists because the ML probably needs its own process.

What I could realistically look into:

  1. Publish the app image as a standalone container so users can run it via docker-compose alongside HA.

  2. Add a companion integration via HACS that gives the HA-native UX (config flow, device grouping, services for automations) by talking to the running app’s API.

Would that work? Solution 1 fully covers (1). Solution 2 covers the HA-side UX of (2), but there’d still be a separate process since the heavy ML shouldn’t sit inside HA core.