Delay sprinkler operations

Posted on
Wed Oct 17, 2018 5:10 pm
d3h872 offline
Posts: 15
Joined: Jul 08, 2012

Delay sprinkler operations


I'm trying to set up an Action Group to blow out our sprinklers:

(1) Turn on Zone 1
(2) Wait 15 seconds (purge zone 1 of water for this time)
(3) Turn off all Zones
(4) Wait 300 seconds (for the air compressor to recharge)
Then repeat steps 1-4 for each zone

The problem is that the wait/delay commands I've tried don't actually delay the next command. Maybe I'm misunderstanding how this is accomplished?

- Ryan
Screen Shot 2018-10-17 at 4.09.59 PM.png
Screen Shot 2018-10-17 at 4.09.59 PM.png (240.89 KiB) Viewed 432 times

Posted on
Thu Oct 18, 2018 3:46 pm
jay (support) offline
Site Admin
User avatar
Posts: 16198
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Delay sprinkler operations

Indigo is attempting to run all those actions at the same time (we attempt to parallelize actions as much as possible as that's what people normally want).

Rather, you should put it all in one python script file (it has to be an external file since it's going to take time to run):

Code: Select all
import time

# Adjust the following to match your system
sprinkler = indigo.devices[1234567890] # change 1234567890 to the ID of your sprinkler device
zone_index_list = [1, 2, 3, 4, 5, 6, 7, 8] # change this list to be a list of each zone that's defined for your sprinkler

# Get the index of the last zone in the list
last_zone_index = zone_index_list[-1]
for zone_number in zone_index_list:
    # turn on zone_number for sprinkler
    indigo.sprinkler.setActiveZone(sprinkler, index=zone_number)
    # sleep 15 seconds while the zone is on
    # turn off the zone
    # sleep for 300 seconds only if this isn't the last zone
    if zone_number != last_zone_index:

Untested but it should be close.

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Fri Oct 19, 2018 11:59 am
d3h872 offline
Posts: 15
Joined: Jul 08, 2012

Re: Delay sprinkler operations

Awesome Jay, thanks so much! I'll try it out.

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 0 guests