I have built a custom component that builds on the work of others (specifically @hhaim) to precisely control my lawn/garden irrigation. It is available through HACS (Smart Irrigation) and here: GitHub - jeroenterheerdt/HAsmartirrigation: Smart Irrigation custom component for Home Assistant.
There is a lot to this, but the gist of it is: the integration calculates evapotranspiration (evaporation) of moisture and compares it with any rain- and snowfall. Then, if the moisture evaporated is higher than the precipitation (rain+snow) the integration calculates the number of seconds the irrigation needs to run to bring the balance back to zero (no moisture lost). If the net value is lower (more moisture added through precipitation than has evaporated) irrigation is not required and the net value is carried over to the next day (to account for the situation of heavy rain followed by hot, dry days - you donāt need to water right away then).
Note that the integration does not control your irrigation. The reason for this is I wanted to keep maximum flexibility in hardware choice and integration with other solutions. The integration does all the calculations, but the user is expected to build the automation using the adjusted run time the integration provides. Also, after any irrigation is done the automation is expected to notify the integration irrigation was completed so the net value can be reset to 0.

Version 2.0 is here! Most notably there is a panel now which allows you to configure zones, calculation modules and sensor groups.

cool idea and great work I will definitely make use of it ā¦

3 things I canāt figure out ā¦

do you use expected or actual/real precipitation ?

from where do you get proper GPS cords for OpenWeather ? from location of HA set in HA UI or ? (btw: do you know by chance how to check where is located weather station used by OpenWeather for specific location ? just trying to figure out how precise and from how far from my location precipitation data are used )

I do have 8 zones in my system (5 sprinklerās based and 3 drip lines) I decided to skip drip lines (as i will set fixed time for them in my automation) and focused only on zones with sprinklers. Each line can be represented by one sprinkler in your component (that is fine). I measured real water consumption of each line and got average of 30 l / min per line, so in total it is 150 l / min if all lines would run simultaneously.
so now ā¦ letās say that component will calculate that i should irrigate 10 min today. Should I set in automation 10 min for each sprinklerās line or 10/5=2min per each line ? my systems have to irrigate one zone after another, never simultaneously.

Hi @CiechomPL - thanks for testing!. Answers to your questions:

I use the expected precipitation from Open Weather Map. I am considering also adding in support for another sensor to provide the actual precipitation in case OWM is not specific enough. In my case it is, but is it for you?

I read it from the HA general settings, together with elevation and imperial/metric system.

Ah, interesting use case. I have just one zone, so never thought of this. The calculations I do are for the whole system, all of the zones. So basically, if you have a total throughput of 150 l / minute for all zones (either by setting number_of_sprinklers=1 and flow=150 or number_of_sprinklers=5 and flow=30 or whatever as long as you end up with number_of_sprinklers*flow=150) and the system says it needs to irrigate for 10 minutes, you should see that as 10 minutes for the whole system - all lines at once. If that is not possible, then for 10 minutes for each of the lines. I think. Because the calculation is based on the precipitation_rate which calculates how many mm of moisture the system adds per minute across the whole area (m2). See readme for the details on the calculations. Also, of course use your common sense - does running each line 10 minute seem excessive to you and is 10 minutes in total (2 minutes per line) more what you normally would do?

Thanks for joining in, letās figure this out together.

hmm ok ā¦ so if component takes whole irrigation system into account (one big zone and one big bucket to be filled in by water), that means that - in my/above case - entire lawn should get 10 min * 150 l/min = 1500 l of water in total.

So if I understand correctly, each line should run for full 10 min separately as this gives us 10 min * 5 lines * 30 l/min/line = 1500 l of water provided in total.
If we would run each line for 10/5=2 min each, we would provide only 2 min * 30 l/min/line * 5 lines = 300 l in total
Is this logic correct ?

one more thing came to my mind
you say that you use expected precipitation but do you count/use entire rainfall from the whole day for a final calc of daily_adjusted_run_time ? or it is also based on expected precipitation only ?

I think it perfectly make sense to use expected precipitation for hourly_adjusted_run_time just to show/visualise what is expected to happen = how long user may expect that irrigation will run today (more or less) ā¦ but at the end ot the current day, total sum of all real precipitations during a day is already known and you could use is for final daily_adjusted_run_time calculation.

Or even better you can use both ā¦ in result:

if today we had a tiny shower not even forecasted and tomorrow no rain expected we adjust irrigation time only a little

