ZoneFlow – rain and temperature aware irrigation integration (soil moisture, ET, shared pumps, HACS)

I ended up writing (with a good amount of help from AI) a custom Home Assistant integration for my irrigation, because the blueprints and automations I tried were either too basic (a binary “skip if raining” switch) or a huge wall of YAML that was a pain to maintain.

The main goal is to react to local weather automatically and keep the hardware safe. It started on a single avocado tree and now runs multiple zones with different plants and different sensors.

What it does

  • Subtracts real rainfall. Reads a tipping-bucket rain gauge and subtracts the rain that actually fell from the watering target, instead of just cancelling the cycle. It also holds off for a few days after heavy rain, and stops a cycle if rain starts mid-run.
  • Scales with temperature. Hot spells get more water and more often, cool spells less. At setup you pick your climate (tropical, hot summers, temperate or cool summers) and the thresholds are pre-filled for you. With no temperature sensor, a manual slider lets you tell it “heat wave” or “cold spell”.
  • ET-based watering (optional). A zone can follow a Hargreaves evapotranspiration curve (from temperature, your latitude and the season) times a per-crop factor, instead of the hot/normal/cool tiers.
  • Soil-moisture probe (optional). Dry soil waters early, wet soil skips, and in between the schedule decides. It doesn’t trust a probe blindly: impossible or frozen readings are ignored, and it alerts you if wet readings hold watering back for too long.
  • Two schedules per zone. A light routine watering plus an occasional deep soak, each on its own schedule (fixed time, or relative to sunrise or sunset).
  • Plant-aware. An optional growth ramp gives young plants less water, and an optional deficit mode applies controlled water stress for crops that gain flavour from it (chilis, tomatoes, grapes…). Deficit mode has guardrails for heat, young plants and dry soil.
  • Forecast hold. Delays watering if rain is forecast, with an override so plants don’t dry out when the forecast keeps being wrong.
  • Shared pumps. Give zones on the same pump the same pump ID and they take turns automatically, with no helper automations.
  • Safety first. Per-cycle and daily runtime caps, stuck-valve force-off, a pump power check on every pulse, no-flow detection with a flow meter, and power-loss handling. If HA restarts, shuts down or reloads mid-run, the valve always ends up closed and confirmed.

What you need

Only a valve switch. Everything else is optional and adds one capability: rain gauge, temperature sensor, soil probe, pump power sensor, flow meter, weather entity and a notify target. Each zone can use a different mix. If a sensor dies later, only that feature degrades and the zone keeps working.

Everything shows up as normal entities (number, sensor, switch, select, button), so you adjust it from the dashboard with no YAML. Units follow your HA settings, metric or imperial.

AI-assisted setup

The repo includes a setup guide written for an AI assistant. Paste it (or its link) into Claude, ChatGPT or similar and it will:

  • ask how many zones you have, what you’re growing and where, which sensors each zone has, and which zones share a pump;
  • research your crop and suggest numbers with its reasoning;
  • configure everything, either by itself if it has HA access or by telling you what to click;
  • run a test pulse before it’s done.

Install

HACS → Custom repositories → add https://github.com/Dreamer41/ha-smart-irrigation as Integration → download → restart → Add Integration → ZoneFlow Irrigation.

GitHub: GitHub - Dreamer41/ha-smart-irrigation: Smart Irrigation For HA · GitHub (current version 1.4.2, MIT)

There’s also a Docker sandbox in the repo with simulated valves, rain, temperature and soil probes if you want to try it before connecting a real valve. It’s backed by a test suite of 350+ tests.

Feedback and bug reports are very welcome.