Smart Irrigation with temperature and rain forecast implementation

Tags: #<Tag:0x00007fc3eb4fa810> #<Tag:0x00007fc3eb4fa680>

You can know more visiting its github page


I’ve been looking for weeks for a good and simple automation to water my plants on my terrace. I’ve been using a classic battery-powered irrigation control unit and it worked smoothly but it had two main downsides:

  1. It could not stop if it was raining (or if it rained the day before), so in rainy days water dripped from my terrace (and i was wasting liters of water for nothing);
  2. It had limited possibilities in facts of programmability, but above all i had to run water for the same amount of minutes every day, independently from weather conditions.
    I found some options but they were either too complex or too grass-oriented (i water my plants for about 1 to 3 minutes per day, while those programs suggested me to water for more than 10 minutes/day), so i developed myself a very simple and customizable automation in HomeAssistant.

What did i use?

Simply a Shelly like this and a normally closed solenoid-valve like this, with less than 40€ you can do the same!

How does it work?

  1. Every day at 00:00 the sensors of “Rain Today” and “Maximum Temperature Today” is reset;
  2. Every time the rain forecast sensor changes, the “Rain Today” sensor is updated;
  3. Every time the temperature sensor changes, if it’s higher than the actual value, the “Maximum Temperature Today” sensor is updated;
  4. When the trigger condition is met (in my case when sun elevation is higher than 35°) the automation starts;
  5. If “Rain Yesterday” is higher than 4mm or “Rain Today” is higher than 2mm the automation does not run;
  6. The switch is switched on;
  7. The delay counter starts, based on “Maximum Temperature Yesterday”, if T>30 it runs for 3 times the standard time, if T>25 for 2x, if T>20 for the standard time, else (if T<20) it runs for half the standard irrigation time;
  8. The switch is switched off;
  9. The notification is sent to the mobile app.
  10. Every day at 23:59 “Rain Yesterday” gets the value from effective (NB: not forecasted) rain from OpenWeatherMap and “Maximum Temperature Yesterday” gets the value from “Maximum Temperature Today”