My Garden Irrigation


#1

There is a thread here - Garden Irrigation - which whilst old and long is an excellent resource that I encourage anyone interested in using HA in conjunction with their garden irrigation systems to read. It is full of very useful information and various different ideas and implementations for setting up a system.

Some months ago I posted my own code there and I know from feedback that it was picked up by a few people. It’s been winter here for several months so I haven’t used it for a while but I have been maintaining it to deal with breaking changes and have made a few small additions and improvements based on things I have learnt from others in this forum. I also updated it to work with Lovelace.

I recently had a message form someone asking if I would share the most recent version so I have decided to put the code on GitHub for anyone who is interested.

I of course welcome any feedback.


SmartWeather - Get local weather data combined with Dark Sky Forecast
#2

Awesome stuff. For completeness I would love to see the hardware you have in this thread too, can do?

I’m so close to this adventure now after so many delays. Just waiting on a final design from the irrigation company so we can kick off on the plumbing.

Looks like I’ll be using your code! I’ll be looking to integrate a flow meter - this way I can see how much I have used in the garden and current flow rate per minute, but also if the pipes/solenoids have started leaking (showing an unexpected flow) or if watering isn’t happening when the system says it should be (pump or solenoid fail)…

I’m also looking at a pool top off zone… Should be easy!

Love the simplicity of your solution.

Thanks!

(My hardware should be an esp8266 or esp32 depending on WiFi reception, a small display, and an 8 way relay board - 24v Hunter irrigation gear and Toro fittings)


#3

