View on GitHub

Smart Irrigation

A Home Assistant integration to optimize irrigation

Coming from Irrigation Unlimited

Main page: Usage
Previous: Full controller
Next: Troubleshooting

Irrigation Unlimited (IU) is a scheduler and a sequencer of valves with no water model: it does not know the weather, the evapotranspiration or how much water a zone has lost. Smart Irrigation does, and until now the two were joined by two automations written by hand (adjust_time into IU, reset_bucket at the end).

The full controller does the scheduling and the running itself. This page says where each thing you used in IU went. It can also bring your configuration over for you: see Importing your configuration.

The words

In Irrigation Unlimited In Smart Irrigation
Controller (and its master entity) Supply: a pump or a main valve, with a delay before and after that can be negative
Zone Zone, with its linked valve (and, if it needs several, other valves)
Sequence Program
Sequence zone (a step) Step: one zone, or several watered together
Step with zones in parallel A step with several zones, watered at the same time
Delay between steps, including a negative one Wait after this step or the program's wait between steps; a negative value overlaps the steps (up to an hour)
adjust_time (actual, percentage, increase, decrease) The step's duration: calculated (the default), calculated times a percentage, or fixed, with a minimum, a maximum and an offset in seconds (min_seconds, max_seconds, adjust_seconds). For a temporary change of a whole program, smart_irrigation.adjust_program (a percent and/or seconds, for some hours or until reset). You no longer need an automation to hand it the duration, because the calculated one is the default.
reset_bucket or set_bucket after the run Nothing to do: a run of ours credits the water balance itself, for the water that went through
suspend smart_irrigation.suspend, for a zone or a program, for some hours or until a date
manual_run smart_irrigation.water_zone or smart_irrigation.run_program. A manual run joins the queue and takes its turn by default (mode: queue); mode: replace stops what is running first. run_program also takes seconds, a total shared between the steps, and stop_program ends one program.
cancel smart_irrigation.stop_watering
Pause and resume smart_irrigation.pause_watering and resume_watering
Skip to the next step smart_irrigation.next_step
Schedule (time, sun, cron) A program's schedules: time of day or sun (with an offset and a fallback time for polar days), with the days as filters. Cron is not supported as such; the import turns a cron line with a bounded set of times into time schedules.
anchor: start and anchor: finish The schedule's moment is when the program starts, or when it must be done (the start is worked back from the length of the run)
Weekdays, day of the month, even/odd, every_n_days, months, from/to The same filters, on each schedule: days of the week, every N days with a shift, even or odd days, named days of the month (1, 15, last), months, and a period of the year that may span New Year
entity_states Not the same feature. In IU it lets a timed valve receive only the on command, only the off, or neither. We have no such switch. The nearest things are the per-zone safety off mode (auto, zha, off), which can arm a hardware timed off (MQTT topic, or a ZHA command) as a dead-man behind the normal close, and the check while a valve is open. The ZHA timed off is armed automatically for a Sonoff SWV (tested on a real valve, ZHA, firmware 1.0.04: it honours the command and counts the time in seconds); for any other ZHA model it is opt-in (zha mode) because the unit of the time is unverified. A Sonoff SWV in auto mode is now also opened by that timed command, so it never runs without its own timer. See closed loop.
check_back (delay, retries) The zone's Wait for the valve to confirm and Send the open again, in its advanced settings. The wait applies to the open and the close. A valve that closes by itself while it should be open is caught by the check every 60 seconds and is not reopened (see sync_error below)
irrigation_unlimited_start and finish events smart_irrigation_program_started and program_finished
valve_on and valve_off events smart_irrigation_valve_on and valve_off, for zones and supplies
sync_error smart_irrigation_valve_out_of_sync, with a smart_irrigation_zone_problem of reason valve_closed_early: a valve held open that reads closed
switch_error smart_irrigation_zone_problem (a zone valve) and supply_problem (a pump or main valve)

What is different

Importing your configuration

In Settings, General, the card Import from Irrigation Unlimited opens a wizard that reads your IU configuration and turns it into zones, programs, their schedules and supplies. It takes the configuration from where IU has it: your YAML (configuration.yaml and its includes, as Home Assistant loaded it), IU's own settings when it was set up in the interface, or YAML you paste. Pasted YAML is read as text: !include, !secret and !env_var are not followed, and the report says so.

Nothing is changed before you have seen it all:

  1. Zones: each IU zone is matched to one of your zones (by the one you choose, then by its valve, the blueprint that feeds it, or its name) or created. A zone you already have keeps its settings and only gets the fields it had empty.
  2. Programs and supplies: what each IU sequence and controller becomes, step by step. A sequence fed by Smart Irrigation's durations (an adjust-time automation) waters the calculated duration; the others keep IU's fixed times. The automation may adjust the sequence (with its zones) or each zone's own entity (binary_sensor.irrigation_unlimited_c1_z1, …): IU applies a zone's adjustment inside every sequence that waters it, so a step whose zones are all fed that way is calculated too.
  3. The report: what was carried over exactly, what was approximated (a cron expression turned into times, for example) and what has no equivalent here.

The schedules of new programs are created switched off, so IU keeps watering until you are ready to switch over. The wizard says so differently when IU is not running, for instance because Home Assistant rejected its configuration: nothing waters then until you switch the schedules on.

Switching the full controller on, which the programs need, also starts the main program: the start trigger runs it every day over every zone. Next to IU, and after the switch next to the imported programs, those zones would be watered twice. The import page names them while that is so; if the imported programs water everything, switch the main program off under Programs, or set the start trigger to None. Importing again later updates what the earlier import made, in place, and removes what IU no longer has; the wizard asks before it removes anything. Only an administrator can import.

Switching over

At the top of the import page, once something is imported:

After the switch, importing again keeps the on or off you gave each schedule, and a schedule new to the import comes with IU's own on and off, since IU no longer waters.

What the import does not carry over

By hand

If you would rather rebuild than import:

  1. Switch on the full controller.
  2. Add your pump or main valve as a supply, and pick it in each zone.
  3. Make a program per IU sequence: its steps are the sequence's zones, in order. Leave the duration on calculated.
  4. Add a schedule to each. If IU ran it to finish at sunrise, take Sunrise, must be done.
  5. Switch IU's own schedules off, and remove the two automations that handed it durations and reset the water balance.
  6. Look at the Planning card: it shows the next three days. Compare it with what IU would have done before you remove IU.

Previous: Full controller

Not in Smart Irrigation

Not in Irrigation Unlimited