|
Page 2 of 2
|
[ 30 posts ] |
Go to page: Previous 1, 2 |
| Author |
Message |
|
raneil
Joined: Feb 11, 2011 Posts: 32 Location: Grapevine, Texas
|
 Re: EZFlora Operating Status
berkinet wrote:hamw wrote:... AFAIK, there is no way to set individual sprinkler zone duration from Indigo Touch either through the popup UI control or the device interface, unless a custom interface like what you have created is made.
I could be wrong on this, since I haven't tried it. but... The Indigo AppleScript dictionary provides for the following action steps: sprinkler action runSchedule / stopSchedule / pauseSchedule / resumeSchedule / prevZone / nextZone / zoneOnzone index integer -- (use if sprinkler action = zoneOn) the zone index which should be turned on zone durations list of real -- (use if sprinkler action = runSchedule) list of zone durations to schedule So, you should be able to create a control page with a pair of up and a down arrows to set the an internal variable for the zone index, and another pair of arrows to set the zone duration. The arrow actions could be AppleScripts, which would allow high and low limits, or just simple action groups to increment/decrement a variable. Then, a final button would execute an AppleScript which would use the Zone and Duration values to start the EZFlora. I believe the trick is to set the durations for all zones other than the desired zone to 0. For example, if the desired zone was 2 and the zone duration was stored in variable target_duration, the value of zone durations would be {0,target_duration,0,0,0,0,0,0} CAVEAT: This is all just a guess. I have not tried using action steps and couldn't find any useful examples in the forums, so I can't really post any psuedo code. If anyone has actually tried this please speak up.
That sounds like it would probably work -- but like you, I haven't tried it. Your previous post got me thinking about it, and I came up with this: a simple two-step Action Group, pictured below. The values for the Zone number in Step 1 and the delay in Step Two are irrelevant, for now. They're just placeholders for values that will be set on the fly via AppleScript when the Action Group is executed.   Then, execute this AppleScript from where ever: - Code: Select all
tell application "IndigoServer" --set the zone to be manually activated (5, in this example) --action step 1 manually activates the specified zone set zone index of action step 1 of action group "Water A Single Zone" to 5 --set the watering time (seconds) --action step 2 turns off all zones after the specified delay set delay amount of action step 2 of action group "Water A Single Zone" to 900 --make it so! execute group "Water A Single Zone" end tell
|
| Mon Mar 21, 2011 7:31 pm |
|
 |
|
berkinet
Joined: Nov 18, 2008 Posts: 1721 Location: Berkeley, CA
|
 Re: EZFlora Operating Status
