ESPHome Pool Controller: Controlling Nidec Neptune / Waterway Pumps & Stenner Dosing

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:

  1. Valid calibration data present.
  2. An active, non-zero volumetric request.
  3. Maintenance lockouts/physical overrides are turned off.
  4. Active Modbus telemetry loop confirmation (proving ESPHome is successfully talking to the pump).
  5. 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.).

:backhand_index_pointing_right: GitHub Repository: GitHub - ccpk1/esphome-nidec-neptune-pool-controller: ESPHome configuration for the Nidec Neptune (NPTQ270) Modbus protocol, native to Waterway Power Defender (PD) variable speed pumps. Features robust split-surface intent architecture, adaptive RPM guardrails, safety-locked liquid chlorine dosing injection, and 7-day rolling historical telemetry tracking. · GitHub

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!

2 Likes

My old Pentair Challenger pump's single speed 1.5 HP motor died. Based on the energy savings I replaced it with the Nidec Neptune NPTQ270. It was a bolt on replacement for the old motor and smaller, lighter and quieter. I ordered the Waveshare and don't have a chlorine doser on my pool. I'm look forward to adapting your code and getting it into home assistant. It looks very well put together.

1 Like

Let me know how it goes or if you have questions. Happy to help. Also, chlorine doser should be fine left as is or could easily strip that out.

Also happy to share some of the dashboard and automations I built out for it, but didn’t want to spend a lot of time on that part until I found there was interest.

Ya, i have some flipping questions!?!? I keep signing up to reserve your pool on different weekends and it keeps sending me offensive messages back like "The pool insurance doesn't cover beached wales and we cant afford you being stranded out of the water" or "Sorry, we've had a history of people that look like you stealing water from our pool but, we have a complementary garden hose out front that you can play in but, we dont accept reservations in days that end in the letter "Y"...........

Whats the deal with your pool system being a jerk to me??? Im starting to think me and my man thong swim suit arent welcome there now and idk how thats even possible!! Who wouldn't want me over by the pool tanning my beautiful amd hairy back cheeks in the sun, even if i do steal a little pool water from time to time!!

I better get an apology or at least some complimentary free hours with the garden hose sprinkler out front so i can at least run and jump through it while screaming "YYEeeee"!

Im so dissapointment......

; )

Haha, I guess these ESPs are a lot smarter than we give them credit for! I didn't realize it had achieved full sentience and a bad attitude. I promise the ‘beached whale’ notice and 'man-thong' ban will be in the next release notes!

Oh ya! Id say yours has become self aware and thinks its a dang comedian! Hey, everyone else has been worried about a Terminator scenario but, it seems that was worst case and instead we got rude a-hole consciousness and now we can all be mocked and put down equally!! It might become the magical thing that makes us all equal after all and now hopefully governments will quit jacking up taxes because of the same goal!!

Lol you're a good sport, thanks!

1 Like