Page 1 of 1

Variables are kicking my butt

PostPosted: Wed Mar 22, 2023 8:59 am
by BruceP
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

Re: Variables are kicking my butt

PostPosted: Wed Mar 22, 2023 10:17 am
by tatrog
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.

Re: Variables are kicking my butt

PostPosted: Wed Mar 22, 2023 1:11 pm
by BruceP
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

Re: Variables are kicking my butt

PostPosted: Wed Mar 22, 2023 2:22 pm
by tatrog
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

Re: Variables are kicking my butt

PostPosted: Wed Mar 22, 2023 2:30 pm
by BruceP
Ahhhhhhh. light bulb glows.

I think I got it.

Thank you

Re: Variables are kicking my butt

PostPosted: Wed Mar 22, 2023 2:30 pm
by jay (support)
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