Agricultural patterns · Home Assistant

Fertigation Systems.

Reading time
~17 min · 3,489 words
FAQ
0 questions
Status
Draft 1 · under review
Section
All Home Assistant pages

Fertigation — the delivery of fertilizer through the irrigation system — is one of the highest-stakes operations Home Assistant can participate in. The wrong nutrient concentration damages the crop quickly; the wrong pH renders otherwise-correct nutrients unavailable; an injection pump that does not shut off adds too much of one thing; a probe that has drifted reports incorrect values while everything "looks" fine. Home Assistant's role in fertigation is specific and bounded: it monitors the inputs and outputs, logs what happened, alerts on conditions that matter, and coordinates schedules. It does not replace the mechanical safety systems that prevent catastrophic failures, and it does not replace the grower's judgment on what recipes to run for which crops at which stages. What Home Assistant adds — and it is substantial — is continuous visibility into EC and pH, recipe-based automation that keeps schedules consistent, historical data that reveals drift, and alerts that surface problems while they can still be fixed. This page covers the physical fertigation layer, the control and monitoring patterns, calibration discipline for EC and pH probes, recipe management, safety interlocks, integration with broader climate and irrigation control, and the specific failure modes that separate working fertigation from damaged crops. The voice here is deliberately specific because fertigation is where generic guidance produces generic disasters; details matter.

Before automating fertigation.

Prerequisites and the safety framing that everything else builds on.

The mechanical safety layer exists and works. Hardware float switches on tanks that shut off refill pumps when tanks are full or empty. Physical low-flow interlocks that prevent injection without flow. Pressure-relief valves where pressurized systems could rupture. Manual shutoff valves accessible in emergencies. These are not Home Assistant's job; they are the hardware's job. Home Assistant monitors them and respects them; it does not substitute for them.

The grower understands the recipe they are running. Fertigation recipes — nutrient balance, concentrations, pH target, EC target — are crop-specific and stage-specific. A recipe appropriate for vegetative lettuce is wrong for flowering tomatoes. Before automating anything, the grower has a recipe that works for the specific crop at the specific stage, verified through prior production experience or reputable guidance.

EC and pH probes are present and calibrated. Automation driven by EC/pH readings is only as reliable as the readings. An uncalibrated probe produces confident-looking numbers that are not correct. See the calibration section below; calibration is not optional.

A clear distinction between monitoring and control. Early deployments should monitor — record EC, pH, flow, tank levels, and report these to Home Assistant. Alerts on excursions. No automated control of injection yet. Once the monitoring layer is trusted, specific control actions can be added. Jumping straight to automated injection control without first understanding how the system behaves under monitoring is how fertigation automations go wrong.

Backup and rollback discipline applied. Changes to fertigation automations can have real crop consequences. Back up before significant changes; test on a bench setup where possible; be able to revert quickly.

The physical fertigation layer.

The hardware Home Assistant connects to.

Stock tanks (typically A/B). Concentrated fertilizer is typically kept in two tanks — an "A" tank containing calcium-containing salts and an "N" tank (often called "B") with the phosphates and other components that would precipitate with calcium. Keeping them separate in concentrated form prevents precipitation; they combine safely after dilution at injection.

Acid or base tank. pH adjustment typically uses acid (phosphoric, nitric, or sulfuric commonly) or occasionally base (potassium hydroxide, for high-pH water). Separate from the stock tanks; injected independently.

Injectors. Equipment that draws stock solution from the tanks and introduces it into the irrigation line. Dosing pumps (positive-displacement pumps injecting at a measured rate), Venturi injectors (using water flow to create suction through a venturi), and commercial fertilizer injection systems all serve this role. Positive displacement is more precise; Venturi is simpler; commercial systems often combine both.

Flow meters. Measure water flow through the irrigation line. Essential for most fertigation control — proportional injection matches dose to flow, and the flow reading confirms water is actually moving.

EC sensor. Measures electrical conductivity of the irrigation water after injection, giving a real-time read on nutrient concentration. Target EC ranges depend on crop and stage (commonly 1.0-3.0 mS/cm for most crops; higher for fruiting tomatoes; lower for seedlings).

pH sensor. Measures pH of the irrigation water after injection. Target pH depends on crop but for most is 5.5-6.5 (soil/substrate dependent).

Runoff sensors (optional but valuable). EC and pH in the substrate runoff reveal how the plants are actually experiencing the fertigation versus what is being delivered. Elevated runoff EC may indicate nutrient buildup; shifted runoff pH indicates plant uptake patterns.

Tank level sensors. Report how much stock solution remains. Essential for alert on low tank before runout.

