Enable/disable a rule using another rule?

Background: I’ve got a ranch style house that has a long north/south aspect ratio, with 2 HVAC units. The south HVAC handles all the common areas (LR, Den, Dining, etc), as well as the master bedroom. The north HVAC only handles my son’s bedroom, and 2 additional guest bedrooms. During the summer, my son spends very little time in his room (he even ends up sleeping on the floor in the den), and if we have no guests I can leave the north HVAC turned off.

Using smartthings, Sensi thermostats, and the sharptools rule engine, I’ve successfully created rules to switch either of the HVAC systems into heating or cooling mode based on inside or outside temperature (basically, if it gets too hot inside or outside, put it into cooling mode, and vice versa). This rule has worked perfectly for the south HVAC, which is always on. I’ve got the same rule for the north HVAC, but keep the rule disabled when the north HVAC is not needed.

My question: Is it possible to switch a rule from “disabled” to “enable” based on a trigger of another rule (for example, setting an “OvernightGuests” variable to “true”)?

Hi @Jim_Westland, welcome to the community!

Yup, you can create a $overnightGuests variable and use it in an IF_Condition as the first activity in the rule flow, and add mode change or temperature adjustment actions in the THEN path. So this north HVAC rule will be triggered based on the inside/outside temperature just like your source HVAC rule, but only take actions if the variable value is true. Then you can add this $overnightGuests variable as a tile to the dashboard, and it will toggle when tapped, and acts as the “enable/disable” control for your north HVAC rule.

Well, that makes complete sense. And now that I think about it, I can probably include a north A/C setpoint change via a variable that changes based on the condition of the $OvernightGuests variable (if we have guests, we want them to be comfy; if we don’t then we set the temp higher but keep the system on).

Thanks for the idea.


Hi I’m looking for a similar solution for another challenge, as I have lot’s of rules that I don’t want to work when I’m leaving the house for a weekend for example, and a rule that controls other rules will be very useful, - so in the meantime I understand that I have to add for each and every rule aN If condition set to off when mode is “away”?

@lior_zilber, yes you can add an IF condition either with the away mode or a variable to determine if the rule should continue execution or just exit early.