if today we had a tiny shower or nothing but tomorrow is expected to be a heavy rain we do not even start irrigation as weather will do the job
etc. ā¦ few more conditional IFs
By doing this you eliminate mistakes in forecasts and your component will be even truly precise.

Not sure how it works in your location but at least here in Poland we start irrigation early in the morning ā¦ usually it is around 3 am. So if your component will calculate daily_adjusted_run_time at 11pm without taking into account forecast for next day we might run irrigation unnecessarily ā¦ same for current day āexpectedā precipitation ā¦ very often they are ānot accurateā ā¦ gently speaking

What it currently does: the hourly is just a tracker to see what is happening, as you described. The daily adjusted run time is just a final update at 23:00 hours, so you can plan to water early in the morning, to compensate for yesterdays net loss of moisture, assuming it is < 0.
both daily and hourly adjusted run time look at the same data, the one is just done only once a day, and the other is done during the day to show process and what is expected to the user. You should see daily to match up at 23:00 hours with whatever the hourly is at that point. Hourly is on a day level by the way, it is just updated every hour. hope that makes sense.

And there is no risk for running irrigation without need, since even if the next day is raining, it will just compensate for what has already been lost, it is not predicting the future or whatever. if it rains for 3 days afterwards, it will not irrigate until enough moisture has been lost so compensation is required again.

the data you shared matches up: the adjusted run time is 291 seconds, which is close to 5 minutes. You should run your entire system for 5 minutes (or each zone for 5 minutes) as your precipitation rate is 18 mm / hour across the whole area of 500 m2. You BSI is 720 seconds. You have lost 1.45 mm across the whole area. You water budget is approx 40% (net loss / peak which is 3.6), so your adjusted run time is 40% of BSI = approx 291 seconds = 4.8 minutes.

Now in liters, assuming your througput of lpm is correct, you are adding: 726 liters to your lawn, which feels like a lot to me, but not sure. how long do you normally water on a day like this? does adding 726 liters or watering the whole system for approx 5 minutes feel long to you?

alsoā¦ a flow of 30 liters a minute per sprinkler is massive! normal residential sprinklers are around 1.5 to 17 liters per minute, so you have almost double that. are you using industrial material??

Iāve made a measurement by sitting in front of my water meter and been running each zone for 2 min, than I divide result by 2 ā¦ just to eliminate mistakes or time for filling up pipes with water.
As I did it separately for each zone (8 times :)) I think there is no mistake but you just motivated me to repeat measurements tomorrow maybe I misses one zero or something :).
Each zone consist of min 4 rainbird sprinklers (cantāt recall precise model but will check it tomorrow)

ah, that is good news, since rainbird has a spec for each model that will tell you precisely how much water can flow through it, depending on the nozzle and your water pressure. I have rainbirds as well. Just look up the model on their website and the table should be there. plug that value in and youāre good.

As long as running the whole system for 5 minutes, or each zone for 5 minutes feels good to you then youāre good to go. itās just that the 30 liters kind of puzzles me, but it might be correct.

@jeroenterheerdt As far as i understood your system is meant to irrigate EVERY day to compensate for evaporation losses during the day. This will ensure a total mass of water per day that will be the same for every day. Be it rain/snow or tap water.

BUT isnāt it best practise to NOT run the sprinkler EVERY day but only twice or three times week so roots will go deeper into the soil and therefore survive hotter days better?

At least this i how i learnt it, and how iād like to keep it.

What do you think?

Another point: I have mixed sprinklers in my circuits. Smaller ones, bigger ones, different throw etc ā¦ This is to compensate for areas needing more water than others (more sun, less shadow ā¦) . BUT I know the amount of water per minute for the whole circuit watching the water meter. Iād prefer being able to enter values per circuit. Could this be done by setting the # of sprinklers to ONE?

Yes, it would be nice to, in addition to precipitation, use an actual system sensor; for instance i have a davis vantage pro2 weatherstation connected to HA; this has sensors for hourly / daily rainā¦

Support for multiple regions / zones would help; we have 2 zones; frontyard and backyard. These are switched separately, so we cannot activate both at the same time due to waterpressure.

Strange reaction: why shouldnāt this be possible? we need 2 run-times, one for each zone. We can activate each zone using 2 automations running for the time smart irrigation gives us.

No. What i was saying was, that it will never work for anybody to open all valves at the same time. Of Course you have to run them one after the other.