I can’t repeat it often enough: an app on your smartphone that can switch a lamp or whatever doesn’t make a smart home, because that’s just a relocated switch. Since each manufacturer has its own app, it’s even much more cumbersome. Smart home hubs like Home Assistant connect the most diverse systems and applications under one interface and provide truly smart functions.

⚠ [affiliate] Keine Produkte mit Cache für home-assistant.
Bitte affiliate-sync --lang en ausführen.
We’ve had a construction site around the house for over 6 weeks, as we’re having our terrace, driveways, etc. renovated. It also turned out that the downpipes of our gutters are no longer okay and need to be replaced. Our house looks like a modern new build, but has been standing since 1965.


There were still clay pipes and they eventually break. Since everything was already dug up and the excavator was already there, the effort for this was manageable, so we also had a rainwater cistern buried that can collect all the rainwater from the large south-facing roof. Thanks to the heavy rainfall of the last few days, it’s already full to the brim - 5,000 liters after all. Two more tanks (in the picture above right) were already here from the previous owners and were relocated. These also hold another good 3,000 liters and are fed from the garage roof.

Since this rainwater naturally also needs to be used, we’re currently installing an automatic irrigation system with pop-up sprinklers and Gardena water outlets around the house. We won’t complete this entirely this year, but some additional areas have been created that we’ve just freshly seeded and want to keep moist. A submersible pressure pump was already available and a simple sprinkler, together with an Osram ZigBee socket and a Home Assistant automation, is currently ensuring that the grass seed gets the best conditions.
Is a rainwater cistern worth it?
A rainwater cistern is a great thing, as you can use the rainwater in dry periods not only for garden irrigation, but also for cleaning work, etc. Although this summer was very wet, the last two years were extremely dry, so irrigation becomes necessary if you want a green garden. A well drilling is not economically feasible for us for geographical reasons.
However, the costs for a rainwater cistern are considerable. A flat cistern with 5,000 liters capacity and pre-filter in good quality (we bought ours at BayWa) costs 2,500 euros. For excavation work, gravel and sand, installation, connection or extension of pipes, submersible pressure pump, etc., at least the same amount is added again.

In our region, you have to reckon with 15 liters per square meter per week. The area to be irrigated is about 500 sqm for us and needs to be watered for an average of 16 weeks. 15 l * 500 sqm * 16 weeks = 120,000 liters = 120 cubic meters of water per season. We don’t have a separate tariff for garden water here, so we would spend 580 euros per year just on garden irrigation if we wanted to do it optimally. The cistern would therefore pay for itself after a good 10 years. Since we already had the excavator, etc. on site, the calculation is much better.
Looking at the development of temperatures due to climate change, the water requirement is likely to increase significantly in the coming years, and then you’ll be glad to be able to fall back on cheap rainwater. The costs for tap water are also certain to rise.
Multiple switching times in Home Assistant
For grass to grow well, it should be watered more often but for shorter periods. Every hour during the day for 2-3 minutes is probably optimal according to my research. Furthermore, irrigation should be suspended when it’s raining or if there has already been more than 3 mm of precipitation that day. Since we already have a rain sensor on the roof with our LCN-WIH , we can also use it for this. Via the FineOffset weather station (which is sold under numerous brand names such as Bresser, Saintlogic or dnt), its rain gauge and WeeWX, I also get the hourly and daily rainfall reported.

The planned sequence is therefore:
- Switch on the pump via the ZigBee socket every full hour for 2 minutes
- but only if it’s not currently raining
- or there has already been more than 3 mm of precipitation (= 3 liters per square meter) today
By the way, my Osram ZigBee socket is called “Springer” because it’s always used when I temporarily need a specific function.
An automation with a single switching time and the conditions mentioned can be clicked together in the visual automation editor.






However, if you want multiple switching times, you need to insert some YAML YAMLData format (YAML Ain’t Markup Language). Used in Home Assistant for configurations, automations and scenes. Easy to read but error-prone with incorrect indentation code. Conveniently, in HA there is the option for the “Time” trigger to specify multiple times as a list. For the task of garden irrigation, this is ideal, as you’ll rarely need other settings here.
|
|
You can first create the basic automation via the visual editor, as it is very convenient for selecting entities such as switches and sensors. Then click on the three dots at the top right of the automation and select “Edit as YAML”. This allows you to extend the switching times as shown above. After the automation has been saved, you need to reload the automations under Settings -> Server Controls for them to become active.
Frontend and setting the irrigation duration via helpers
In the Lovelace LovelaceHome Assistant’s dashboard system. Dashboards are created in Lovelace as YAML configuration or via the UI editor – and are therefore versionable too frontend, you can add a switch for the automation, with which you can also deactivate it if needed. I also have a switch for my “Springer” socket so that I can also switch it manually.

This could also be used to realize an automatic deactivation of the irrigation if the camera detects people in front of the raised bed so they don’t get wet - with Frigate and a dedicated zone for the raised bed, this would be no problem.
It would also be practical if you could set the irrigation duration in the frontend. To do this, create a slider under Settings -> Helpers with which you can determine the irrigation duration in minutes.

To integrate the helper with the time setting into the automation, some YAML is needed again to replace the hard-coded delay setting:
|
|

The helper for the irrigation duration could now also be manipulated via the input_number service. Another automation would be conceivable that extends the irrigation duration depending on the outside temperature or shortens it depending on soil moisture - or or or …
Which sensors and conditions you add is of course up to you. Perhaps you have integrated a soil moisture sensor via ESPHome ESPHomeFramework for configuring ESP32/ESP8266 microcontrollers that automatically integrate into Home Assistant. Ideal for DIY sensors and actuators (a small construction guide for this will follow soon) or are evaluating data from a weather service? With a fill level sensor for the cistern, you could reduce the irrigation time or switch it off completely, etc. There are plenty of possibilities and of course the application of multiple switching times is not limited to garden irrigation ;-)
What do you think? Leave a comment!
Share your thoughts, questions or experiences with the community.