🔧 Tutorials 🏠 Smart Home

Automating Cycle-and-Soak Irrigation on Clay Soil and Slopes With Local ESP32 and Home Assistant

Why Clay Soil and Slopes Waste Water Under Single-Block Schedules

If you run a sprinkler zone for 20 straight minutes on compacted clay soil or a sloped lawn, the last half of that cycle often does more for your storm drain than your grass. Once the top layer of soil fills up, excess water stops soaking downward and sheets across the surface into sidewalks, driveways, and gutters.

The root cause is a mismatch between two rates:

  • Precipitation rate: How fast your sprinkler nozzles deliver water onto the lawn.
  • Soil infiltration rate: How fast water can enter the pore space of your soil.

Fixed spray heads typically apply water much faster than dense clay can absorb it, and gravity on a slope shortens the time before excess water starts moving downhill. Even when the surface looks soaked, water may barely reach the active root zone a few inches down.

Cycle-and-soak (also called split-cycle irrigation) fixes this without digging up a single pipe. Instead of running a zone in one continuous block, you split the total watering target into shorter active passes separated by soak intervals. During each soak break, capillary action and gravity pull surface moisture deeper into the clay profile so the next pass absorbs cleanly instead of running off.

With SprinklerID by IntelliDwell, you can run cycle-and-soak schedules 100% locally on an ESP32—either directly from on-device flash storage with no external server, through built-in sequential zone queues, or orchestrated from Home Assistant with on-device safety timers.

Three Local Ways to Run Cycle-and-Soak on SprinklerID

Every watering schedule, countdown timer (1–240 minutes), sequential multi-zone queue, and 1,000 ms Master Valve interlock in SprinklerID executes locally on the ESP32 controller at http://sprinklers.local. Depending on how many sloped or clay zones you have and whether you already run Home Assistant, pick the approach that fits your yard:

Approach How It Works Best For Offline Resilience
On-Device Flash Schedules (schedules.json) Multiple staggered onTime/offTime entries per zone stored in ESP32 flash Any yard (1 to 9 sloped/clay zones) wanting zero hub dependencies 100% autonomous—runs even if Wi-Fi, internet, and Home Assistant are down
Interleaved Sequential Queue (/start-run-queue) Rotates through 3+ zones in one continuous ESP32 queue (Z1 -> Z2 -> Z3 -> Z1...) Yards with 3+ zones where watering other zones creates natural soak gaps 100% autonomous once started—the ESP32 steps every valve locally
Home Assistant + On-Device Timers (intellidwell.start_timer) Home Assistant schedules loops and soak waits while ESP32 owns valve shutoff countdowns Yards with 1–2 steep clay zones needing long dwell pauses or soil-moisture triggers Safe shutoff—ESP32 closes each active pass even if Home Assistant reboots mid-run

Step 1: Measure Your Yard's Time-to-Runoff

Before programming numbers into your controller or Home Assistant, measure how long your specific sloped or clay zone can actually drink water before pooling starts. Because nozzle output, head spacing, soil compaction, and grade vary widely from yard to yard, a quick visual test beats any generic chart.

  1. Open the local Web UI at http://sprinklers.local (or open the SprinklerID Android App (.APK) in Local-Only Mode).
  2. Start a manual timer on your sloped or clay zone (15 or 20 minutes is plenty) and walk out to the low edge of the zone with a stopwatch.
  3. Watch closely for the first signs of surface pooling or water trickling across curbs, walkways, or downslope mulch.
  4. Note the elapsed time when runoff begins, then cancel the timer.

Set your maximum single-pass runtime just below that runoff point. For example, if water starts creeping off your clay slope around minute 8, cap each pass at 5 or 6 minutes. To deliver an illustrative 18-minute total irrigation dose without runoff, you would run 3 passes of 6 minutes separated by 20 to 30 minutes of soak time.

Nozzle tip: If your fixed spray heads reach runoff in under 4 minutes on a steep slope, swapping to lower-application rotary nozzles alongside cycle-and-soak makes watering schedules much easier to fit before sunrise.

Step 2: Configure Pure-Local Cycle-and-Soak on the ESP32

If you want your cycle-and-soak routine to survive router reboots, ISP outages, and Home Assistant maintenance without missing a beat, build it directly on the controller.

Option A: Staggered Multi-Pass Windows in Scheduler (schedules.json)

