[FIXED]: Error in Sprinkler Documentation

Posted on
Sat May 10, 2014 9:57 am
wikner offline
Posts: 181
Joined: Nov 02, 2003

[FIXED]: Error in Sprinkler Documentation

Re the documentation for how to script sprinklers, I believe I found an error. I refer to the documentation here:
http://www.perceptiveautomation.com/wiki/doku.php?id=indigo_6_documentation:device_class#sprinklerdevice

Under Commands (indigo.sprinkler.*)/Run Schedule/Parameters/schedule we have
list of integers representing the number of minutes to run for each zone - the list must have [zoneCount] elements, with 0 for any zone that shouldn’t run


In fact the numbers in the list may be reals. I ran the following:

Code: Select all
>>> s = indigo.devices[122151062]
>>> indigo.sprinkler.run(s.id, schedule =[1.5,1.5,0,0,0,0,0,0])

No errors were given. I went outside and verified that the two first zones ran for 90 minutes each.

Posted on
Sat May 10, 2014 10:06 am
wikner offline
Posts: 181
Joined: Nov 02, 2003

Re: Error in Sprinkler Documentation

Oops. I mean 90 seconds each.

Posted on
Sat May 10, 2014 11:18 am
SpencerJRoberts offline
User avatar
Posts: 256
Joined: Dec 09, 2012
Location: Mountain View, CA

Re: Error in Sprinkler Documentation

I'm not seeing the error, 1.5 minutes is 90 seconds. The numbers represent the minutes you want to run each zone.

Posted on
Sun May 11, 2014 6:50 am
wikner offline
Posts: 181
Joined: Nov 02, 2003

Re: Error in Sprinkler Documentation

The error is in the documentation, which states that the durations have to be integers. They don't have to be integers. They may be reals.

Posted on
Sun May 11, 2014 8:37 am
SpencerJRoberts offline
User avatar
Posts: 256
Joined: Dec 09, 2012
Location: Mountain View, CA

Re: Error in Sprinkler Documentation

Ah, gotcha

Posted on
Sun May 11, 2014 10:54 am
matt (support) offline
Site Admin
User avatar
Posts: 21426
Joined: Jan 27, 2003
Location: Texas

Re: Error in Sprinkler Documentation

Thanks for reporting this -- I've corrected the documentation to reals.

Image

Posted on
Sun May 11, 2014 5:28 pm
wikner offline
Posts: 181
Joined: Nov 02, 2003

Re: Error in Sprinkler Documentation

You're welcome. I have some additional comments about the Python API for the sprinklers which might be of use to others. I don't know if I should post them here or somewhere else; please redirect this to the appropriate place if necessary.

I was looking for a mechanism to detect whether a running schedule is paused, or whether the schedule is finished. I want to be able to detect both. It is clear that Indigo knows this, as it shows up in the UI. The UI even shows how much time is left in the current zone within which it is paused. There is no direct call to determine the paused state, but I found a way to detect it. I can trigger off of Active Zone Name Becomes Equal to 0. If the sprinkler is paused, indigo.devices[<sprinklerID>].activeZone will return None, whereas indigo.devices[<sprinklerID>].zoneScheduledDurations will return a non-empty list. On the other hand, if the sprinkler has run off the end of its schedule, then activeZone will also return None, but zoneScheduledDurations will return an empty list.

There is still no direct way to find out what zone in the schedule was running when the pause occurred, nor to query how much time is left in that zone; however, if I start the schedule from a Python script I can record a time-stamp in an Indigo variable, then when the pause occurs, calculate the paused zone and time left in that zone from the soneScheduledDurations list.

Since this is a bit of a hack, my question is do you think this behavior will continue to work, or do you anticipate changing the zoneScheduledDurations behavior? Is there any chance you might add a direct method for querying the Paused state and the timeLeftInZone value?

Posted on
Wed Jun 25, 2014 9:47 pm
matt (support) offline
Site Admin
User avatar
Posts: 21426
Joined: Jan 27, 2003
Location: Texas

Re: Error in Sprinkler Documentation

Indigo 6.0.13 is now available, and includes 2 new attributes: pausedScheduleZone and pausedScheduleRemainingZoneDuration. I believe they'll do what you expect. Note they both return None if the schedule is not paused.

Image

Posted on
Thu Jun 26, 2014 5:08 am
wikner offline
Posts: 181
Joined: Nov 02, 2003

Re: Error in Sprinkler Documentation

WOW! Thanks. That will make my coding life a lot easier.
I am amazed and very pleased about your fast response time on this.
Thanks again. :D

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 1 guest