This whole project is 100% vibecoded by Claude Code. Due to the reason behind my wife owning a Medela breast pump, I did not have time to code it myself. Was actually pretty useful when I added an automation that would notify my wife whenever the pump was running for a certain amount of time.
Local-push Bluetooth integration for connected Medela breast pumps (Swing Maxi, Freestyle Flex, Duo, Solo, Sonata). No cloud, no Medela app, no account — Home Assistant talks to the pump directly over BLE.
Read-only by design. The pump's BLE protocol has no motor control (the official app can't start/stop the pump either), so this integration exposes sensors only. Protocol details: docs/MEDELA_BLE_PROTOCOL.md.
| Entity | Type | Notes |
|---|---|---|
| Session state | sensor (enum) | idle / stopped / running / paused / finished / starting |
| Pumping | binary_sensor | on while a session is running |
| Phase | sensor (enum) | stimulation / expression |
| Vacuum level | sensor | 1–9 |
| Session timer | sensor (duration) | elapsed time of the current session |
| Battery | sensor (%) | retained across restarts |
| Charging | binary_sensor | |
| Rhythm, Goal time, Alert, Air leak, Power connected, Lifetime pumping time | various | Sonata family only |
The integration detects the pump family on first connect and only creates the entities your pump actually reports (7 for Swing Maxi / Flex, the full set for Sonata).
Useful automations: "session finished" notifications, logging session durations, low-battery alerts, a "currently pumping" indicator on a dashboard.
- Home Assistant 2024.4 or newer.
- A Bluetooth adapter usable by Home Assistant near the pump — the host's built-in radio or an ESPHome Bluetooth Proxy.
- HACS → three-dot menu → Custom repositories → add
https://github.com/stirante/ha-medela-pumpas type Integration. - Search for Medela Breast Pump in HACS and install it.
- Restart Home Assistant.
Copy custom_components/medela_pump/ into your Home Assistant
config/custom_components/ directory and restart.
Power the pump on with Bluetooth active (hold the connection button until it advertises). The pump is auto-discovered — accept the discovery notification, or add it via Settings → Devices & Services → Add Integration → Medela Breast Pump. No pairing code is needed.
If the pump is asleep during setup, the integration waits and connects automatically the next time the pump advertises.
- Session sensors read
unknownuntil the pump sends its first frame for them (typically when a session starts); battery/charging populate immediately. - Entities go
unavailablewhen no data has arrived for 30 s (pump off, out of range, or a stalled connection — a watchdog reconnects automatically). - The pump replays the previous session's timer on connect; the integration gates the timer until it is confirmed to be ticking, so automations don't fire on stale values.
- The pump only reports state transitions, so when Home Assistant connects mid-session the "running" state is inferred from the advancing timer.
Confirmed end-to-end on a Swing Maxi (FW V1.1.0.301222) with Home
Assistant in Docker on a Raspberry Pi. Sonata-family support is implemented
from the same reverse-engineered protocol but has not been tested on hardware —
reports welcome via issues.
This project is not affiliated with or endorsed by Medela. It is a community integration based on a reverse-engineered protocol; use at your own risk. It never writes anything that changes pump behavior (the only writes are the protocol's authentication frames).
0 comments
log in to comment.