How to use "or" in if condition

I’m trying to build a rule to change the thermostat setting with time of day, thermostat temp settings and several presence sensors.

I have the trigger set to thermostat changes and is above 77 degrees with the flow set at the time between 10 AM and 5 PM and person 1 is present when all conditions are met. This works fine but I want to add additional presence sensors to the mix. If I leave it to all conditions are met the rule will only fire if all sensors are present and if I change the “all” to “or” the rule would fire if no one is present.

Is there a way make this work without building a rule for each presence sensor?

Hi @Scunny, you can use nested If_condition in this case. See the example below that I made the 2nd (nested) If_condition logic to “Any” (OR), so the fanOn command will only be executed if it’s during 10am-5pm, and either person is at home.

Let me know if this helps. :grinning:

2 Likes

That makes sense, thanks for the quick reply.

1 Like