In SprinklerID's open-source MicroPython firmware (controller.py), each of the 10 zones stores an independent list of schedule entries in schedules.json. That means a single zone can hold multiple onTime/offTime windows on the same days of the week (Mon, Wed, Fri), evaluated every minute against the ESP32's internal clock.

For example, suppose Zone 1 (Front Slope), Zone 2 (Side Clay), and Zone 3 (Back Slope) each need 3 × 6 minute passes (18 minutes total) with 24 minutes of soak time between passes. In the Scheduler tab at http://sprinklers.local, you can interleave their start and stop times with a 1-minute buffer between zones:

Cycle Pass Zone 1 (Front Slope) Zone 2 (Side Clay) Zone 3 (Back Slope)
Pass 1 (6 min each) 05:00 – 05:06 05:07 – 05:13 05:14 – 05:20
Pass 2 (6 min each) 05:30 – 05:36 05:37 – 05:43 05:44 – 05:50
Pass 3 (6 min each) 06:00 – 06:06 06:07 – 06:13 06:14 – 06:20

Even if you only have one sloped zone (Zone 1), entering 05:00–05:06, 05:30–05:36, and 06:00–06:06 on that zone's card gives it 24 minutes of soak time between every pass. Leave at least 1 minute between the end of one zone and the start of the next so the firmware finishes closing the previous valve cleanly and avoids overlap warnings in scheduler.html.

If you have a Master Valve or Pump Start Relay configured in Settings, SprinklerID automatically locks that terminal out of Scheduler and Sequential Runs, opens the Master Valve 1,000 ms (1 second) before any zone opens, and shuts the zone off before closing the Master Valve.

Option B: Interleaved Sequential Runs (Settings -> Sequential Runs)

When you have three or more zones and want zero idle gaps in your watering window, SprinklerID's built-in Sequential Runs engine (run_queue_processor()) steps through an ordered list of zones strictly one at a time, preserving single-zone dynamic water pressure across every nozzle.

Open http://sprinklers.local, go to Settings -> Sequential Runs, and click Create New Run. Remember that you can add the same zone multiple times across the step list (for example, Zone 1 -> Zone 2 -> Zone 3 -> Zone 1 -> Zone 2 -> Zone 3 -> Zone 1 -> Zone 2 -> Zone 3 at 6–8 minutes per step), then click Save Runs (No Restart) to store it without rebooting.

You can also launch an ad-hoc interleaved sequence anytime over your LAN via POST /start-run-queue (using 0-indexed pin values 0–9 and duration_mins integers):

POST http://<CONTROLLER_IP>/start-run-queue
Content-Type: application/json

{
  "queue": [
    { "pin": 0, "duration_mins": 6 },
    { "pin": 1, "duration_mins": 8 },
    { "pin": 2, "duration_mins": 6 },
    { "pin": 0, "duration_mins": 6 },
    { "pin": 1, "duration_mins": 8 },
    { "pin": 2, "duration_mins": 6 }
  ]
}

Notice how run_queue_processor() works in firmware: every queued step must target an active zone pin (0–9) with duration_mins > 0, and each finished zone turns off before the next step begins. While Zone 2 (8m) and Zone 3 (6m) water sequentially, Zone 1 automatically gets 14 minutes to soak before Pass 2 begins. If your yard only has 1 or 2 zones—so cycling through other zones does not create a long enough soak pause—use Option A above or let Home Assistant manage the soak delay in Step 3.

Step 3: Automate Cycle-and-Soak in Home Assistant With Hardware Countdown Safety

Home Assistant adds two capabilities that static wall timers cannot match: clean reusable loops for single-zone soak waits, and dynamic skipping or scaling based on backyard soil-moisture probes and local weather sensors.

Connect Locally and Reserve a LAN IP

