Author Topic: LUUP, Weather Underground, and Irrigation Control  (Read 11469 times)

Offline Brientim

  • Sr. Hero Member
  • ******
  • Posts: 2497
  • Karma: +78/-7
Re: LUUP, Weather Underground, and Irrigation Control
« Reply #15 on: May 03, 2013, 06:34:47 pm »

How does one go about requesting an enhancement to the Wunderground plugin to provide actual precipitation information.  That would be one way I'd like to determine if irrigaiton is necessary.

Sorry, I did not explain myself sufficient. This thread is an example of similar requirements, whereby the conditions should already be reported in the plugin. They are covered to a minor degree in the wiki link below..
http://code.mios.com/trac/mios_weather
There are numerous requests to set this function to action and review previous sub threads in the group below:
http://forum.micasaverde.com/index.php/board,42.0.html
The main thread is here and this is where you could request enhancement but this is covered already...
http://forum.micasaverde.com/index.php/topic,1435.0.html
It is now a matter of tying this all together and implementing which hopefully happens the first attempt - good luck and have fun.


Offline geoffbon

  • Newbie
  • *
  • Posts: 17
  • Karma: +0/-0
Re: LUUP, Weather Underground, and Irrigation Control
« Reply #16 on: October 21, 2013, 12:17:07 am »
So i kinda started over here and was wondering if this might work as well.

ZoneDone (WaterOn; NOW > 19:30)
ZoneStart ((WaterOff; NOW > 50) AND (NOT CycleDone))
Schedule ((MWS3AM) AND (NOT Rain) AND (Rain; NOW > 04:00:00))
CycleDone (OneZoneOnly OR (WaterOn @ 8 < 03:00:00) OR OffTime)

I am using:
weatherunderground for the Rain input
A virtual input toggle to indicate if i just want to water one zone. (i have a flower bed that needs more water sometimes and this way i can just toggle that input for it to stop after the one zone)
I also have a schedule called OffTime set for 5:47 AM (2 hours and 47 mins after the MWS3AM start time) as a fail safe.

I know this is an old thread, but I found it because I'm in *exactly* the same boat - an indexing valve that needs to be switched on for 20 minutes, off for one, for each of three zones.
I'm wondering if you'd mind sharing where you got to with this?  I'm new to PLEG, but can really see the power in it - I'm convinced that once I get this example working, I'll be able to rework some of my other scenes into a more elegant PLEG setup.

I set up the weatherunderground plugin, got the API key working, and it appears to be correct.
In the PLEG device I have one schedule:

DailyCycle  Weekly:1,2,3,4,5,6,7  21:00

I then set up three triggers, identical to yours, and I understand that these essentially become variables I can use in the conditions:
WaterOn  Sprinkler Pump is turned on   
WaterOff  Sprinkler Pump is turned off   
Rain  World Weather: Condition Group is 'Rain'



From there, I'm kind of lost on how to set up the conditions to drive the final behaviour I'm looking for:
  • At 9pm start the pump, unless one of the following is true: [it's raining] or [it has rained in the last four hours] or [I've set a one-day override e.g. for a BBQ evening]
  • After 20 minutes, stop the pump
  • Wait one minute, start the pump
  • Repeat until all three zones have completed
I'd also like to be able to run the pump manually when I'm doing maintenance, to test new sprinkler heads or clear the lines.  I'm guessing I need perhaps a virtual switch for that, to prevent the WaterOn from triggering?  Or can I just check if the pump is coming on outside normal schedule hours, and realise it's a manual test?


Thanks for any help,
Geoff




Offline mbc2237

  • Sr. Newbie
  • *
  • Posts: 27
  • Karma: +0/-0
Re: LUUP, Weather Underground, and Irrigation Control
« Reply #17 on: October 21, 2013, 12:48:47 pm »
i still haven't got mine working correctly.  We are truly in the same boat.  I have tried different methods but none of them elegant and none of them actually working the way i would like.  If i could simply write some industrial basic code i could do it.  I need to use nested if-then statements.  The problem is that everything is like a slow state machine since things are evaluated once a min.  i can easily get the cycle to start, stop, pause, and start again.  the problem is stopping everything once all zones are done.  i have tried using the PLEX counter function and the if X happens in Y time functions but i still can't get them to behave properly.  I have given up and moved on for the time being with the intent to eventually just buy a standard, read crappy, sprinkler timer.  If you get anywhere, please let me know...Also, if you are truly going to work on this, i will dust off what i have done as well and maybe we can figure it out.

Offline geoffbon

  • Newbie
  • *
  • Posts: 17
  • Karma: +0/-0
