Dave w Posted July 12, 2017 Share Posted July 12, 2017 What I'm trying to accomplish: When Master Door A or B or C = Open for 5 mins+ Turn Off AC. When ALL are Closed return AC back to Normal. This is the script I wrote....but its not working to shut AC off. I think the timer is the issue. Any thoughts? (assume devices, timer, and variable have proper names) When Door A opens Set Var +1 When Door A Closes Set Var -1 When Door B opens Set Var +1 When Door B Closes Set Var -1 When Door C opens Set Var +1 When Door C Closes Set Var -1 When Var Changes If > 0 Set Timer 5 mins If = 0 Set AC = Normal Stop Timer When Timer Expires Set AC = Off Quote Link to comment Share on other sites More sharing options...
martymohr Posted July 12, 2017 Share Posted July 12, 2017 If I'm understanding correctly - you want the AC off if a door has been opened for more than five minutes, and when all doors are shut, turn back on the AC. Now I don't have any way of testing this, and I don't like "when variable changes," so give this code a try and let me know if it works. Might need some additional tweaking. When DoorA opens do DoorOpenMacro !I like macros - helps keep code in one place When DoorA closes do DoorCloseMacro etc. --- DoorOpenMacro DoorVar += 1 if DoorVar = 1 !if more than one we've already done this ACVar = status of AC !need to know status of AC - it could be off - like in winter (if you need help with this code let me know) if ACVar = on Start 5MinuteTimer --- DoorCloseMacro DoorVar -= 1 if DoorVar = 0 Stop 5MinuteTimer !this line of code is actually not necessary - can wait till timer expires if ACVar = off start AC --- When 5MinuteTimer expires if DoorVar > 0 !is door still open? stop AC ACVar = off Home Theater Advisors, DiZiTech and South Africa C4 user 3 Quote Link to comment Share on other sites More sharing options...
tebery Posted July 12, 2017 Share Posted July 12, 2017 Years ago I had a script that made an announcement 'There is a window or door open and the A/C is on'. It annoyed the hell out of my family, but they got the hint and it doesn't happen anymore South Africa C4 user, Home Theater Advisors and SMHarman 3 Quote Link to comment Share on other sites More sharing options...
South Africa C4 user Posted July 12, 2017 Share Posted July 12, 2017 Another option (if you are using a security system and driver that supports groups - e.g. DSC) is to create a group that includes all the relevant doors and windows. When the group is activated (one open) you turn off the air con (or, if you want a 5 minute delay, use a timer and now check if the timer is running, if not start the timer - when the timer expires turn off the aircon) and when it is deactivated (all closed) you turn the aircon back on (and stop the timer if you are using one). You (actually your dealer) can also link the group to an Experience button that will show you if anything is open or if everything is closed... Quote Link to comment Share on other sites More sharing options...
alanchow Posted July 12, 2017 Share Posted July 12, 2017 When Door A opens If Timer is not running Restart Timer When Door A Closes if door a is closed if door b is closed if door c is closed Stop Timer When Door B opens If Timer is not running Restart Timer When Door B Closes if door a is closed if door b is closed if door c is closed Stop Timer When Door C opens If Timer is not running Restart Timer When Door C Closes if door a is closed if door b is closed if door c is closed Stop Timer When Timer Expires Set AC = Off Home Theater Advisors and DiZiTech 2 Quote Link to comment Share on other sites More sharing options...
Dave w Posted July 13, 2017 Author Share Posted July 13, 2017 Thanks. I like the simplicity of the groups options. I am using DSC Neo.....any idea how I create groups? Quote Link to comment Share on other sites More sharing options...
DiZiTech Posted August 6, 2021 Share Posted August 6, 2021 Alanchow thenk you, I tried your code and it works but can you add some more lines in order to check first if the AC was ON and all the contacts are closed to turn on the AC? Quote Link to comment Share on other sites More sharing options...
DiZiTech Posted October 22, 2021 Share Posted October 22, 2021 Ok find it. When AC is on if door A is open if door B is open if door C is open delay 3 seconds set AC is off. Thank you all! Quote Link to comment Share on other sites More sharing options...
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.