Washer ML — Local ML-based washing machine cycle detection from power sensor data

What it does

Washer ML detects the phase of your washing machine’s cycle (Started / Heating / Washing / Rinsing / Spinning / Finished) using only power consumption data from a smart plug — no need for a WiFi-connected washer. It runs entirely locally, no cloud APIs involved, so it’s fine to use on something as modest as a Raspberry Pi 4B.

I built this because my washer is an older AEG with zero connectivity. I already had a Tuya smart plug with power monitoring on it, and wanted something smarter than a flat threshold to know when the cycle actually finished.

How it works

Two-layer detection:

  1. Heuristic fallback — works immediately after setup, using configurable power thresholds (idle/spin) and rolling averages. No training data needed.
  2. Learned model — a lightweight decision tree (pure Python, no numpy/TensorFlow) trained on your own labeled cycles. Once you’ve calibrated a handful of cycles using the built-in buttons, it takes over and gets more accurate over time.

Feature vector per sample: current power, 1-min rolling average, 5-min rolling average, minutes since cycle start, delta from previous sample.

Features

  • Config flow — pick your power sensor from a dropdown, set thresholds, no YAML required
  • Calibration buttons — 5 buttons (Started/Heating/Washing/Rinsing/Finished) to label phases while the model learns your machine’s specific cycle
  • Sidebar panel — live view of current phase, confidence %, elapsed time, estimated time remaining, and a test mode that shows raw prediction scores
  • Sensors — sensor.<name>_stav (state) and sensor.<name>_confidence
  • Diagnostics — standard HA diagnostics export
  • Services — import historical data from CSV, force retrain, reset a bad calibration

Requirements

  • A power-monitoring smart plug (any integration that gives you a sensor.xxx_power entity works — I use Tuya)
  • aiosqlite (already bundled with HA core, no extra install needed)

Installation

Not yet in the default HACS store — add as a custom repository:

  1. HACS → Integrations → ⋮ → Custom repositories
  2. Add https://github.com/jakubhegr18-design/washer_ml, category “Integration”
  3. Install, restart HA
  4. Settings → Devices & Services → Add Integration → Washer ML
  5. Pick your power sensor, done

Status

Working on my own setup (RPi 4B + Tuya plug). Still early — I’ve already found and fixed one bug myself (a deprecated hass.components panel registration call), so there are probably more lurking. If something breaks or looks wrong, please open an issue — and if you’re up for digging in and fixing it yourself, PRs are very welcome too. Built with help from an AI coding assistant (opencode.ai), and claude so extra pairs of eyes on the code are appreciated.

What advantage would this provide over HA_WashData?
It’s what I currently use and it works fine for my washer, but has issues with my dryer because that adapts the drying duration to load weight and moisture using a sensor so WashData can’t really lock onto the cycle shape with such a variable duration.

Thanks for the feedback! That’s a fair comparison. I’ll definitely try WashData to see how it handles the dryer scenario you mentioned. If it works well for both, there’s no reason to maintain this project—WashData sounds like it’s already solving the problem. I built Washer ML mainly because I wanted to experiment with local ML on my specific machine, but if there’s already a solid solution out there that does the job, I’m happy to explore that instead. Appreciate the heads up on the adaptive washer issue!

WashData works very well for my washing machine (it can even predict remaining time quite reliably, and I only have 9 cycles recorded yet and have two profiles that only differ in temperature).

For my dryer, it detects state and cycles correctly, but the remaining time physically can’t be predicted because I have a modern heatpump dryer with sensors, so each cycle has a different duration.

It even has an optional ML part that adapts to your specific device, although you need approximately 30 cycles for that to start working (and don’t yet have this amount of data for one of my appliances).

If you are going to try it, I would definitely recommend importing your power consumption history from your smart plug or current sensor (as far back as the HA recorder goes for you, because you need the granular type of history data, long-time statistics don’t work) so you already have some reference data. The option for that is under Advanced → Diagnostics.