Backyard · Irrigation

Build a Sprinkler Controller with ESPHome

Between the $130 OpenSprinkler and the cloud controllers sits the bench option: an ESP32, an opto-isolated relay board, and the 24VAC transformer from the timer you are replacing. ESPHome has a native sprinkler component — not a hack, a documented controller with zone sequencing that runs on the device — so the whole build lands around $25–40 and waters on schedule even with Home Assistant down. This is the build, the safety rules, and where it stops being the right answer.

Published Nov 21, 2026

The component is real

ESPHome’s sprinkler component behaves like the Rain Bird/Hunter class of controller it replaces: virtually unlimited zones (bounded by GPIO and memory, with I/O expanders supported), full cycles and single-zone runs, repeats, a run-duration multiplier (the seasonal-adjust knob, as a number entity), pump and master-valve support, per-zone enable switches, and valve queuing strategies. The decisive architectural fact: sequencing runs on the device. A cycle started continues to completion if Home Assistant or the network drops mid-watering — the controller is the ESP, and Home Assistant is its remote control and scheduler, not its brainstem. It composes with the rest of the bench: the YAML generator will not write this one for you (sprinkler configs are per-yard), but the getting-started guide covers the platform it stands on.

The build

The standard shape: an ESP32 dev board driving an opto-isolated relay board — one relay per zone — which switches the 24VAC from a transformer, usually the one already powering your old timer. The ESP only ever touches relay inputs; the 24VAC lives on the relay contacts’ side of the board. Documented builds cluster at $25–40 all-in (board, 4- or 8-channel relays, enclosure), with integrated ESP8266 relay boards the other common path and DIN-rail ESP32 relay boards (the KinCony KC868-A8 class) the tidy one. Wire the common from the transformer through the relays to each zone valve, the pump relay or master valve to the component’s pump switch, and a rain sensor if you have one — though a station on the roof makes a better rain witness than a $15 disc that dries out by noon.

The safety rules (water edition)

Two rules from the wider site apply with force. First, the timed-off rule: set maximum run durations in the component so a zone closes on schedule even if everything upstream of the valve dies — water automations fail wet, and the off must never depend on the brain that issued the on. Second, multiplier discipline: the run multiplier is a powerful lever (it scales every zone), so expose it in Home Assistant deliberately, not accidentally — a multiplier of 3 discovered in August is a swamp with a paper trail. Add a flow sensor or a leak sensor at the valve box if you want the system to notice a stuck zone rather than admire it.

Where the build stops being right

The limits, plainly: past about eight zones the wiring and enclosure work grows faster than the savings; a household that wants a warranty and a support line should buy the OpenSprinkler and spend its weekends elsewhere; and renters should not rewire irrigation at all. For the four-to-eight-zone homeowner already running ESPHome, though, this is one of the bench’s best-value builds — and the watering math that tells it how long to run, from your own station’s evapotranspiration, is Smart Irrigation’s department. The seasonal bill for whatever you build is the irrigation cost calculator.

Official documentation and references

Frequently asked questions

Does the ESPHome sprinkler keep watering if Home Assistant goes down?

Yes — sequencing runs on the device. A cycle in progress completes, and the controller holds its configuration locally. Home Assistant is the scheduler and remote; the ESP is the controller.

How much does the build cost?

About $25–40 in parts: an ESP32 board, an opto-isolated relay board (one relay per zone), an enclosure, and the 24VAC transformer usually reused from the old timer.

Is it safe to switch 24VAC with a relay board?

That is exactly what the relays are for — the ESP drives relay inputs at logic level, and the 24VAC stays on the contact side. Keep the two sides physically separate in the enclosure, and set maximum run durations so a zone closes even if the controller dies.

How many zones can it handle?

Effectively as many as you have GPIO for, with I/O expanders beyond that. Practically, the build stops beating an OpenSprinkler on effort somewhere past eight zones.

Related guides