Variables are kicking my butt

Posted on
Wed Mar 22, 2023 8:59 am
BruceP offline
Posts: 285
Joined: Sep 06, 2004

Variables are kicking my butt

I have yet to master the use of variables and conditions. I also do not understand programming, I am just using the software options.

I have a pump that I would like to have run at a set time if the outdoor temperature is above 50 degrees.

I have the outdoor temperature, at 5:30am, sent to "weather_temperature_F variable". this is working as it should.

At 5:45am I want the pump to run if temp is above 50 degrees and two other conditions. I have the following:

if Conditions match rules:
ANY of the following rules are true:
if variable. isHoliday is false
if variable. Onvacation is false
if variable Weather_Temperature_F is greater than value 50

I verified that the isHoliday and Onvacation are set to false. Today the temperature in the variable was 45 degrees and the pump was running.

What am I missing?

Thank you

Posted on
Wed Mar 22, 2023 10:17 am
tatrog offline
Posts: 39
Joined: Nov 16, 2013

Re: Variables are kicking my butt

change ANY to ALL. as it is now if any of the three condition are met it will run. I think you are want to make sure ALL three condition are met.

Posted on
Wed Mar 22, 2023 1:11 pm
BruceP offline
Posts: 285
Joined: Sep 06, 2004

Re: Variables are kicking my butt

I will try that, but somehow, again not really knowing the difference between Any and All. I want this to only turn on the pump if:

I am not on vacation/I am at home
It is not a holiday/I am sleeping in
And outside temp is above 50 degrees

Posted on
Wed Mar 22, 2023 2:22 pm
tatrog offline
Posts: 39
Joined: Nov 16, 2013

Re: Variables are kicking my butt

In your case you have three conditions that all need to be looked at and met before taking action. So when you select ALL it will test each condition and each must be met before running. When you select ANY it will still test all three but if any of them are met (for example is Holiday False) it will take action regardless if the other two are met. In your example above the temp was less lan 50 but this action still ran. This is because the other two conditions were met under ANY. By using ALL each of the three conditions must be met before running.

GT

Posted on
Wed Mar 22, 2023 2:30 pm
BruceP offline
Posts: 285
Joined: Sep 06, 2004

Re: Variables are kicking my butt

Ahhhhhhh. light bulb glows.

I think I got it.

Thank you

Posted on
Wed Mar 22, 2023 2:30 pm
jay (support) offline
Site Admin
User avatar
Posts: 18216
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Variables are kicking my butt

BruceP wrote:
I will try that, but somehow, again not really knowing the difference between Any and All. I want this to only turn on the pump if:

I am not on vacation/I am at home
It is not a holiday/I am sleeping in
And outside temp is above 50 degrees


This is called boolean logic. When you have multiple conditions, then either they all have to be true (if you say AND between them) or any one of them are true (you say OR between them).

In your case, you would actually read it as:

BruceP wrote:
I am not on vacation/I am at home
AND
It is not a holiday/I am sleeping in
AND
And outside temp is above 50 degrees

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 1 guest