The graybox-compatible approach. Each of these connects to Home Assistant through the appropriate integration — ESPHome for custom-built sensing, Modbus for commercial equipment that supports it, 4-20 mA interfaces for industrial sensors (through an appropriate ESP or PLC), MQTT for anything using that standard. For operations with older commercial equipment, integration may require custom work; newer equipment often has Home Assistant integration paths documented.

Control patterns.

How Home Assistant participates in fertigation control.

Recipe-based control. A recipe is a set of target values — EC target, pH target, A/N injection ratios, irrigation volume per event. An input_select or similar allows the grower to pick the active recipe; automations apply the corresponding targets. Recipe transitions (changing from vegetative to flowering recipes, for example) change the targets that automations reference.

Proportional injection. The common pattern: injection rate scales with water flow rate, keeping the resulting concentration constant regardless of flow variation. Home Assistant calculates the required injection rate from the flow meter reading and the target EC, then commands the injection pumps accordingly.

Feedback control on EC and pH. For systems with precise enough injection and sensing, a feedback loop adjusts injection rates to maintain target EC and pH. The EC sensor reading drives pump rate adjustments; similarly for pH. This is more sophisticated than proportional injection and more demanding on sensor reliability.

Demand-based fertigation. Irrigation events driven by substrate moisture (as in the Irrigation Control patterns) can include fertigation on some events and clear water on others. The balance depends on leach fraction, substrate characteristics, and the operation's nutrient management strategy.

Stage-based recipe transitions. As the crop moves through growth stages, the recipe changes. Some operations handle this manually (grower switches recipe selector when transitioning); some handle it through automation (a schedule tied to days-since-planting triggers the transition). Automated transitions need human review; a transition that fires on the wrong day produces wrong-recipe fertigation.

What stays out of automation. The decision of what recipe to run. Setting target EC and pH values. Choosing when to start a new crop cycle. These are grower decisions, informed by the operation's experience. Home Assistant executes the recipe; the grower designs it.

Monitoring patterns.

What Home Assistant watches in a fertigation system.

Continuous EC logging. EC readings every 30 seconds to a minute, logged to InfluxDB for long-term trending. Dashboards show current EC, recent EC trend, and comparison to target. Alerts fire on sustained deviation.

Continuous pH logging. Same pattern as EC. pH is often more volatile than EC (probes drift more readily, injection response time differs); alerts should be tuned to tolerate normal variation without firing on noise.

Flow totalization. Cumulative water delivered per zone per day, per week, per crop cycle. Compared to irrigation set points, reveals whether the planned volume actually delivered.

Nutrient use totalization. Cumulative injection by tank per day, per week, per crop cycle. Reveals nutrient consumption patterns; flags drift (stock tank emptying faster than expected suggests higher injection rate than planned or leakage).

Tank level trends. Stock tanks deplete predictably with use. Unusual depletion rate is a signal — a leak, a pump stuck on, or an unexpected usage pattern.

Probe drift monitoring. EC and pH probes drift over time; comparing readings to calibration checks (manual verification against calibration solutions) reveals drift. Scheduled calibration and logging of pre-calibration versus post-calibration readings tracks drift rate.

Cross-checking with runoff measurements. If runoff EC/pH is monitored, compare input to runoff. Large differences reveal plant uptake patterns; sudden changes may indicate problems (root zone issues, substrate problems).

Calibration discipline.

The practice that keeps EC and pH readings meaningful.

Why calibration matters. Both EC and pH probes drift. Coatings, damage, normal aging, and use all shift the probe's response. An uncalibrated probe produces readings that are systematically wrong. Acting on systematically wrong readings is acting on bad data.

Calibration solutions. Standard reference solutions for EC (commonly 1.41 mS/cm and 2.77 mS/cm or similar) and for pH (commonly 4.0, 7.0, and 10.0). Check expiration dates; solutions go bad over time.

pH calibration. Typically a two-point or three-point calibration. Rinse the probe, immerse in the first buffer (often pH 7), let it stabilize, note the reading. Rinse, immerse in second buffer (pH 4 for acidic range). Some systems handle calibration through a built-in procedure; others require manual adjustment of offset and slope values.

EC calibration. Typically one or two-point. Rinse, immerse in the reference solution, let it stabilize, note the reading. Adjust if needed to match the known value.

Calibration frequency. Weekly for high-stakes operations; bi-weekly for typical operations; monthly at minimum. Probes in continuous service drift faster than probes in occasional service. Logging calibration dates and pre-/post-calibration readings reveals each probe's drift rate and informs the right frequency for your specific probes.

Calibration recording. Each calibration event should produce a log entry — when, which probe, the reference solution used, the reading before and after calibration. Over time, this history reveals drift rates, probe health, and when replacement is due.

Replacement thresholds. Probes that drift quickly or that cannot be brought into calibration are at end of life. Better to replace a failing probe proactively than to discover its failure through a crop problem.

