Author Topic: Automate Existing Irrigation for ?15 - ?25 with rain control.  (Read 3824 times)

Offline dringie

  • Newbie
  • *
  • Posts: 4
  • Karma: +0/-0
Hello everyone, this is my first post so hello all :-)

Just a couple points about my ability before I go on, I have been playing with my Vera for around 6 months and am no expert. Due to my busy, busy life I have not had time to read the forums, so please forgive me if I have double posted anything or missed something. I'm sure what I am about to share can be made simple, so if I have shared code that can be cut down or written more efficiently, please add to the thread and i'll try keep up to date and amend  the main post. 

So here it goes, my setup so far is couple of lawn sprinklers connected straight to a garden tap with no timer. Like most people I have seen on the forum (from my limited reading) I wanted to buy an off the shelf controller/timer and then modify that, then I thought the Vera is the timer so what am I doing? I then started to look at ways I could connect the sprinkler water valves/solenoids directly to the Vera and I came up with this setup.

First the hardware, due to being in the UK we have a weird mix of metric/imperial measurements, so please look at the hardware before you buy because I'm not sure how the EU countries work, USA sould be fine because we normally come off imperial to metric, not the other way around. First I purchased a 12V Water Valve/Solenoid from ebay

http://www.ebay.co.uk/itm/HEAVY-DUTY-N-C-12V-DC-1-2-ELECTRIC-SOLENOID-VALVE-NORMALLY-CLOSED-FOR-WATER-AIR-/171120909292?pt=LH_DefaultDomain_3&hash=item27d799dbec.

This valve is normally closed and needs 12V to make the water flow, I connected the valve to my irrigation system  (See attached pictures)

I then wired it to an old netgear router transformer that happened to be 12V, as shown in the pictures. I control the transformer with a socket module connected to the Vera. I can now simply water my grass with a schedule but I wasn't happy with that because I am on a water meter and do not want the grass watered when it has rained.

So part 2, rain control. I again was looking at hardware (rain sensors) and thinking how can I read them from the Vera? After a few weeks of searching I thought hardware is not the answer, well at least not my hardware lol! I thought all this information is available on the net, I even have one of the national weather stations at the end of my road! So I began searching weather plugins and found weather underground. What an amazing information this plugin gave me, I knew I could use it.

Set up weather underground plugin on your Vera to your location, this will give you 5 devices on your Vera and the most important is the current weather.

Now PLEG another amazing plugin (I encourage purchasing the licence). First of all I set up PLEG very basically to water the grass at 23:00 if the weather was not raining but again this was not good enough because we have 5 different seasons in 1 day in the UK, I needed to measure the rain fall for that day. So I did this with the Variable Container plugin. 

Now at this point you have the Sprinkler controlled via the Vera, Weather Underground installed, PLEG installed and Variable Container installed.

Setting up PLEG Inputs (Schedules) Names are in bold

1 Schedule Check (This checks the current weather every minute) set the start to interval and set the interval to 00:01:00, then to set the stop to interval and the interval to 00:00:30 secs. 

2 Schedule Reset (This resets the counter for the next day) Set this schedule to day of the week and check all the days and set the time to midnight and the stop time to one minute past midnight.

3 Schedule Water Garden (This is the time you want to water the garden) Set this to what ever you require and don't forget to add a stop time. (Not sure if you need a stop time but I noticed that the schedules continued to be true if you didn't stop them)

Setting up Inputs (Device Properties)

1 Weather Underground, add the device property condition and call it Rain

2 Variable Container, add property variable1 and name it Minutes

Setting up Conditions (In Bold are condition names)

1. Check Rain checks to see if the current weather is raining and if true it adds a 1 to Variable1 in the Variable container plugin.

Check_Rain Check and (Rain eq "Freezing Rain" or Rain eq "Heavy Rain" or Rain eq "Isolated Thunderstorms" or Rain eq "Light Rain" or Rain eq "Rain Showers" or Rain eq "Rain" or Rain eq "Showers" or Rain eq "Scattered Showers" or Rain eq "Thunderstorm")

** Please note, I have had three different Pleg conditions posted for this one because I was not sure of the best. I have finally had most of the conditions above and believe this is the best code. I have also changed the condition in the device property section above to condition and NOT condition group.

2 Reset Rain, to reset the rain count.

Reset_Rain Reset   

3 Go, start the sprinkler if there has been less than 20 minutes of rain and it is 23:00 (in my case, you can change the minutes to whatever number you like)

Go Minutes < 20 and water_garden


Setting up actions

1. Rain Minutes, adds 1 to variable1 in variable container every time Check and Rain is true.

Insert this luup code in to the scene (CHANGE THE DEVICE ID TO MATCH YOUR VARIABLE CONTAINER PLUGIN, mine is device id 132, so change that number in the code, on both lines of it!!! Device id can be found in the advanced settings in the Variable Container plugin)

Code: [Select]
local lul_Rain = luup.variable_get("urn:upnp-org:serviceId:VContainer1","Variable1", 132)
luup.variable_set("urn:upnp-org:serviceId:VContainer1","Variable1",tonumber(lul_Rain)+1, 132)

2. Reset Rain, resets the rain counter.

