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.
See tutorial videos on Youtube.
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
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 ?
well. wait a second here. can you provide a screenshot of your
sensor.smart_irrigation_hourly_adjusted_run_time? similar to this: https://raw.githubusercontent.com/jeroenterheerdt/HAsmartirrigation/master/images/bsi_entity.png?
You can do the math in Excel easily, but happy to do it for you.
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??
no that is quite normal for me at least this is what I set manually on my rainbird
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.
It would be great to use a local weather station with a rainfall sensor like Netatmo
@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…
Nice work Jeroen!
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.
Of course this will never work. And I don’t think that it’s intended to work in a way that all taps are open all the time.
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.