One condition linked to multiple boolean variables

I have been playing with Apilio and IFTTT this week trying to create some interesting automation for our new whole house fan.

My house has eWelink sensors for all my windows and temperature. Where I live it is commonly too hot to start the fan when I go to sleep (A/C still running), but at some point it makes a ton of sense to turn off the A/C and run the fan instead. Fancy automation!

So, I have boolean variables for all of my windows, and a numeric variable for my temperature (from the sensor). They get updated via eWelink-> Apilio via IFTTT. Basically, if the temp outside drops to some threshold AND at least one of my windows is open, then I turn on the fan (and turn off my Honeywell thermostat).

My issue is that the conditions seem unnecessarily too simple or I just don’t understand them right.

I would like these two conditions:

  • all_windows_closed (this is true only if the variables for all windows are all FALSE).
  • three_plus_windows_open (true, as the name implies, when at least 3 windows are open because if not, I want to run the fan on low speed instead of high speed).

So, I don’t understand why a condition cannot natively just have some boolean logic based on a number of variables to set the condition. I don’t see the point of having a condition created for each of the variables to simply tell me the same information that I get from the TRUE/FALSE status of the variable to begin with. It seems redundant. Am I missing how it works? Is it necessary to create a separate condition for each of the window state variables and then create a logicblock that triggers an IFTTT action which simply sets a new variable of all_windows_closed to true? It doesn’t seem like I can do this within Apilio, but since the state of the variables is all in there, is there a way to just do this within Apilio?

I would also like to create a numeric variable called open_window_count which will simply get incremented or decremented when any window sensor is toggled from open to closed or vice / verse.

Are these things possible? Do you have more documentation on this?

2 Likes

Hi @miike!
Generally, I agree with what you are saying.
I think you want to have three scenarios: A/C on, Low Fan, High Fan (is there a fourth one “A/C off, no fan”?).
It is correct that for every boolean variable, one usually has a corresponding condition. It might be redundant in many cases, but conditions add a bit of more flexibility of how to interpret a Boolean variable.

To have a numeric variable for open_window_count sounds like a great idea! You can increase/decrease it with ever window open/close event.

So you could have three Logicblocks, one for each scenario above:

  1. A/C on: hot_outside AND all_windows_closed => Actions: Fan off, A/C on
  2. Low Fan: cold_outside AND few_windows_open => Actions: Fan on low speed, A/C off
  3. High Fan: cold_outside AND many_windows_open => Actions: Fan on high speed, A/C off
  4. A/C off: hot_outside AND (few_windows_open OR many_windows_open) => Actions: Fan off, A/C off

Here’s a documentation on how to use numeric variables: How to update a numeric variable via IFTTT

1 Like