Manual checks during critical operations. Between formal calibrations, a quick check — dip the probe in a reference solution, compare to the known value — catches major drift. For operations where fertigation accuracy directly affects revenue, a daily quick check is cheap insurance.

Safety interlocks.

The specific layer where software meets physical safety.

Hardware comes first. Float switches, pressure relief, mechanical flow switches — these are the primary safety. They operate regardless of what Home Assistant is doing. Home Assistant monitors them; it does not replace them.

The injection-with-no-flow interlock. Injection should not happen without water flow. Hardware flow switches that disable the injection pump when flow stops are the primary defense. Home Assistant duplicates this at the software level — automations check flow before commanding injection, and verify flow during injection events.

The EC-ceiling interlock. Injection should stop if EC exceeds a safety ceiling well above normal operating range. Hardware-level over-EC interlocks are rare; software-level is common — a Home Assistant automation that pauses injection if EC exceeds 1.5x target for more than a few minutes. The ceiling should be well above normal variation so the interlock only triggers on real problems.

The pH-boundary interlock. Similarly for pH. If pH falls below or rises above operational boundaries, injection pauses. pH excursions can indicate probe failure (the pH reported may not match reality); investigating before continuing injection is appropriate.

The tank-empty protection. A stock tank running dry during injection produces injection of air — useless at best, damaging to pumps at worst. Tank level sensors with a "low" threshold that pause injection before runout are essential.

The broad-automation-pause switch. An input_boolean the grower can toggle to "maintenance" or "manual" mode. When active, automated injection is suspended. Useful during calibration, cleaning, recipe changes, and emergencies.

The alert-before-action pattern. For ambiguous conditions (EC slightly off, pH drifting), alert first, then escalate to action if the condition persists or worsens. Immediate action on borderline signals produces oscillation and false-positive shutdowns.

Recipe management.

How recipes live in Home Assistant.

The recipe store. A set of inputnumber helpers (one per parameter) represents the active recipe. An inputselect allows the grower to switch between named recipes; automations listen to the inputselect and update the inputnumbers to match.

Crop-and-stage specific recipes. A recipe per crop per stage. "Lettuce, vegetative." "Tomato, flowering." "Pepper, fruiting." The selector organizes these; switching the crop and stage changes the whole set of targets.

Named transitions. A recipe switch is an event; the event should be logged, ideally with a brief note about why (planned stage transition, adjustment in response to observed conditions, etc.). The log supports later review of whether recipe changes correlated with observed effects.

Gradual transitions. A sudden recipe change (from EC 1.2 to EC 2.0 in one irrigation event) can stress plants. Recipe transitions over several events are more natural. Automations that gradually shift targets between recipes over a few days produce smoother stage transitions.

Exception handling. Sometimes the grower wants to run an exception — flush with plain water, run a specific adjustment, apply a micronutrient supplement. A "one-shot" recipe or a manual override pattern handles this without disturbing the standard recipe. The override should have explicit start and end; a manual override that stays active indefinitely is a bug.

Documenting recipes. Recipe YAML (or the structured helpers) should be documented — comments or external documentation explaining what each recipe is for, where it came from, and when it was last reviewed. Operations evolve; recipes that worked two years ago may not be optimal now.

Integration with irrigation and climate.

Fertigation does not happen in isolation.

Fertigation triggered by irrigation. The common pattern: irrigation events (triggered by moisture, schedule, or manual) include fertigation when the recipe specifies it. The irrigation controls water flow; fertigation injection happens alongside. Home Assistant coordinates the two.

Leach fraction control. Some crop stages benefit from specific leach fractions — the proportion of applied water that drains through the substrate. Leach fraction affects nutrient concentration in the root zone; too low causes buildup, too high wastes nutrients. Flow meters at input and runoff measurement give the actual leach fraction; automations can adjust irrigation volume based on target.

Climate-responsive fertigation. High VPD days drive more transpiration and more water uptake. Fertigation on high-VPD days may use slightly lower EC (the plants are moving more water through their tissue; concentration at the root zone can rise even with normal input EC). Climate-aware recipe adjustments are advanced but can meaningfully improve plant health.

Lighting-responsive fertigation. For operations using supplemental lighting, DLI drives photosynthesis, which drives nutrient uptake. High-DLI days may benefit from slightly higher EC; low-DLI days may benefit from lower EC. As with climate integration, this is advanced but meaningful for high-value crops.

Temperature-responsive acid. Cooler water holds more dissolved CO2, lowering pH. Warmer water holds less; pH rises. Large temperature shifts can require pH adjustment changes. For operations with significant water temperature variation (seasonal, time-of-day), temperature-aware pH adjustment produces more consistent delivered pH.

Common failure modes.

Specific fertigation problems from real deployments.