Re: LUUP, Weather Underground, and Irrigation Control
« Reply #18 on: October 21, 2013, 02:51:29 pm »
I was just thinking the exact same thing about how it's really just a state machine.  This makes sense, since it's what gives it the ability to survive a restart.  The problem is needing to keep track of which cycle it is up to; I'm not sure how to have that survive a system restart.
I'm guessing that a PLTS would help simplify things, but I've only just started digging.  I'll look at this a bit more tonight.
Cheers,
Geoff

Offline RichardTSchaefer

  • Master Member
  • *******
  • Posts: 10091
  • Karma: +763/-142
Re: LUUP, Weather Underground, and Irrigation Control
« Reply #19 on: October 22, 2013, 12:08:01 am »
PLEG, PLTS, and Countdown timer plugins all retain state across a Vera restart.
This is critical for anything the runs for a while ... and where inappropriate operation can cost you $$$$ in terms of failed hardware or inefficient utilization of resources.

The examples above use PLEG for managing the State machine.

Offline stagf15

  • Newbie
  • *
  • Posts: 6
  • Karma: +0/-0
Re: LUUP, Weather Underground, and Irrigation Control
« Reply #20 on: June 08, 2014, 11:21:35 pm »
Greetings all... I am very new to MiCasaVerde, PLEG and the whole home automation thing.  I purchased the Vera3 about 2 weeks ago, and have been adding devices ever since.  I've had my eye on doing something with my sprinkler controller the whole time, and have been reading through the threads.  This thread caught my eye because mbc2237 and geoffbon seem to have the same type of sprinkler system that I do... an indexing valve that operates by simply powering the sprinkler pump for the zone time, removing power for the time it takes to reduce pressure enough to switch zones on the indexing valve and then power the pump back up.  Then continue this process until all zones are done. 

I haven't seen any other threads that solved the problem in this thread (though I haven't read them all) and thought I would take a hack at it.  Initially I had the same problems... I wasn't able to get the thing to stop looping once it started.  But I think I have it solved.  I do not have mine interfacing with any rain data yet, but that should just be a simple "AND" addition to the "Run_Zone" Condition.  Here are my Triggers, Conditions and Actions:

Inputs/Triggers:
Sprinkler_SW_On - Sprinkler Switch On
Sprnklr_Sched_1 - Daily Schedule, Day of Week, Start at a certain time of day, Interval Stop (needs to be long enough to run all zones, delays, plus some slop)
Zone_Duration - Self Trigger, Interval Stop (Length to run each zone)
Swap_Duration - Self Trigger, Interval Stop (Length of time between each zone, for indexing valve swap)

Conditions:
All_Zones       Sprnklr_Sched_1 and (Sprinkler_SW_On @ 5 < 01:30:00)
Run_Zone      Sprnklr_Sched_1 and !All_Zones and !Sprinkler_SW_On and !Swap_Duration
Stop_Zone     Sprnklr_Sched_1 and Sprinkler_SW_On and !Zone_Duration

Note: The time in condition "All_Zones" should be the same time as the Interval in Sprnklr_Sched_1 (This is essentially the window in which all zones will run.  It probably wouldn't hurt if this was made with quite a bit of extra slop)

Actions:
Run_Zone      Sprinkler Switch On (Sprinkler_SW_On) and Start Zone_Duration Timer
Stop_Zone     Sprinkler Switch Off (!Sprinkler_SW_On) and Start Swap_Duration Timer

Please let me know if this doesn't work the way I've advertised.  I have tested it quite a bit with a lightswitch in my house, and will be applying it to my sprinklers once I get the wiring mod done on my old-school intermatic sprinkler timer.

I realize this may be water under the bridge, but I thought I would try to contribute somewhere, as I've already gained a ton of knowledge from this forum.  This home automation (z-wave) thing is quite addictive.

Cheers.

Offline geoffbon

  • Newbie
  • *
  • Posts: 17
  • Karma: +0/-0
Re: LUUP, Weather Underground, and Irrigation Control
« Reply #21 on: June 09, 2014, 09:19:53 am »
It's definitely not water under the bridge - I've had mine running using the built-in scenes for quite a while now, and keep thinking I need to get in and sort it out. 
I'll look forward to trying your PLEG setup, and will also tie in the rain data and will report how it goes.  Thanks!

Cheers,
Geoff

Offline stagf15

  • Newbie
  • *
  • Posts: 6
  • Karma: +0/-0
Re: LUUP, Weather Underground, and Irrigation Control
« Reply #22 on: October 26, 2014, 11:31:19 pm »
I have updated the PLEG code slightly for my sprinkler indexing valve.  I started a new topic here:

http://forum.micasaverde.com/index.php/topic,27947.msg199504.html#msg199504

Phil