Automate the garden irrigation - lka/HomeAutomation GitHub Wiki
I have divided my garden with 7 zone valves, all with gardena valves 24V AC and connected to 25 mm water distibution in 3 valve boxes.
They can be controlled by a gardena irrigation controller for 8 zones, that's a simple scheduler with a bad operation concept. The controller resides in my garage. I decided not to replace it, but to be able to switch between gardena and my raspberry pi and to replace the gardena transformer with an electronic one in a wall box.
On the DIN-rails in the wall box are the transformers from 230V AC to 24V AC and 230V AC to 5V DC, one fuse for the 230V AC, the Raspberry Pi 3 B+, one relays-board with 8 relays.
And this is the menu of the garden in Home Assistant:
- Each blue arrow can switch on or off the valve (zone)
- For each valve I can select the day when it should work and the duration for the irrigation
The automation
I have three types of irrigation
- Beete - flower beds
- Rasen - lawn
- Hecke - hedge
The triggers for the automation are
- 4 h before sunset for the lawn
- sunrise for the flower beds
- sundown for the hedge
The conditions are
- day_of_week is selected in the array for the days where it should work
- AND next 24 hours it will not rain more than 5 mm per square meter
THEN script for the type will be started
The three scripts do this:
- start zone
- wait time in hh:mm set for the zone
- stop zone
- wait 1 minute
- start next zone
- wait time in hh:mm set for the next zone
- stop next zone
- wait 1 minute
- and so on
The logbook shows something like this:
Some constraints
In the documentation of Home Assistant there exists an example for the irrigation, but this examples uses Dark Sky for the precipitation. On March 31, 2020 Dark Sky was acquired by Apple and is no longer allowing new API registrations. The Dark Sky API will continue to function for existing users through the end of 2021, but it is no longer possible to obtain an API key for new users. I decided to use YR and sensor.weather_precipitation to get the amount of rain for the next 24 hours. I hope norway will not be bought by google.
Next steps
- add general stop button for all valves
- accumulation of the rain in the last 24 hours
- perhaps measurement of the soil moisture
- test whether a reset of the power supply during irrigation leads to failures (don't waste water)