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:
- Heuristic fallback — works immediately after setup, using configurable power thresholds (idle/spin) and rolling averages. No training data needed.
- 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) andsensor.<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_powerentity 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:
- HACS → Integrations → ⋮ → Custom repositories
- Add
https://github.com/jakubhegr18-design/washer_ml, category “Integration” - Install, restart HA
- Settings → Devices & Services → Add Integration → Washer ML
- 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.