First, assign a DHCP IP reservation for SprinklerID in your router so Home Assistant always reaches it reliably even in Docker or segmented VLAN environments where mDNS (sprinklers.local) may not resolve. Then connect Home Assistant using our official HACS integration (IntelliDwell Sprinkler Controller, repository https://github.com/TannerNelson16/ha-intellidwell), which polls GET http://<CONTROLLER_IP>/api/status over your LAN every 10 seconds.

Why You Should Use intellidwell.start_timer Instead of switch.turn_on + delay

A common Home Assistant mistake is automating irrigation with switch.turn_on, a delay block, and switch.turn_off. If Home Assistant restarts for a core update or drops off your network during that delay, switch.turn_off never runs and the valve stays open indefinitely.

Instead, call intellidwell.start_timer (which wraps GET /relay-timer/<pin>/<minutes> locally on the ESP32). That hands the countdown directly to the controller's timers engine. Even if your Home Assistant server goes offline seconds after Pass 1 starts, the ESP32 itself shuts the valve off when the countdown hits zero.

Important concurrency rule: Starting a zone timer (/relay-timer/<pin>/<minutes>) or run queue (/start-run-queue) calls stop_all_watering() first so overlapping valves cannot drop water pressure or overload your 24VAC transformer. Always check that sensor.intellidwell_sprinkler_controller_active_zone is Idle before launching a pass, and avoid running two independent cycle-and-soak scripts at the same time.

Pattern 1: Reusable Cycle-and-Soak Script for 1–2 Slope Zones

Add this reusable script to scripts.yaml (or via the Home Assistant UI). It runs any target zone (1–10) for cycles passes of run_minutes, delegating every active shutoff to the ESP32 via intellidwell.start_timer, waiting for Idle, and pausing for soak_minutes between passes (skipping the soak wait after the final pass):

alias: SprinklerID - Cycle and Soak Zone
mode: single
fields:
  zone:
    name: Zone Number
    description: Controller zone number (1-10)
    required: true
    selector:
      number:
        min: 1
        max: 10
  cycles:
    name: Cycles
    description: Number of passes
    default: 3
    selector:
      number:
        min: 1
        max: 6
  run_minutes:
    name: Run Minutes per Cycle
    description: Keep below your measured time-to-runoff
    default: 6
    selector:
      number:
        min: 1
        max: 60
  soak_minutes:
    name: Soak Minutes Between Cycles
    default: 24
    selector:
      number:
        min: 5
        max: 120
sequence:
  - repeat:
      count: "{{ cycles | int(3) }}"
      sequence:
        - condition: numeric_state
          entity_id: number.intellidwell_sprinkler_controller_rain_delay
          below: 1
        - wait_template: "{{ is_state('sensor.intellidwell_sprinkler_controller_active_zone', 'Idle') }}"
          timeout: "00:05:00"
          continue_on_timeout: false
        - action: intellidwell.start_timer
          data:
            zone: "{{ zone | int }}"
            duration_mins: "{{ run_minutes | int }}"
        - delay:
            minutes: "{{ run_minutes | int }}"
        - wait_template: "{{ is_state('sensor.intellidwell_sprinkler_controller_active_zone', 'Idle') }}"
          timeout: "00:02:00"
          continue_on_timeout: false
        - if:
            - condition: template
              value_template: "{{ not repeat.last }}"
          then:
            - delay:
                minutes: "{{ soak_minutes | int }}"

Notice how the script checks number.intellidwell_sprinkler_controller_rain_delay < 1 at the start of every cycle. If rain starts halfway through your soak interval and a rain delay is applied, the remaining passes stop cleanly before opening the valve again.

Pattern 2: Dawn Automation With Soil-Moisture and Weather Guards

Trigger that script on your watering days only when the yard is dry enough to need water—for example, gating on a Zigbee, Ecowitt, or ESPHome soil-moisture sensor buried in the root zone of your clay slope:

alias: Irrigation - Morning Clay Slope Cycle and Soak
mode: single
triggers:
  - trigger: time
    at: "05:00:00"
conditions:
  - condition: time
    weekday:
      - mon
      - wed
      - fri
  - condition: numeric_state
    entity_id: number.intellidwell_sprinkler_controller_rain_delay
    below: 1
  - condition: state
    entity_id: sensor.intellidwell_sprinkler_controller_active_zone
    state: "Idle"
  - condition: numeric_state
    entity_id: sensor.clay_slope_soil_moisture
    below: 32
actions:
  - action: script.sprinklerid_cycle_and_soak_zone
    data:
      zone: 1
      cycles: 3
      run_minutes: 6
      soak_minutes: 24

Alternative: Triggering a Multi-Zone Interleaved Queue via rest_command

If you have 3 or more zones—or if you connect via MQTT Auto-Discovery without HACS—you can keep the entire cycle-and-soak rotation inside one ESP32 sequential queue call using rest_command in configuration.yaml:

rest_command:
  sprinklerid_clay_cycle_queue:
    url: "http://192.168.1.50/start-run-queue"
    method: POST
    content_type: "application/json"
    payload: >
      {
        "queue": [
          {"pin": 0, "duration_mins": 6},
          {"pin": 1, "duration_mins": 8},
          {"pin": 2, "duration_mins": 6},
          {"pin": 0, "duration_mins": 6},
          {"pin": 1, "duration_mins": 8},
          {"pin": 2, "duration_mins": 6},
          {"pin": 0, "duration_mins": 6},
          {"pin": 1, "duration_mins": 8},
          {"pin": 2, "duration_mins": 6}
        ]
      }

Because /start-run-queue executes the entire 9-step array inside run_queue_processor() on the ESP32, Home Assistant fires one local HTTP POST and the microcontroller finishes every pass and soak rotation autonomously. (If you rely solely on MQTT Auto-Discovery switches under cmnd/zone/<n>/power, remember that ON holds the relay open until OFF arrives—so rest_command against /relay-timer/<pin>/<minutes> or /start-run-queue is much safer than raw MQTT toggles.)

Step 4: Pair Cycle-and-Soak With Subscription-Free Smart Rain Delays

Clay holds water far longer than sandy loam, so skipping irrigation after storms is just as important as splitting cycles on dry days. SprinklerID includes subscription-free weather protection across multiple sources documented in our SprinklerID Documentation & OTA Portal:

  • NWS Gridpoint QPF + NOAA ACIS Gauges: Evaluates observed rainfall and incoming Quantitative Precipitation Forecasts (QPF) so storms trigger 1–5 day rain delays before water hits already-heavy clay.
  • Ambient Weather Network: Bind a personal rooftop station or nearby outdoor Ambient Weather station by MAC address for hyperlocal backyard rainfall tracking.
  • Home Assistant Local Weather & Moisture Push (POST /api/weather): Push temperature, local rain gauge readings, and soil moisture thresholds straight from Home Assistant over your LAN—or configure custom:intellidwell-weather-card in ha-intellidwell.

If you enable the optional zero-subscription SprinklerID Cloud Portal, pay attention to ha_rain_delay weather-source arbitration: when Cloud Services are off (cloud_enabled = 0), the controller automatically honors rain delays pushed from Home Assistant via POST /api/weather; when Cloud Services are paired and set to NWS or Ambient Weather, the Cloud Portal sets ha_rain_delay = 0 so local weather pushes record telemetry without overwriting your Cloud weather station's delay unless you switch the property weather source to Controller Pushed (Home Assistant).

The Cloud Portal also gives you an interactive 2D vector CAD Yard Map (with sweeping rotor and falling dripper animations synced live over WebSocket, multi-property management, contractor sharing, and an optional user-key Gemini Vision satellite screenshot scanner) so you can watch each cycle-and-soak pass light up across your yard.

Troubleshooting Clay & Slope Cycle-and-Soak Setups

  • Scheduler overlap warning when adding Pass 2 or Pass 3: Check that each zone's offTime finishes at least 1 minute before any other zone's onTime (for example, 05:06 off and 05:07 on) so valves never stack on your mainline or 24VAC transformer.
  • Home Assistant start_timer cuts off another running zone: Because /relay-timer/ and /start-run-queue clear active runs via stop_all_watering(), never fire separate zone scripts in parallel. Put multi-zone sequences inside one /start-run-queue payload or step them inside one script.
  • Home Assistant rain delays get ignored: Check whether Cloud Services are enabled with NWS or Ambient Weather selected. Either keep Cloud disabled for 100% LAN weather authority, set the Cloud Portal weather source to Controller Pushed (Home Assistant), or use number.set_value on the Rain Delay entity.
  • Garage Wi-Fi drops during early morning runs: Reserve a static IP in your router, confirm your 2.4 GHz SSID keeps legacy 802.11b rates enabled for long-range association, and rely on on-device flash schedules or /start-run-queue so any mid-cycle Wi-Fi hiccup never leaves a valve stuck open.

Built for Reliable Local Irrigation

"SprinklerID identifies your irrigation needs—without needing to identify YOU."

Designed by our team in Utah, SprinklerID by IntelliDwell is a drop-in 10-zone 24VAC smart controller built around open-source ESP32 firmware (GPLv3 with a non-commercial hardware restriction on GitHub).

  • Order SprinklerID: $84.99 (controller only, reusing your existing 24VAC transformer) or $94.99 (Complete Kit with 24VAC power supply) at intellidwell.net/sprinklercontroller.
  • Explore the Docs: Full wiring guides, HACS and MQTT setup steps, REST endpoints, and OTA firmware updates are at docs.intellidwell.net/sprinkler/.
  • Lifetime Return Policy: Every direct purchase is backed by our Lifetime Return Policy—a full refund or replacement anytime unless intentional damage is suspected, with return shipping paid by the buyer.