The probe that drifted and the grower did not know. An EC probe slowly drifted low. Home Assistant showed readings that were within target range; actual EC at the root zone was elevated. The crop showed nutrient burn before anyone realized the readings were wrong. Fix: regular calibration; cross-check readings against reference solutions; track pre-/post-calibration drift to know each probe's typical rate.

The injection that kept running. A dosing pump stuck on, continuing to inject after irrigation ended. The closed irrigation line accumulated high-concentration solution; the next irrigation event delivered a dangerous slug to the plants. Fix: hardware interlock that disables injection without flow; software cross-check that flags extended injection during non-irrigation periods.

The tank that ran dry during injection. Stock tank emptied during a long irrigation event; the injection pump drew air; irrigation continued without fertilization. Plants received plain water for the rest of the event; no alert fired because the injection pump was still "on." Fix: tank level sensors with adequate low-threshold alerts; recipe-level awareness of expected nutrient consumption to flag mismatches.

The recipe transition at the wrong time. An automated stage transition fired based on days-since-planting, but the specific crop was behind schedule; the recipe changed too early and stressed plants that were not ready for the new nutrient profile. Fix: human review of automated transitions; growth-stage indicators (visual or sensor-based) that confirm the transition is appropriate; manual override when transitions do not match reality.

The pH probe that failed slowly. Glass-membrane pH probes degrade over time; readings become sluggish and eventually unreliable. The probe reported plausible-looking values that were systematically off. Fix: probe age tracking; periodic reference-solution verification; replacement when drift or response time exceeds thresholds.

The cross-contamination between A and N tanks. A plumbing mistake allowed A and N stock solutions to mix in a shared line. Precipitate formed; injection clogged; manual intervention required. Fix: strict plumbing discipline (separate lines until injection point); regular inspection for crystalline buildup; inline filtration that catches precipitate before it reaches injection nozzles.

The EC ceiling that caught a calibration issue. The EC readings started rising unexpectedly. The software EC-ceiling interlock paused injection. Investigation revealed the probe was dirty, reporting falsely high EC. The ceiling caught the problem before injection was reduced to below-target levels. Fix: the design worked; the ceiling fired as intended; the resolution was probe cleaning and recalibration rather than adjusting the ceiling.

The manual override that was forgotten. A "maintenance mode" override was activated for probe calibration; the grower did calibration and left; the override stayed on; scheduled fertigation events did not run. Several days of plain-water irrigation before anyone noticed. Fix: override patterns with automatic expiration; alerts when critical automations are disabled; documented procedures for maintenance that include re-enabling.

The acid tank that ran to low pH. The acid injection pump stuck on briefly, dumping excess acid into the line. A shipment of plants received irrigation at pH 4.2 before the condition was detected. Fix: pH floor interlock that pauses injection below a safety threshold; flow-proportional injection that makes short stuck-on events bounded in impact; redundant pH sensing (two probes, cross-checked).

The runoff EC that rose without any input change. Input EC stayed constant; substrate runoff EC climbed. Not a fertigation control issue per se — a root zone issue (salt accumulation from insufficient leach). Revealed through runoff monitoring; addressed with a flush event. Fix: runoff monitoring as a routine part of fertigation; protocols for responding to runoff excursions; awareness that input control alone does not guarantee root zone health.

What not to do.

Patterns to avoid.

Don't rely only on software interlocks for safety. Hardware first, software second. A flow switch that mechanically disables injection when there is no flow is primary; the software interlock is secondary.

Don't skip calibration. Uncalibrated probes produce wrong readings. Acting on wrong readings produces wrong outcomes. Calibration is the routine practice that makes the entire monitoring layer meaningful.

Don't automate recipe transitions without review. Crop development varies; automated transitions on a calendar can be wrong. Human review of transitions matches the automation to actual crop status.

Don't mix A and N stock solutions. The whole reason for separate tanks is keeping incompatible salts apart at concentration. Plumbing that allows cross-contamination is a failure mode waiting to happen.

Don't run without tank level monitoring. Stock tanks that run dry during injection produce poor outcomes. Alerts before runout prevent the failure.

Don't skimp on probes for critical operations. Industrial-grade EC and pH probes cost more than consumer probes. For fertigation where probe accuracy affects crop value, the cost difference is justified. Cheap probes drift faster, fail more, and produce worse data.

Don't ignore runoff. Input monitoring alone does not tell the full story. Runoff EC and pH reveal what the plants actually experience. For operations where fertigation is serious, runoff monitoring is worth the investment.

Don't leave manual overrides active. Overrides should be temporary with explicit end conditions. An override that persists beyond its intended purpose is the cause of surprising non-events.

Don't treat fertigation automation as set-and-forget. The operation evolves; the crop evolves; probes drift; equipment wears. Regular review — weekly or at least monthly — of fertigation performance catches drift before it becomes a problem.