markf Posted June 18, 2020 Posted June 18, 2020 My goal is to make it so that if a window or door is opened for longer than 5 minutes that the HVAC goes to off and then when everything is closed the HVAC goes back to auto. Here's what I did: When the window opens set the "window open" variable to true. When the "window open" variable changes if it is true then start the "window open" timer, otherwise set HVAC to auto When the "window open" timer expires, if window 1 is open, or if window 2 is open or if window 3 is open etc. set HVAC to off, otherwise stop the "window open" timer This seems to work most of the time but there are some situations where it doesn't. For what it's worth, this seems to work well downstairs where the HVAC is a Nest but upstairs where I have an Ecobee it seems little inconsistent. Has anyone else come up with a better way to implement something like this? Do you see any obvious issues with what I've done? Thanks for the help. Quote
DLite Posted June 19, 2020 Posted June 19, 2020 I do the same thing. I won't claim that my code should be the "best-practice" example, but here is how I do it. For each HVAC zone, I have a variable that counts the number of open windows/doors. Every time a contact in the relevant zone opens, the zone open windows/doors variable gets incremented by one. Whenever a contact closes, it gets decremented by one. (I have a safeguard in the code that prevents it from dropping below zero, just in case C4 misses an opening.) When the variable changes values to something greater than zero, it restarts a 5-minute timer -- if the timer is not already running. When the variable changes values to zero, the timer stops and the Ecobee is set to auto mode. If the timer expires, it sets the Ecobee to off. I hope this helps. Quote
markf Posted June 19, 2020 Author Posted June 19, 2020 Thanks, DLite. It sounds like we're doing similar things. I appreciate the response. That is really helpful. Quote
markf Posted June 24, 2020 Author Posted June 24, 2020 @DLite I switched to your way, using the numeric variable, and things work flawlessly. It was way simpler and more elegant than all of my "ifs" and "ors." Count goes up when things open, down when they close, opening starts the timer, HVAC goes off when it expires, timer stops when everything is closed and HVAC goes back to auto. Thanks again. DLite 1 Quote
Neo1738 Posted June 27, 2020 Posted June 27, 2020 I would just do a timer that you can do when a contact opens. If window x open start timer y. If that timer expires turn off HVAC unit. If windows x closed stop timer, reset timer. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.