AppleScript to control sprinkler duration

Posted on
Tue Oct 11, 2011 5:31 pm
mbclark222 offline
Posts: 6
Joined: Jul 20, 2011

AppleScript to control sprinkler duration

I've set up an action group that has two items. The first item is an AppleScript that adjusts the sprinkler duration (based on temperature and rainfall), and the second item is a "Control Sprinkler" action. The AppleScript adjusts the durations in the control sprinkler action.

When the sprinklers actually run, however, they use the original durations specified in the control sprinkler action. The adjustments are retained and will be used the *next* time the action group is executed.

It seems that the action group uses the parameters as originally set in the control sprinkler action when the action group is executed.

Is there a better way to set this up or would this be considered a bug?

Posted on
Tue Oct 11, 2011 5:38 pm
matt (support) offline
Site Admin
User avatar
Posts: 21417
Joined: Jan 27, 2003
Location: Texas

Re: AppleScript to control sprinkler duration

Please copy/paste your complete AppleScripts so we can see more details.

Image

Posted on
Tue Oct 11, 2011 5:58 pm
mbclark222 offline
Posts: 6
Joined: Jul 20, 2011

Re: AppleScript to control sprinkler duration

Thanks. I think I've found a work-around. I took the AppleScript out of the Action Group, leaving only the Control Sprinkler step in the Action Group.

I call the AppleScript from a Time/Date action. The AppleScript adjusts the durations, then uses "execute group" to run the Control Sprinkler step in the Action Group.

Posted on
Tue Oct 11, 2011 6:43 pm
jay (support) offline
Site Admin
User avatar
Posts: 18224
Joined: Mar 19, 2008
Location: Austin, Texas

Re: AppleScript to control sprinkler duration

We attempt to run actions in parallel, so the control sprinkler action ran before the AppleScript got the variable changed. By moving the action group execution to the script, you made them serial so it works as you expect. The other way would have worked if you had put a slight delay on the control sprinkler action. That would have given the AppleScript time to complete.

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Thu Jul 25, 2013 12:01 am
ckeyes888 offline
Posts: 2425
Joined: Nov 26, 2009
Location: Kalispell, MT

Re: AppleScript to control sprinkler duration

I would like to be able to vary my EZFlora sprinkler durations based on variables.
I suppose I could run each zone individually based on its own timer but was
hoping there might be some simpler way to do it?

Maybe the Applescript mentioned here earlier?

Thanks,

Carl

Posted on
Thu Jul 25, 2013 8:54 am
jay (support) offline
Site Admin
User avatar
Posts: 18224
Joined: Mar 19, 2008
Location: Austin, Texas

Re: AppleScript to control sprinkler duration

You can vary them all by using a sprinkler multiplier variable in the action settings. But that applies to all zones. If you want to vary individual zones then you'll need separate schedules with separate multipliers.

Or you could write a script to run the whole thing and skip using the sprinkler schedule action UI.

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Thu Jul 25, 2013 11:46 am
ckeyes888 offline
Posts: 2425
Joined: Nov 26, 2009
Location: Kalispell, MT

Re: AppleScript to control sprinkler duration

Thanks Jay. Think I have it worked out using a combination of scripts and variables.
Would be a nice feature to be able to easily adjust individual durations
in some way.

Carl

Posted on
Sun May 17, 2015 3:57 pm
akimball offline
Posts: 561
Joined: Aug 07, 2013
Location: Sandy, Utah

Re: AppleScript to control sprinkler duration

Re-writing some of my control pages. Wife does not program and only uses interfaces I provide. We have 3 EZFlora controllers (24 zones total) and she is VERY interested in knowing how long each sprinkler zone runs.

I realize we can "preset" this information into each EZFlora device (30,30,20,40,0,30,30,15) or something similar to that... but as I said, she wants this information displayed in her iPhone interface... so at least she can have me modify that information...preferably modify herself with a popup window. I already give her the sprinkler duration multiplier and if she clicks on it, she can modify that but that is not quite satisfactory as it's global to each EZFlora device.

Any plugin 3rd party or method that allows me to read these duration values? Changing them would be great but I'd settle for just being able to read them for now (I have read what you've told others).... I want to inset these values inside the nifty new sprinkler controls you provided with Indigo Touch 2.0 (notice the number of minutes in yellow.... for purposes of illustration; these are dummy values so you could see what I'm looking to accomplish; I don't want to have to remember to these static values on the control page each time we adjust the times in the respective devices):



I scaled the image by 50% so it would fit... it was a retina image.

Any help would be great. TIA
Attachments
IMG_0830.PNG
IMG_0830.PNG (233.34 KiB) Viewed 2734 times
Last edited by akimball on Sun May 17, 2015 7:04 pm, edited 2 times in total.

-Al

Posted on
Sun May 17, 2015 7:01 pm
SpencerJRoberts offline
User avatar
Posts: 256
Joined: Dec 09, 2012
Location: Mountain View, CA