raneil wrote:[tell application "IndigoServer" --set the zone to be manually activated (5, in this example) --action step 1 manually activates the specified zone set zone index of action step 1 of action group "Water A Single Zone" to 5 --set the watering time (seconds) --action step 2 turns off all zones after the specified delay set delay amount of action step 2 of action group "Water A Single Zone" to 900 --make it so! execute group "Water A Single Zone" end tell
Great! Maybe you could avoid action 2 of your approach if you added this to your script: set zone durations of action step 1 to {0,0,0,0,900,0,0,0} Of course, doing the whole enchilada in AS would be the way to go... Maybe Jay or Matt could chime in here 
|
| Mon Mar 21, 2011 7:44 pm |
|
 |
|
raneil
Joined: Feb 11, 2011 Posts: 32 Location: Grapevine, Texas
|
 Re: EZFlora Operating Status
Quite possibly, but I'd also need to save the previous durations, and then restore them afterwards.
For some reason (I can't actually explain why), I'm compelled to avoid modifying the Schedule for a single one-time zone watering.
|
| Mon Mar 21, 2011 8:09 pm |
|
 |
|
hamw
Joined: Mar 31, 2008 Posts: 738
|
 Re: EZFlora Operating Status
How about using a VPN client to log onto the indigo computer from the yard, open your basic schedule and then just set zone durations directly there? Pretty easy IMHO. I use RemoteTap constantly to make small changes in my setup. Would avoid a whole lot of scripting. Although maybe not as much fun....... 
|
| Mon Mar 21, 2011 8:28 pm |
|
 |
|
raneil
Joined: Feb 11, 2011 Posts: 32 Location: Grapevine, Texas
|
 Re: EZFlora Operating Status
hamw wrote:How about using a VPN client to log onto the indigo computer from the yard, open your basic schedule and then just set zone durations directly there? Pretty easy IMHO. I use RemoteTap constantly to make small changes in my setup. Would avoid a whole lot of scripting. Although maybe not as much fun....... 
Yeah, don't go getting all practical on us and taking the fun of this! berkinet wrote:Great! Maybe you could avoid action 2 of your approach if you added this to your script: set zone durations of action step 1 to {0,0,0,0,900,0,0,0}
I put your theory to the test this evening, and it works as you predicted. I like it. Very clean and simple. And as far as having to save/restore the original Zone Durations, the obvious answer is to simply create a separate Action Group just for this purpose and leave the original Schedule unaltered. 
|
| Tue Mar 22, 2011 6:55 pm |
|
 |
|
berkinet
Joined: Nov 18, 2008 Posts: 1721 Location: Berkeley, CA
|
 Re: EZFlora Operating Status
I think I got it... The following script is designed to water one specific zone for a specific duration and could be executed from a Control Page. The key is to set the desired values for Device (sprinklerController), zone and zone duration. I hard coded them in this example, but they could just as easily be read from Indigo Variables, which, in-turn, could have been set from the Control Page. In any case, the action group is created on-the-fly, executed, and deleted. The deletion is actually done immediately after execution. But, the schedule continues to run to the end, as shown in the event log below. - Code: Select all
-- First, set the three key variables set sprinklerController to "Irrigation Controller #1" set zoneNumber to 8 set zoneDuration to 1
-- Next, create the zone duration list for a complete schedule. -- But, only our target zone will have a non-zero setting set zoneDurationList to {} repeat with zone from 1 to 8 if zone = zoneNumber then set val to zoneDuration else set val to 0 end if set zoneDurationList to zoneDurationList & val end repeat
-- Now, tell Indigo to create an action group, execute it and then delete it tell application "IndigoServer" set oneTimeWater to make new action group with properties {name:"One Time Water", display in remote ui:false, description:"My Water Test"} make new action step in oneTimeWater tell first action step of oneTimeWater set action type to controlSprinkler set device name to sprinklerController set sprinkler action to runSchedule set zone durations to zoneDurationList end tell execute group "One Time Water" delete action group "One Time Water" end tell
Here is the output from the event log - Code: Select all
Mar 23, 2011 10:17:33 Action Group One Time Water Sprinkler Scheduled "Irrigation Controller #1" zone durations: 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 1.00 Sprinkler Turning "Irrigation Controller #1" zone 8 on for 1.00 minutes Sent INSTEON "Irrigation Controller #1 - bk-yd-inner" on (ack: valve 8 on) Trigger Action Irrigation 1 State Script sprinkler 1 running
Mar 23, 2011 10:18:33 Time/Date Action _next_zone_8_Irrigation Controller #1 Sprinkler Stopping "Irrigation Controller #1" scheduled zone durations Sent INSTEON "Irrigation Controller #1 - bk-yd-inner" off (ack: all valves off) Trigger Action Irrigation 1 State Script sprinkler 1 stopped Sent INSTEON "Irrigation Controller #1 - f-lawn" off (ack: all valves off) Sent INSTEON "Irrigation Controller #1 - f-patio" off (ack: all valves off) Sent INSTEON "Irrigation Controller #1 - f-hill-lwr" off (ack: all valves off) Sent INSTEON "Irrigation Controller #1 - f-hill-upr" off (ack: all valves off) Sent INSTEON "Irrigation Controller #1 - drive-kitch" off (ack: all valves off) Sent INSTEON "Irrigation Controller #1 - bk-patio" off (ack: all valves off) Sent INSTEON "Irrigation Controller #1 - bk-yd-outer" off (ack: all valves off)
|
| Wed Mar 23, 2011 11:33 pm |
|
 |
|
berkinet
Joined: Nov 18, 2008 Posts: 1721 Location: Berkeley, CA
|
 Re: EZFlora Operating Status BUG?
Matt, Jay: in the script included below, the EZFlora turns on as expected, with the proper zone open. Mar 24, 2011 10:12:50 Sent INSTEON "Irrigation Controller #1 - f-hill-lwr" on (ack: valve 3 on) Trigger Action Irrigation 1 State Script sprinkler 1 running
However, after delay, the off command is not sent by Indigo and the sprinkler remains on. (BTW, turn on device foo for n also works to turn the EZFlora On, but not Off. Also, although the EZFlora always reports its On State as false, if I change turn on to set on state to true the sprinkler turns on. However, set on state to false does nothing. Of course, if I click Stop (all zones off and clear schedule) on the device pane for my EZFlora, that works and Indigo logs something like Sent INSTEON "Irrigation Controller #1 - f-hill-lwr" off (ack: all valves off) So, the question is: How can I turn the EZFlora Off from an AppleScript and is there a Bug in Indigo or the EZFlora? Here is the script: - Code: Select all
tell application "IndigoServer" tell device "Irrigation Controller #1" set zone index to 3 turn on delay 5 turn off end tell end tell
|
| Thu Mar 24, 2011 11:23 am |
|
 |
|
matt (support)
Site Admin
Joined: Jan 27, 2003 Posts: 11689 Location: Texas
|
 Re: EZFlora Operating Status BUG?
The AppleScript turn on, turn off verbs, and on state property are not used by sprinkler devices. Instead there is just the concept of the active zone (zone index). To turn off the sprinkler from AppleScript set the zone index to 0.
_________________
|
| Thu Mar 24, 2011 12:09 pm |
|
 |
|
berkinet
Joined: Nov 18, 2008 Posts: 1721 Location: Berkeley, CA
|
 Re: EZFlora Operating Status
Thanks Matt. So, the turn on, turn on device x for n and set on state to true were NO-OPS. So, the most simple way to control a sprinkler zone, without any need to create an action group, etc is... - Code: Select all
-- First, set the three key variables set sprinklerController to "Irrigation Controller #1" -- Indigo sprinkler device name set zoneIndex to 8 -- Zone number on controller set zoneDuration to 1 -- Irrigation duration in minutes
tell application "IndigoServer" tell device sprinklerController set zone index to zoneIndex delay zoneDuration * 60 set zone index to 0 end tell end tell
Which, when run records these events in the log 2011-03-24 15:33:01 Sent INSTEON "Irrigation Controller #1 - bk-yd-inner" on (ack: valve 8 on) 2011-03-24 15:33:01 Trigger Action Irrigation 1 State 2011-03-24 15:33:01 Script sprinkler 1 running 2011-03-24 15:34:01 Sent INSTEON "Irrigation Controller #1 - bk-yd-inner" off (ack: all valves off) 2011-03-24 15:34:01 Trigger Action Irrigation 1 State 2011-03-24 15:34:02 Script sprinkler 1 stopped 2011-03-24 15:34:02 Sent INSTEON "Irrigation Controller #1 - f-lawn" off (ack: all valves off) 2011-03-24 15:34:02 Sent INSTEON "Irrigation Controller #1 - f-patio" off (ack: all valves off) 2011-03-24 15:34:02 Sent INSTEON "Irrigation Controller #1 - f-hill-lwr" off (ack: all valves off) 2011-03-24 15:34:03 Sent INSTEON "Irrigation Controller #1 - f-hill-upr" off (ack: all valves off) 2011-03-24 15:34:03 Sent INSTEON "Irrigation Controller #1 - drive-kitch" off (ack: all valves off) 2011-03-24 15:34:03 Sent INSTEON "Irrigation Controller #1 - bk-patio" off (ack: all valves off) 2011-03-24 15:34:03 Sent INSTEON "Irrigation Controller #1 - bk-yd-outer" off (ack: all valves off)
|
| Thu Mar 24, 2011 4:35 pm |
|
 |
|
raneil
Joined: Feb 11, 2011 Posts: 32 Location: Grapevine, Texas
|
 Re: EZFlora Operating Status
berkinet wrote:Thanks Matt. So, the turn on, turn on device x for n and set on state to true were NO-OPS. So, the most simple way to control a sprinkler zone, without any need to create an action group, etc is...
Yup, looks like that one works, too. True, it doesn't require a separate Action Group, but for some reason I like your previous suggestion better. It has more of a "set it and forget it" feel to it. Tell the EZFlora exactly what you want it to do, then let it go and do it. In this last one, there's just something about that AppleScript sitting there on idle for the entire watering time seems somehow... I don't know... less "automated". That's part of the fun of it all, though -- there's always another way to skin that cat. As always, thanks for posting.
|
| Thu Mar 24, 2011 8:21 pm |
|
 |
|
berkinet
Joined: Nov 18, 2008 Posts: 1721 Location: Berkeley, CA
|
 Re: EZFlora Operating Status
raneil wrote:...I've hit a snag. I cannot determine the current operating mode of the EZFlora beyond the basic "which zone is on".
Back to the original post in this thread. This is probably obvious, but... By using an AppleScript to control the sprinklers you could easily update variables storing information about the currently running zone (time started, zone number, duration end-time) in Indigo variables. As to seeing a "Schedule" or the schedule state (paused, running, stopped), you create an AS that in turn called the zones for the desired duration in the desired order and call that script a "Schedule." Then you could have multiple "schedules" and could store the schedule name in an Indigo variable as well.
|
| Fri Mar 25, 2011 12:24 pm |
|
 |
|
raneil
Joined: Feb 11, 2011 Posts: 32 Location: Grapevine, Texas
|
 Re: EZFlora Operating Status
berkinet wrote:raneil wrote:...I've hit a snag. I cannot determine the current operating mode of the EZFlora beyond the basic "which zone is on".
Back to the original post in this thread. This is probably obvious, but... By using an AppleScript to control the sprinklers you could easily update variables storing information about the currently running zone (time started, zone number, duration end-time) in Indigo variables. As to seeing a "Schedule" or the schedule state (paused, running, stopped), you create an AS that in turn called the zones for the desired duration in the desired order and call that script a "Schedule." Then you could have multiple "schedules" and could store the schedule name in an Indigo variable as well.
Absolutely -- and I very nearly did just that. Heaven knows it would have been simpler than my current solution. But (as you noted), it would have required that all state changes to the EZFlora be made exclusively by my UI, lest it fall out of sync with the controller (the horror!). Now if the truth be told, I'm the only one actually driving the thing in the first place. So it's not a pressing "real world" concern. Still, I wanted my Control Page UI to accurately reflect the current status of the System, regardless of how it got that way -- besides, the whole HA thing is still new to me, so much of my enjoyment comes from working through the various possible solutions. I'm still kinda like that kid in the Candy Shop. So, I enabled Indigo's logging to an SQLite database. An Indigo Trigger (based on changes to the EZFlora's pseudo-property "Active Zone Name") sends my script off to query the database of recent "Sprinkler" log entries. Based on those, it can accurately determine the current status of the EZFlora: on (schedule) paused (schedule) on (manual) off And the UI is updated accordingly.
|
| Fri Mar 25, 2011 1:24 pm |
|
 |
|
berkinet
Joined: Nov 18, 2008 Posts: 1721 Location: Berkeley, CA
|
 Re: EZFlora Operating Status
raneil wrote:..So, I enabled Indigo's logging to an SQLite database. An Indigo Trigger (based on changes to the EZFlora's pseudo-property "Active Zone Name") sends my script off to query the database of recent "Sprinkler" log entries. Based on those, it can accurately determine the current status of the EZFlora:
on (schedule) paused (schedule) on (manual) off
And the UI is updated accordingly.
Very nice. Sounds like you got this one covered.
|
| Fri Mar 25, 2011 1:48 pm |
|
 |
|
ckeyes888
Joined: Nov 26, 2009 Posts: 924 Location: Kalispell, MT
|
 Re: EZFlora Operating Status
Curious raniel how the text fields are populated in your screens..e.g. "Idle since yesterday at 7:01 pm"? Just getting my irrigation up and running using an EzFlora, great fun. Hardware install, 15 min, software install....til I abandon it.
Carl
|
| Tue Jun 21, 2011 1:26 pm |
|
 |
|
ckeyes888
Joined: Nov 26, 2009 Posts: 924 Location: Kalispell, MT
|
 Re: EZFlora Operating Status
Having some fun with a newly installed EZFlora...here's a few control screens:
Attachments:
EZFlora Control Pages.jpg [ 334.82 KiB | Viewed 655 times ]
|
| Sat Jun 25, 2011 5:36 pm |
|
|
|
Page 2 of 2
|
[ 30 posts ] |
Go to page: Previous 1, 2 |
Who is online |
Users browsing this forum: Bing [Bot] and 0 guests |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot post attachments in this forum
|
|