ESPHome Custom Sensor for Well Pump Pressure Tank Cycles

· by Maya Kapoor · 4 min read

ESPHome Custom Sensor for Well Pump Pressure Tank Cycles

Monitoring well pump pressure tank cycles with ESPHome lets you catch a waterlogged bladder tank, a failing pressure switch, or a short-cycling pump long before it burns out your motor. This guide walks through building a custom sensor setup in ESPHome that counts pump cycles, tracks run time, and pings you in Home Assistant the moment something looks off, using parts you’ve probably already got in a drawer somewhere.

Why Monitor Pressure Tank Cycles at All?

A healthy well pump system cycles on and off pretty rarely, maybe every few minutes during active water use, not every few seconds. When a pressure tank loses its air charge (waterlogging) or the bladder tears, the pump starts “short cycling”: switching on and off rapidly, sometimes dozens of times a minute. Here’s what that costs you:

Most pressure switches and tanks ship with zero telemetry. No gauge, no alert, nothing. ESPHome closes that gap for the cost of a cheap board and a clamp sensor.

What You’ll Need

The CT clamp route is the safest option here. You clamp it around one of the motor’s supply wires and never make direct contact with line voltage at all.

ESPHome Configuration: Detecting Pump State

Start by reading motor current through the built-in ct_clamp sensor platform, then derive a simple “pump running” boolean from it using a template binary sensor:

sensor:

binary_sensor:

The delayed_on/delayed_off filters debounce the noise, so a brief current spike from a fridge compressor kicking in nearby doesn’t get logged as a fake cycle.

Counting Cycles and Measuring Run Time

Next, add a counter that bumps up every time the pump flips from off to on, along with a running tally of total run duration:

sensor:

binary_sensor:

Reset the counter once a day, either in ESPHome itself or through a Home Assistant automation, so you end up with a clean “cycles per day” number you can compare against a normal baseline (for most households that’s somewhere between 20 and 60 cycles a day, depending on household size and fixture count).

Setting Up Home Assistant Alerts

Once those entities show up in Home Assistant, build an automation that flags short-cycling before it becomes a real problem:

A workable rule of thumb: if the pump cycles more than 6 times in 5 minutes with no obvious heavy water draw happening (no sprinklers, no laundry, nobody filling a pool), that’s a solid sign of a waterlogged tank.

Interpreting the Data

Conclusion

An ESPHome custom sensor takes a silent, failure-prone corner of your home (the well pump and pressure tank) and turns it into something you can actually monitor. A CT clamp, a handful of YAML lines, and a couple of Home Assistant automations buy you early warning on waterlogged tanks and short-cycling pumps. That’s potentially hundreds of dollars saved on a pump replacement, and no more waking up to a dry well on a Sunday morning.

#ESPHome#Home Assistant#Well Pump#DIY Electronics#Home Automation