Garden Irrigation

all good :grinning:

1 Like

@phdelodder Was wondering if you could share your setup with the weather stuff removed? As I am trying to do the same. I’ve tried to remove it and the configs pass but just doesn’t seem to look/function like it should.

@one-love you can find my config here:

@phdelodder thank you, definitely helps out.

So finally got @klogg irrigation package with all the weather code bits stripped and works well. I’m using for irrigation inside a greenhouse with 8 zones so I had to add the extra zones which is extremely simple using the /packages, many thanks to @klogg and everyone here. I can post the updated /package if someone wants.

1 Like

it would be helpful thanks

@gojonny here you go,

something weird’s going on. irrigation was working fine for the last weeks. every second day at 5:00 it turned on and ran the cycle.
today my wife noticed that some of the flowers let their head hang down, and i checked the irrigation status.


no matter what i do, it won’t change “next run” from july-14th (which is some days in the past).

1 Like

I can’t think of any reason for this…
If it has been working until now there seems no reason for it to suddenly stop. I used a daily schedule for two weeks in June while we were away and since then have only run it manually on demand. I just turned on a schedule to check and it set the date correctly here and the last irrigation date is also correct.

The only thing I can think of is that your system date and time are somehow out. The code that sets next run time is relatively simple and is based entirely on now().

Also I can’t remember if I posted my code with the irrigation master control switch included or if I added that later but if you have it, check it is on. I have fallen for that mistake myself.

thanks for the hint. i checked automation and found this


after is turned both ON again, time schedule was updated again. NO idea why they have been turned off?!

all fine again. thanks!

Glad you fixed it.
When the similar thing happened to me I was surprised to see it turned off too!

@klogg: could you please tell me what this sensor is for?

  # History sensors
  # Zone Times

  - platform: history_stats
    name: zone1_time
    entity_id: switch.zone1_valve
    state: 'on'
    type: time
    start: '{{ now().replace(hour=0).replace(minute=0).replace(second=0) }}'
    end: '{{ now() }}'

i guess it is to show a history graph with the time when the zone1_valve was activated?!
but i don’t get the syntax behind it. i personally would like to see the irrigation slot of the last week or something like that. how can this be done?

i have another issue. this time with weather based adjustment. only zone1 is affected.
it’s always set to ZERO. any idea where this could come from?



The template sensors give the time in minutes that each zone has been watered today.

It takes a start time of now than replaces it to be 00:00:00.
To be honest I think I found this syntax somewhere :slight_smile:

I don’t actually use the weather adjustment but I do sometimes play with it to see what effect it gives. I have never had one zone not adjusted and as far as I can remember it should be impossible because it is the same code that cycles through zones.

I can only think that maybe you have a typo in your code somewhere that you possibly introduced when making any changes. Have you changed the names of the zones or anything like that?

I’ve modified @klogg weather calculation a bit using own weather station.
Forecast provided by darksky, history is real, given by sensors.
So far I have fully implemented rain sensor and precipitation sensor, on the same principle will be temperature.
For temperature I need to reconfigure sensor first :slight_smile:

Here is a snippet of rain history data changed part:

  # Cycle the rainfall figures
  - service: input_number.set_value
      entity_id: input_number.rain_minus3
      value: >
        {{ states('input_number.rain_minus2') }}
  - service: input_number.set_value
      entity_id: input_number.rain_minus2
      value: >
        {{ states('input_number.rain_minus1') }}
  - service: input_number.set_value
      entity_id: input_number.rain_minus1
      value: >
        {{ states('input_number.24_hrs_precipitation_mm') }}

There is changed {{ states('input_number.rain_minus0') }}
by {{states('input_number.24_hrs_precipitation_mm') }}

In addition I’ve inserted one service into script


  # Adjust if it rains
  - service: input_number.set_value
      entity_id: input_number.adjusted_cycle{{ cycle }}_zone{{ zone }}_duration
      value: >
        {% set duration = states('input_select.cycle' + cycle + '_zone' + zone + '_duration') %}
        {% set adj_duration = states('input_number.adjusted_cycle' + cycle + '_zone' + zone + '_duration') %}
          {{ (float(adj_duration) - float(duration) * float(states.input_number.rain_3days_ratio.state)) | int * (states.sensor.rain_1.state) | int }}       

It simply set zone duration to 0 it it rains od if it rained recently.

@kajmaj: what rain sensor hardware do you use? could you please provide a link or something? thank

I did not buy it on Aliexpress, but it is the same kit: Weather sensors kit
In addition Rain sensor
So far I am using Precipitation sensor and Anemomether from the kit and Rain sensor.

a. Rain sensor is simple switch On/Off - rain/no rain
b. Precipitation sensor measures rain volume (provides pulses per mm to square meter).
c. Amemometer measures windspeed (provides pulses)
All of them are connected to WemosMini with Sonoff-Tasmota firmware

If it rains (a) - no irrigation, it has certain adjustable permanency, depending on temperature, humidity and level of rain (simply it must dry off to be “no rain” again)

Rain level(b) is used for history data - wemos provides number of pulses continuously(if any) whole day, and number od pulses is deleted daily before midnight

Windspeed © over preset limit postpones irrigation start for preset interval (I have one hour), number of pulses is provided in adjusted Telemetry period.

All calculations are done by HomeAssistant.

hi @petr .
i just copy your lovely Irrigation water system.
this is amazing any very useful for me.
but when i clone the setting 4 time for 4 relay , its seems that is ignore my setting and use repeat like what he wants.
example : i have a grass watering that should run in 72Hrs repeat …but he always use 48Hrs…
hope you can help me.

(OT) @sparkydave you’re a Perthian right? Since moving away I’ve discovered “reticulation” isn’t used much at all outside of Perth, haha. I’ve got some funny looks.