Irrigation is the control domain where failure fastest produces crop damage. A mis-scheduled fan leaves a few degrees of temperature drift; a mis-scheduled irrigation valve that stays open for eight hours floods substrate, drowns roots, and wastes water and fertilizer. A mis-scheduled irrigation valve that stays closed for three days over a hot summer weekend kills plants. Building reliable irrigation automations in Home Assistant means getting the happy-path logic right and paying serious attention to what happens when pumps fail, valves stick, filters plug, sensors lie, and power blinks. This page covers the patterns that working irrigation deployments use — the three basic irrigation approaches (scheduled, sensor-triggered, hybrid), the fertigation considerations that make nutrient delivery safe, the fail-safe design that keeps mistakes from becoming disasters, and the concrete failure modes that cost growers real crops every season. The general principle from [Climate Control Patterns](/home-assistant/agriculture/climate-control) applies here as well and more urgently: Home Assistant improves irrigation operations; hardware interlocks and mechanical safety remain the safety layer.
Before building irrigation automations.
Prerequisites:
Areas and naming conventions established. Per [Organizing Home Assistant for a Farm](/home-assistant/agriculture/organizing). Irrigation automations reference zones, valves, pumps, and sensors by name; clarity prevents errors during setup and troubleshooting.
Sensors placed and verified. For sensor-triggered irrigation, the soil moisture or substrate moisture sensors have to report reliable data. A sensor reading that is systematically wrong produces systematically wrong irrigation. [Your First Sensor](/home-assistant/getting-started/first-sensor) covers the placement discipline.
Hardware safety in place. The irrigation system should have physical safeguards independent of Home Assistant — a supply pressure reducer that prevents over-pressure, a flood sensor with a relay that cuts pump power if water pools where it shouldn't, freeze-protection interlocks in cold climates, a flow-based over-run protection that stops irrigation exceeding a reasonable duration, and a pressure-based dry-run protection on the pump. The collective's position from Climate Control applies: Home Assistant handles operational control; hardware handles safety.
An understanding of the operation's water budget. How much water does each zone need per day? What is the flow rate of each valve? How long does one irrigation cycle take? What pressure does the system run at? The automation is an encoding of these facts; the facts need to be known first.
Building irrigation automations without these foundations produces automations that can produce real damage — flooded substrate, drowned roots, wasted water, failed crops. The foundations matter more here than in climate control because the consequences arrive faster.
The three basic approaches.
Irrigation automation falls into three broad patterns. Most production systems use combinations of all three.
Scheduled irrigation. The automation runs at fixed times. Every day at 6 AM the zone 1 valve opens for 10 minutes. This is the simplest pattern and the most common in commercial agriculture. Reliable, predictable, easy to understand. Works well for crops and substrates where water needs are predictable and the environmental variation is moderate.
Sensor-triggered irrigation. The automation runs when a sensor (usually soil or substrate moisture) crosses a threshold. When substrate moisture drops below 40% VWC, the valve opens for 5 minutes. Respects variability — the automation only waters when the crop actually needs it, not on a fixed schedule that may over-water in cool weather or under-water in hot.
Hybrid irrigation. Combines scheduled and sensor-triggered logic. A baseline schedule runs regardless; additional irrigation fires when sensors indicate the schedule wasn't enough. Or: the scheduled irrigation only runs if a sensor-triggered precondition is met (e.g., substrate moisture is below a threshold at the scheduled time; otherwise skip this cycle).
Each approach has tradeoffs covered in detail below.
Scheduled irrigation.
The classic pattern. Well understood, reliable, straightforward to troubleshoot.
The basic automation.
The pattern: fire at a specific time, open the valve, wait a specific duration, close the valve. Most commercial timer-based irrigation systems replicate this same logic.
Multiple cycles per day.
Most crops benefit from more than one irrigation cycle per day, especially in warm weather. Two or three shorter cycles (5-7 minutes each) produce better substrate wetting and reduce runoff compared to one long cycle (20 minutes). The automation fires separately for each cycle.
Common patterns: - Morning cycle: 06:00, 10 minutes - Mid-morning: 10:00, 5 minutes - Early afternoon: 13:00, 5 minutes - Late afternoon: 16:00, 5 minutes (where appropriate)
The specific schedule depends on crop, substrate, weather, and zone size. Start with a reasonable schedule, observe plant response and runoff, adjust.
Shutting down by environmental conditions.
A schedule that fires regardless of conditions wastes water in unusual situations. Scheduled irrigation during a rainstorm in an open field wastes water and increases leaching; during a freeze event in a cold climate, it can damage the plumbing. Weather-aware scheduling adds a condition check before firing:
- Skip if significant rain predicted or occurring (via weather integration) - Skip if air temperature below a freeze threshold - Skip if substrate moisture is already high (adds a hybrid element) - Skip if a "no-irrigation" flag is set (e.g., during harvest or treatment)
These conditions keep the basic schedule simple while handling the edge cases that would otherwise cause problems.
Seasonal adjustment.
Summer irrigation schedules differ from winter schedules. The simplest pattern is to have multiple automations — one per season — and enable/disable them as seasons change. A more integrated pattern uses template logic that adjusts duration or frequency based on month, outdoor temperature, or daylight hours.
Sensor-triggered irrigation.
Responsive to actual conditions. Runs only when needed. Can save substantial water in variable weather.
The basic automation.
The core idea: trigger on the dry threshold, water until the sensor says the substrate is wet enough (or until a safety timeout), stop.
The sustained-threshold requirement.
A substrate moisture sensor fluctuates momentarily as the sensor's reading settles, as water moves through the root zone, and as electrical noise affects readings. An automation that fires on the first reading below threshold may fire on noise. The "sustained for 5 minutes" check ensures the threshold crossing is real before acting.
The stop condition.
Two conditions to stop: the sensor reads wet enough, or a safety timeout fires. Never rely solely on the sensor reading — a failed sensor could leave the valve open indefinitely. The safety timeout (typically 10-15 minutes for a single cycle, depending on expected watering duration) is the backstop.
Hysteresis for irrigation.
Like climate control, irrigation benefits from hysteresis. Start below 35% VWC, stop above 50% VWC. The 15-point gap prevents the system from oscillating at the threshold.
Runoff-based stopping.
For substrate-grown crops (hydroponic, container), irrigation commonly runs until a specified percentage of runoff drains out. "Water until 10-20% of the applied water runs out the bottom." This requires a runoff sensor (either a tipping-bucket flow meter or a float in a runoff tank) that the automation watches. More sophisticated, more reliable when tuned, more complex to set up.
Dry-back period.
For some crops and stages, a dry-back period between irrigations benefits the plant (encourages root growth, prevents oxygen starvation at the root zone). The automation enforces this — after an irrigation cycle, wait at least X hours before the next cycle can fire, even if the sensor reads dry. This is particularly relevant for propagation, flowering cannabis, and some other situations where control over substrate water content matters for the crop's developmental cycle.
Hybrid irrigation.
Combines scheduled predictability with sensor-driven responsiveness.
Pattern 1: Scheduled baseline plus sensor-triggered top-ups.
A scheduled cycle runs at baseline times (morning, midday). Sensor-triggered automations fire additional cycles if the substrate gets drier than expected between scheduled cycles. Handles hot-day spikes without over-watering cool days.
Pattern 2: Scheduled cycles with sensor-based skip.
Scheduled cycles fire but only if the substrate moisture is below a threshold. If the substrate is already wet, the scheduled cycle skips. Conserves water during cool or humid periods while maintaining predictable timing.
Pattern 3: Window-based sensor-triggered.
Sensor-triggered irrigation with time-window restrictions. "Water if substrate is below 35% VWC, but only between 06:00 and 16:00." Prevents late-evening watering that could leave foliage wet overnight.
These patterns compose. A practical production automation might use scheduled cycles for baseline, sensor-triggered top-ups during hot days, a time-window restriction to prevent evening watering, a weather-based skip when rain is coming, and a minimum dry-back between any two cycles.
Fertigation considerations.
For operations that deliver nutrients with irrigation water (fertigation), the automation has additional concerns.
Nutrient calibration.
Fertigation delivers a specific EC (electrical conductivity, proxy for dissolved nutrient concentration). The automation logic typically: - Measures the mixed solution's EC - Adjusts the injection rate of nutrient stock to hit the target EC - Logs the delivered concentration for record-keeping and compliance
Home Assistant can integrate fertigation controllers that do this calibration directly, or can orchestrate simpler component-level control (stock pump plus EC monitoring plus closed-loop adjustment).
Interlocks specific to fertigation.
Irrigation with plain water is forgiving of small mistakes. Fertigation with incorrect nutrient concentration can damage crops in one cycle. Interlocks matter:
- EC out-of-range shutdown: if measured EC is above 150% of target, stop injection and alert - pH out-of-range shutdown: if measured pH drifts significantly from target, stop and alert - Stock level interlocks: if any stock tank is low, pause fertigation (watering without nutrients, or full stop) - Post-cycle flush: after fertigation cycles, run plain water briefly to flush nutrient remnants from drip lines
These should be in hardware where possible (EC and pH probe alarms wired to relay shutoffs) and duplicated in Home Assistant for visibility and alerting.
Separate fertigation and plain-water cycles.
A common pattern: two schedules per day, one with fertigation at the target EC, one with plain water for flush and leach. Both trigger separate automations with their specific settings.
Batch tank management.
For operations that mix fertigation batches in a holding tank rather than in-line injection, Home Assistant can automate batch mixing: fill tank, dose nutrients to reach target EC, hold at temperature, use for scheduled fertigation cycles. The batch approach is more predictable than in-line injection but requires more tank space and more sophisticated automation.
Fail-safe design for irrigation.
Irrigation failures happen in several characteristic ways. Designing against them is not optional.
Pump failure.
A pump that fails to start when commanded leaves the system pressureless. A pump that fails to stop runs dry or wastes water. Detection patterns:
- Pressure monitoring: a pressure sensor downstream of the pump confirms pressure when the pump is on. No pressure with pump commanded on = pump problem or blockage. Pressure with pump commanded off = valve problem. - Power monitoring: a power sensor on the pump circuit confirms the pump is drawing power when commanded on. No power draw = electrical failure or contactor problem. Power draw with command off = stuck contactor. - Flow monitoring: a flow meter confirms water is actually moving during irrigation. Zero flow during an irrigation cycle = pump, valve, or line problem.
An automation that commands irrigation and verifies pressure/power/flow is substantially more reliable than one that just sends commands and assumes they worked.
Valve failure.
Solenoid valves fail in predictable ways. They stick open (most common) or stick closed (less common). A valve that stuck open during the last cycle is still open now.
Detection: pressure monitoring downstream of the valve when the valve should be closed should show no pressure (or show pressure drop over time as residual drains). Flow monitoring should show no flow when all valves are commanded closed.
The "all valves closed but flow detected" situation indicates a stuck valve, a leak, or an incorrect state — any of which the grower needs to know about.
Filter plugging.
Water supplies carry particulates. Filters catch them and gradually plug. A plugged filter drops pressure downstream, which reduces irrigation effectiveness even though the system appears to run normally.
Detection: pressure monitoring before and after the filter, with an alert when the pressure drop exceeds a threshold.
Freeze damage.
In cold climates, frozen water in lines causes burst pipes and damaged valves. Detection and response:
- Outside temperature monitoring - Automatic disable of irrigation below a threshold temperature - Automated drainage during freeze risk (if the system supports it) - Alerting to the grower so manual intervention happens if needed
Runaway scheduling.
An automation stuck in a loop, a scheduling bug that fires the same cycle repeatedly, a trigger that fires continuously — any of these can cause irrigation to run far longer than intended. Detection: a flow-totalizer or time-totalizer that alerts when daily water use exceeds a reasonable threshold.
Sensor lies.
A substrate moisture sensor reporting 15% when the substrate is actually saturated causes the irrigation automation to run continuously. Detection: reasonableness checks (does the reading make sense given recent history?), cross-sensor comparison (do multiple sensors in the zone agree?), and periodic manual verification (compare against a handheld probe or a weight-based check).
Network outage during cycle.
Home Assistant loses network connectivity or crashes while an irrigation cycle is running. The valve stays open indefinitely. Mitigation:
- Physical valve timers (hardware backup): each valve has a mechanical timer that closes it after a maximum duration, independent of any software. - Watchdog in Home Assistant: an external watchdog script (or a separate system) detects when Home Assistant is unreachable and closes valves via a separate control path. - Safety timeout in every irrigation automation: the automation closes the valve after a maximum duration regardless of the stop condition.
The layered approach — software safety timeout plus hardware backup timer — is what production irrigation systems use.
A staged irrigation automation.
A practical production-grade irrigation automation combines scheduled logic, sensor input, safety timeouts, and fail-safe verification:
The specific logic looks verbose but reflects what production-grade irrigation actually requires. Start-up pressure verification catches pump and valve failures immediately. Shutdown pressure verification catches stuck valves. Safety timeouts and explicit closings ensure valves never stay open accidentally. Logging produces an audit trail. All of it takes longer to set up than a simple "open, wait, close" automation but prevents the failure modes that cost crops.
Rain and weather-aware irrigation.
Weather integration adds useful awareness.
Rain skip. If significant rain is predicted or has occurred, skip the scheduled cycle. The specific threshold depends on crop and substrate — 0.25" of rain might be enough to skip indoor supplemental irrigation; outdoor field irrigation might skip at higher thresholds.
Cold skip. If temperatures are approaching freezing, skip irrigation to avoid line freezing and frost damage to foliage (water on leaves in freezing conditions).
Heat boost. During very hot days, add an additional irrigation cycle or extend existing cycles. "If peak temperature today is above 95°F, add a 14:00 cycle."
Wind restriction. For overhead irrigation in windy conditions, skip cycles if wind speed exceeds a threshold. The water doesn't reach the target; it just gets wasted.
Weather data comes from a local weather station (most reliable), a government weather service (NOAA, NWS), or a commercial weather service (OpenWeatherMap, others). [Weather Data integration](/home-assistant/integrations/weather) covers the details.
Common irrigation failure modes.
Specific scenarios growers encounter.
The valve that stuck open during the overnight cycle. System runs all night, runoff pours from the zone, neighboring zones get flooded, electric bill spikes from pump running continuously, crop drowns. Fix: pressure verification on cycle end, flow-based runaway detection, hardware timers on each valve as backup.
The substrate moisture sensor that dried out from contact loss. Probe pulled slightly loose during a cart impact, now reads much drier than actual substrate moisture. Automation continuously waters. Fix: reasonableness check against recent history, cross-sensor comparison within zone.
The filter that plugged slowly. Water supply has sediment. Filter gradually plugs over weeks. Pressure drops, irrigation effectiveness decreases, crop shows stress, grower tunes for more water, which masks the underlying problem. Fix: differential pressure monitoring across the filter, with alerts when drop exceeds threshold.
The schedule that didn't adjust for DST. Automation scheduled at 06:00 fires at 07:00 after clock change, which makes the morning cycle late and disrupts the day's rhythm. Home Assistant handles this correctly by default (schedules reference local time, which auto-adjusts), but custom schedules built with hardcoded UTC offsets can miss the change. Fix: use the Home Assistant Time trigger with local time, not UTC.
The automation that fired during a system test. A grower testing a new automation in the afternoon inadvertently triggered the real irrigation. Fix: input_boolean toggles to enable/disable automations, clear testing protocols, separate development vs. production installs for major testing.
The pump that ran dry after a supply line failure. Pump failed because it overheated running without water. Fix: pressure-based dry-run protection on the pump (hardware), supply-tank level monitoring with alerts.
The freeze that broke the headers. Overnight temperatures dropped below freezing, water in lines froze and expanded, headers cracked. In spring, the first irrigation cycle revealed the damage. Fix: freeze-aware shutdown, pre-winter drainage protocol, temperature monitoring with alerts.
The fertigation EC that went wrong. Stock solution ran out mid-cycle. System kept irrigating with decreasing EC, plants got a slug of plain water where they expected fertigation. Fix: stock-level monitoring with alerts, EC verification during cycle, automatic shutdown on EC out-of-range.
The "runoff only" irrigation that went overboard. Runoff sensor was placed in a position that collected water slowly; automation waited for 10% runoff but the sensor took 40 minutes to register. Substrate was saturated long before cycle ended. Fix: runoff sensor placement, combined stop condition (runoff target OR safety timeout).
The weekend that went wrong. Pump failed Saturday morning. No one noticed. Crop wilted through Saturday and Sunday. Monday discovery: dead plants. Fix: remote alerting, daily automated reports that confirm systems ran as expected.
What not to do.
Don't build irrigation automations without hardware safety backup. Every irrigation valve should have an independent safety path — a hardware timer, a flood sensor, a pressure-based interlock. Home Assistant improves operations; hardware handles catastrophic cases.
Don't rely on a single soil moisture sensor for sensor-triggered irrigation. Two or three sensors in a zone, with the automation acting on the average or median, prevents single-sensor failures from producing bad irrigation decisions.
Don't skip the safety timeout. Every irrigation automation needs a maximum-duration safety timeout that fires the valve-close regardless of what else happens. The cost is negligible; the protection is substantial.
Don't assume a command succeeded. Pressure verification, flow verification, or state verification confirms the command actually did what it was supposed to do. Without verification, a failed valve or pump goes unnoticed until symptoms appear.
Don't fertigate without EC monitoring and shutoff. Plain water mistakes are forgiving; fertigation mistakes are fast-acting. EC monitoring is not optional for fertigation systems.
Don't irrigate based on one sensor from a different zone. Each zone's irrigation should trigger from that zone's sensors. A zone A sensor reading does not tell the automation anything reliable about zone B.
Don't forget to schedule review. Irrigation needs change with crop stage, season, and weather. A schedule set up in spring is almost certainly wrong by July.
Don't let fertigation run without record-keeping. Log every cycle with time, duration, flow, EC, pH. The log is both a compliance document and a diagnostic tool.