[ANSWERED]Failed Condition Return

Posted on
Sat May 17, 2014 9:12 am
cutmoney offline
Posts: 35
Joined: Dec 22, 2011

[ANSWERED]Failed Condition Return

I'm running Indigo 6 and I've recently installed a sprinkler system controlled by Indigo. I've thought about it for a while, but am still trying to figure out the most ideal way to run condition based schedules. Ideally, I'd like to set a variable based on whether all of the weather conditions have been met. That I don't have a problem with. My question is whether there's a way to return a negative if a set of conditions fails. In other words, I would like to do one of two things: (1) run a schedule every 30 minutes to check weather conditions (which I have done) and set "WeatherConditions" variable to true. If it fails any of the conditions in the schedule, it will change the variable to false. That way, when I run my sprinkler programs I can check that universal weather condition variable. This way I can edit one set of conditions rather than make a new set in each sprinkler schedule. (2) Run the set of conditions in the sprinkler schedule and, if it fails, have some way to return either a notification or do some other task.

Let me know if either of these options are possible. Essentially, I'm wondering if there is the ability to do an "Else" when running conditions.

Posted on
Wed Jun 18, 2014 5:18 am
howartp offline
Posts: 4559
Joined: Jan 09, 2014
Location: West Yorkshire, UK

Failed Condition Return

cutmoney wrote:
Essentially, I'm wondering if there is the ability to do an "Else" when running conditions.

Not in the GUI, yet.

I converted any scenario that needs this to a python script.

Don't have any condition in the schedule, then set the action to run a python script.

allTrue = True
if indigo.devices[Temperature].sensorValue < 31:
allTrue = False
if indigo.devices[RainCount].sensorValue > 50:
allTrue = False

Etc

indigo.variables[Weather] = allTrue

Something like that - not sure the last line is correct for updating a variable, but you get the gist.

Peter



Sent from my iPhone using Tapatalk

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 3 guests