Hi everyone,
If you’ve ever tried to automate a Waterway Power Defender variable speed pool pump, you already know the frustration. While the community has mature integrations for Pentair and Hayward systems, documentation for Waterway is almost non-existent. I saw several threads where people ultimately gave up trying to talk to these pumps.
After a few days of reverse-engineering and trial-and-error, I finally cracked the protocol and wanted to share a drop-in ESPHome reference architecture to control these units safely.
The Protocol Trap: Limited X17 Modbus
The Waterway Power Defender series (like my PD140) is powered by the Nidec Neptune (NPTQ270) motor engine. While it is fundamentally based on the industry-standard X17 Modbus protocol, Nidec uses a scaled-down, limited implementation. If you try to pass many standard X17 initialization or command structures, the drive simply ignores them.
My configuration has been running for about a week now and has been solid.
The Hardware Stack
I designed this configuration around a single, highly integrated industrial board to serve as a complete pool-pad controller:
- Controller: Waveshare Industrial ESP32-S3-Relay-6CH (utilizing the onboard RS-485 transceiver, piezo buzzer, and WS2812 status pixel)
- Circulation Pump: Waterway Power Defender 140 (PD140) wired directly to the RS-485 bus
- Chlorine Dosing: Stenner 7.5-Gallon Tank & Peristaltic Pump (driven via the high-voltage isolated Relay 1)
Core Subsystem Features
1. Split-Surface Pump Command Control
To protect the high-voltage hardware, the configuration completely decouples user/operator intent from low-level execution.
- Public-facing Home Assistant sliders let you request a target speed.
- ESPHome intercepts this intent locally, sanitizing and clamping it against rigid hardware RPM guardrails (600–3450 RPM) and active service overrides (like backwashing or vacuuming) before writing the hex code to the pump.
- Includes an embedded C++ multi-point linear interpolation array that derives continuous, real-time GPM (Gallons Per Minute) flow estimation from filter psi mapping across the pump's torque curve.
2. Safety-Gated Liquid Chlorine Dosing
When you are dealing with high-concentration liquid chlorine, safety is important. The Stenner dosing pump cannot simply be turned on by a timer. Dosing runs through an asynchronous script that requires five strict safety gates to clear before Relay 1 closes:
- Valid calibration data present.
- An active, non-zero volumetric request.
- Maintenance lockouts/physical overrides are turned off.
- Active Modbus telemetry loop confirmation (proving ESPHome is successfully talking to the pump).
- Confirmed high-velocity water movement.
The Fail-Safe: A continuous background diagnostic loop monitors pump velocity and Modbus communication. If the pool pump unexpectedly loses power, drops offline, or drops below safe RPMs, the system instantly triggers an emergency fallback script to kill Relay 1—completely mitigating the risk of dumping raw chlorine into stagnant PVC plumbing. It also includes pre- and post-run delays to ensure water is flowing before and after chemical injection.
3. Localized Telemetry
- 7-Day Rolling History: Uses shifting arrays to persist and track pump runtime, energy metrics (Wh), total volume throughput (gallons), and chlorine consumption directly inside local flash storage.
Repository
The complete, sanitized YAML configuration in the repository below. To make it as easy as possible for anyone grabbing this configuration, I structured the code to pull all hardware pins, Modbus settings, relay labels, thresholds, and pool parameters into a Substitutions block right at the top of the file. You can customize the entire system for your specific pad equipment without needing to dig into or modify the underlying C++ or execution logic.
5 of the 6 relays on the Waveshare board remain completely open for future pad expansions (pool lights, heater loops, etc.).
Hopefully, this saves the next person from spending days staring at a serial monitor trying to get these proprietary pumps talking. Let me know if you have any questions about the register mapping or the safety logic!