Need some help putting the finishing touches on this rule. My goal is to have the thermostat shut off if any of the windows are open when the thermostat is in either heating or cooling mode. Right now my rule below works great if one of the windows does open, it shuts my Ecobee down. However I would also like this same rule to check and see if any windows are already open if someone tries to turn on the thermostat from the off state.
Do I need to create a separate rule or can that be built on top of this?
Maybe create a standalone rule that monitors all windows and tie that to a master open/close device. Then, your rule here just has to bang against that master open/close. I think someone here, maybe @Cobra , actually built an App for window sensor monitoring. You may be able to integrate that into your design somehow.
It is called Check Open Contacts http://hubitat.uk/
Is there a specific reason why you need to know if the unit is heating or cooling? Wouldn't just a window being open be enough for you to want the unit off?
I made two rules to monitor the windows. The first rule says that if "any" window opens, then turn the unit off. The second rule says that "all" windows have to be closed to turn the unit on. I use a virtual switch to drive some other automation (house fan).
Your original concept would work in a single rule. You want contact sensors and thermostat mode to cause the rule to be evaluated, right? I think the lack of parentheses to group your two thermostat conditions in your first screenshot is messing it up. It will execute true actions any time a contact is open and mode is cool, or any time mode is heat.
Try this:
Conditions:
[contact sensor list] any open
Thermostat off
Rule (need to enable complex input option):
[contact sensor list] any open
AND
NOT(Thermostat off)
Actually, that may have helped me. I might have been over thinking things with the "any" vs. "all" logic. I changed my any rule and it seems to be working just fine. One less rule