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
time.sleep(15)
# turn off the zone
indigo.sprinkler.stop(sprinkler)
# sleep for 300 seconds only if this isn't the last zone
if zone_number != last_zone_index:
time.sleep(300)
Untested but it should be close.