I am one of those who uses the Klogg code that I still thank the incredible work done, as hardware I use a Sonch 4ch with Tasmota firmware and following this guide (https://www.youtube.com/watch?v=_ymyczBpmec ) with only 30 $ I did everything! in the past I built the hardware myself but I preferred to use the Sonoff for the low costs.


#4

Im doing a similar system currently using Sonoffs and Valves to control each zone of the system. I plan on using my Netatmo system.

Out of interest have you worked out accumulated rainfall? I read through the files but i couldnt find out how you created sensor.rainfall_today


#5

No I haven’t! And I wouldn’t take what I have here too seriously, I have been playing with it a lot but never got anything satisfactory.

I suspect the only reliable method is to have your own rain gauge but please post here or message me if you figure anything out!!!


#6

@brendanheyu I’m sorry but I forgot all about you asking about my hardware. I will try and give a few details in the next few days.


#7

@klogg I have the Netatmo rain sensor, however i dont receive the accumulated rainfall, so i have had to make my own sensor and take a good guess at what the measurement is!

However, your system does look very good! I am hoping to get all of mine sorted in the next 4 weeks ready for the start of April!


#8

Thanks!
Let me know if you use it :slight_smile:
Or of course make any improvements…


#9

Sorry it’s been a while but here is my hardware.

I use a Sonoff 4ch which provides power via some transformers housed in a weather proof cabinet

to an eZyvalve 4 Solenoid Valve Box 24V. I use Rainbird Pop Up sprinlers.

I have a 5th zone which is separate as we only set it up when we go on holiday and it too uses a Sonoff Basic and another of the same transformers and has it’s own valve. It feeds some drip lines and a soaker hose.

I am pretty sure I haven’t done things the most economical way but it works :slight_smile:
And better still my wife (who is chief gardener here) loves it and appreciates HA because of it :wink:


#10

MATE!

That really looks quite serious! So you have 240v being switched - that feeds the 240-24v lines to the solenoids?

That will outlive you! nice!

Brendan


#11

Why have 4 transformers? Do you ever run more than one station at a time?
I run a single transformer and switch the 24VDC side with relays connected to an ESP8266.

You have certainly put A LOT of effort into the control side of things regards to weather offsets etc. (well done!) I went with a basic approach and just look at any rainfall that has been recorded prior to the irrigation running, or the chance of rainfall for the rest of the day. No where near as impressive as what you have.


#12

Love what you’ve done here. I’m just starting out with my gardens and looking at my options. Rainmachine is one option I really like, but looking at the DIY before I go that way.

Also love that Solenoid Valve Box. Where did you get that from?

Would a newer Sonoff 4CH Pro (or Pro 2) do the same as what you’ve done here, but without the transformers?


#13

Great ideas. I am still at the workbench stage. So far I have a single Nodemcu esp8266 driving 16 relays using esphome. My plan is to have 2 separate zones but using a esp32, one zone for the back yard, the other for the front.

On my todo list:
For each ESP32:

  • 8 ouputs (easily expand) driving the relays
  • 8 inputs (easily expand) to allow manual operation via a rotary switch with manual over-ride (Something the wife wants), albeit this still talk to hass. So you can switch between auto or manual.
  • Bluetooth to receive from miplant sensors due to their limited range and relay to hass

While the ESP32 has bluetooth I haven’t actually tried it as per above yet.
All of my valves run off 24VAC.

Just a little pic of the NodeMCU ESP8266 with 16 relays. I did do it with 80 relays, just to see how it would go, and it was fine. Only tried 80 as I ran out of relays. Not that I could see myself ever needing that many.


#14

Yes… As I have already said this was the first thing I did with HA and coming from an entirely ‘Big Corporate’ IT background I had never really come across ‘small’ IT before. This was my first RPi and I had never even heard of Arduino or NodeMCU, never really had any visibility of (dare I say it) ‘hobbyist’ sensors and still thought a breadboard was something you, err, cut bread on. That along with only having (proficient) DIY level electrical skills means that, yes I am pretty sure now that what I have done was overkill!

Because I didn’t know any better! To be honest I’m still not confident enough to play with mains wiring unless I am 100% sure it will work and be safe. I’m getting there though… (and see above, you can add ESP8266 to the list of invisibility!)

Yes but whilst what I have done might look impressive and does provide (I think) a solid framework it sounds like you have something that actually uses rainfall data! Where do you get the amount of rainfall prior to irrigation running?

Thank you. The solenoid valve box is I think an Australian product but widely available in the UK (which is where I am) - I got it from here and yes, as I said, I am sure there are more economical ways of doing this.

I’m not sure about the new Sonoff 4CH, but I don’t think so. I won’t say anymore because I am not qualified to (or confident yet of my ability to be correct!!) but if you find out otherwise that would be a good solution.

@Paul_Flavel This just highlights how little I know! I understand everything you are say but could never have come up with it myself!!

One final point in my defence… I discovered HA in March and we needed something in place by June, including my wife and I digging in all the water hoses, and we all know how long it takes to get used to HA and yaml :rofl: so to be honest I was only too happy to spend a bit more on the hardware and remove the pressure of the learning curve for the electronics side.

Thanks all for the feedback, I hope what I have done is useful to others, it’s nice to give something back after all the other help I’ve had from this community.


#15

My weather provider gives a percentage chance of rainfall for the day and a value (mm) that is expected, at said percentage chance. I use those figures with an adjustable cut-off as a condition


#16

All good. Doesn’t hurt to ask. I’m still researching my options.


#17

I suggest doing what I have: ESP8266 controlling a relay board. Run a single 24v transformer and switch it through the relays to each solenoid. Cheap, easy and HA loves ESP’s with ESPhome :grin:


#18

I have one on order to have a play with and learn. No idea what to do with it yet, but I may just have a new project now.


#19

This looks really good <3. Looking forward to see how rain calculations works. I used your work last summer and it worked fantastic. Looking forward to update my HA today with this. I am using sainsmart 16 relays and ESP8266 flashed with konnected to controll my irrigation. Flashed konnected because I found it more reliable then ESPhomeyaml. Only thing I would suggest is to post lovelace snipps to your first thread.


#20

Good idea. Done!

I’m not sure it works as is. All you need to do though is give it the right data source and it should work. I have yet to find any reliable or useful rainfall data to use for my area.