Inset this luup code in to the scene (AGAIN CHANGE THE ID!!!)

Code: [Select]
luup.variable_set("urn:upnp-org:serviceId:VContainer1","Variable1",0, 132)
3. Go Starts the water program.

Set the scene up to water the garden (like you would in a normal vera scene) I have mine setup to water the grass for 5 minutes, stop for 5 minute and then water again for 5 minutes. You can do what you like because this program will only be run when you have had the conditions set by you above.

I think I have covered everything but like I said above I may of missed something and I'm almost sure I could streamline the process but I am a beginner, so please forgive me.

Have fun watering  ;D 
« Last Edit: April 22, 2014, 04:46:47 am by dringie »

Offline dringie

  • Newbie
  • *
  • Posts: 4
  • Karma: +0/-0
Re: Automate Existing Irrigation for ?15 - ?25 with rain control.
« Reply #1 on: April 18, 2014, 03:43:43 am »
Just something for the bigger gardens.

This system can be expanded via Ethernet Relays (control more water valves/zones). I haven't done this yet, so if anyone does this setup please add to the thread.




Offline silencery

  • Sr. Member
  • ****
  • Posts: 254
  • Karma: +14/-1
Re: Automate Existing Irrigation for ?15 - ?25 with rain control.
« Reply #2 on: April 18, 2014, 10:07:08 pm »
Wow, that's a brilliant idea.  Thanks for sharing!  I might just have to consider this.

Offline pepe6859

  • Newbie
  • *
  • Posts: 13
  • Karma: +0/-0
Re: Automate Existing Irrigation for ?15 - ?25 with rain control.
« Reply #3 on: June 13, 2014, 08:54:58 am »
I really like your set up. Mine is quiet simple, I have an irrigation system operated with batteries controlling 3 zones. I will just add one motorised ball valve (ON/OFF) at the irrigation main water supply line 3/4"to be closed when not irrigation is required according to vera`s control. The irrigation control system will continue executing its program as usual but not water will come out due to water main line cut off. For me this is the easiest way to go for.
I have Vera since few weeks only and not to much experience but some lighting scheduled or triggered by sunrise and sunset. Just learning and enjoying.
Will work hard with your contribution to try my plan!!!!

Thanks a lot!!!!
 

Offline WrightPC

  • Newbie
  • *
  • Posts: 6
  • Karma: +1/-0
Re: Automate Existing Irrigation for ?15 - ?25 with rain control.
« Reply #4 on: June 17, 2014, 06:54:38 pm »
I bought a house that already had a seven zone irrigation system installed.
It was plugged in to a standard wall outlet to power the control and the valves.
Everything uses the 24v AC transformer built into the controller.
I installed the Virtual Rain Sensor on my Vera.
I configured the Virtual Rain Sensor to trip when there is more than 0.5" in the previous 24 hours + the next 24 hours.
I added a trigger for a scene that turns off the outlet feeding the Irrigation controller when the Virtual Rain Sensor trips.
I added a trigger for a scene that turns on the outlet feeding the Irrigation controller when the Virtual Rain Sensor resets.
The Irrigation controller has a battery to hold the time and the watering times are stored in NVRAM.
Works great.
Cant get features like that in $5000 irrigation controllers.

Offline pepe6859

  • Newbie
  • *
  • Posts: 13
  • Karma: +0/-0
Re: Automate Existing Irrigation for ?15 - ?25 with rain control.
« Reply #5 on: June 18, 2014, 03:55:34 am »
I bought a house that already had a seven zone irrigation system installed.
It was plugged in to a standard wall outlet to power the control and the valves.
Everything uses the 24v AC transformer built into the controller.
I installed the Virtual Rain Sensor on my Vera.
I configured the Virtual Rain Sensor to trip when there is more than 0.5" in the previous 24 hours + the next 24 hours.
I added a trigger for a scene that turns off the outlet feeding the Irrigation controller when the Virtual Rain Sensor trips.
I added a trigger for a scene that turns on the outlet feeding the Irrigation controller when the Virtual Rain Sensor resets.
The Irrigation controller has a battery to hold the time and the watering times are stored in NVRAM.
Works great.
Cant get features like that in $5000 irrigation controllers.

Hello WrightPC

I have something like you at Virtual Rain sensor settings. I think the window (24 previous + 24 Next is too short. What is happening  to me is that my sensor trips after passing the selected threshold which is 0.49 (so it trips at 0.5 inches ) and obviously reset when is back to 4.9. But sometimes the weather improve and the total precipitation goes back to 0.4 or less even if the conditions in the "World Weather Device" status is in RAIN so the device resets under raining conditions. My weather station is about 2 Kilometers away. (Iam in Spain BTW)
I would like to include a logic condition to trip when Total precipitation threshold (OR) Rain present and reset when both gone (AND), but my knowledge don't go that far in programming or even using the PLEG which I already paid.
Regards,
 

Offline phajaa

  • Newbie
  • *
  • Posts: 1
  • Karma: +0/-0
Re: Automate Existing Irrigation for ?15 - ?25 with rain control.
« Reply #6 on: December 02, 2014, 05:10:01 am »
I have something like you at Virtual Rain sensor settings.



_____________
kaleem