Re: AppleScript to control sprinkler duration

I am actually currently writing a sprinkler plugin that will accomplish this. It will not modify the actual sprinkler max durations, but you will be able to set zone durations as long as they are under the max durations set at the device. This will be achieved by creating virtual "sprinkler schedule" devices. I'm still waiting on my sub-forum to be created but when it is I will post back here with a link and have more info (there are other features besides the schedule devices). As for an ETA, I'll be on vacation soon so you probably won't see an alpha of the plugin for 2-3 weeks.

Posted on
Sun May 17, 2015 7:13 pm
akimball offline
Posts: 561
Joined: Aug 07, 2013
Location: Sandy, Utah

Re: AppleScript to control sprinkler duration

Spencer, that sounds just like what I'm looking for, and editing the max zone durations was not what I had in mind.

Another handy metric which may become possible once we have access to these times would be the "total run time" of a sprinkler schedule. With water restrictions coming to my area this summer (already in place actually for many local communities) and considering that they want you to water just before dawn before the sun rises.... AND taking into account that the exact time of the sunrise is a moving target, then if we know the total time a sprinkler's night schedule will take, we can calculate an adaptive sprinkler schedule which adjusts the exact start time based on sunrise and the total run time of it's individual zones.

Please have a great vacation and if you need a beta tester I would be interested. Thanks again.

-Al

Posted on
Sun May 17, 2015 7:26 pm
SpencerJRoberts offline
User avatar
Posts: 256
Joined: Dec 09, 2012
Location: Mountain View, CA

Re: AppleScript to control sprinkler duration

akimball wrote:
we can calculate an adaptive sprinkler schedule which adjusts the exact start time based on sunrise and the total run time of it's individual zones.


This will be possible, I'll certainly try to build it into the plugin. I've got water restrictions in my area too (California) so I'm definitely interested in other peoples ideas to aid those like us!

Posted on
Sun May 17, 2015 7:41 pm
akimball offline
Posts: 561
Joined: Aug 07, 2013
Location: Sandy, Utah

Re: AppleScript to control sprinkler duration

Yes, I completely concur. I'm all for saving water and making it stretch out. I live in Salt Lake City area which is basically a desert. This year for the first time in my 59 years, we had virtually no snow during the winter and that means no water in our reservoirs. We do continue to get rain but that doesn't help our snow pack.

A couple of other considerations (I hope not complications) is that my 2ndary water pressure is absolutely fantastic here... literally almost 200-lbs of pressure. What this means to me is that I can run multiple EZFlora devices at the same time with no drop in water pressure. However, for many people, they don't have secondary water and must use expensive culinary water to irrigate their lawns. Furthermore, they're lucky if they get 40 to 60-lbs of pressure; therefore they can only turn on a single EZFlora at a time even though they may have more than one. For my case, my property is 1/2 acre with animal rights and when I bought the property I also was required to pay for 2 "shares" of secondary water for irrigation at a fixed rate throughout the year.

One of the cool things that Indigo has is the ability to run schedules at a given time based on sun-up or sun-down. plus or minus some constant.. but what you can't seem to do is to make the "sun-up" plus or minus a variable. If a watering plugin could provide that + or - information in a variable which could ben be used with an indigo schedule, this would also do the trick. Might be interesting to hear any thoughts from indigo.

-Al

Posted on
Sun May 17, 2015 7:52 pm
SpencerJRoberts offline
User avatar
Posts: 256
Joined: Dec 09, 2012
Location: Mountain View, CA

Re: AppleScript to control sprinkler duration

My plugin already has features in place that disallow multiple devices to run, but the details are perhaps more lengthy than should be shared here. It will all be laid out in the plugin description. As for modifying the sunrise/sunset by a variable, that should be possible. Save these requests and remind me once my sub-forum is created :D

Posted on
Mon May 18, 2015 10:44 am
akimball offline
Posts: 561
Joined: Aug 07, 2013
Location: Sandy, Utah

Re: AppleScript to control sprinkler duration

Disallowing multiple devices to run at the same time wouldn't work for me, the way I operate my zones considering that I have 18 of 24 zones currently operational with 6 more zones planned as I finish the finish landscaping my backyard; total consecutive run time for all 18 or 24 zones might actually exceed the duration of shorter summer nights. Anyway, I would never want to start watering prior to 1:00am. But, perhaps I could still utilize the plugin just for reading and setting the zone times remotely as my spouse would love to do; then I would use the currently available Indigo sprinkler controls for actual operation since these can operate simultaneously.

-Al

Posted on
Mon May 18, 2015 11:05 am
SpencerJRoberts offline
User avatar
Posts: 256
Joined: Dec 09, 2012
Location: Mountain View, CA

Re: AppleScript to control sprinkler duration

I can easily make the disallowing of multiple zones a toggle option

Who is online

Users browsing this forum: No registered users and 16 guests