beachfront71 Posted January 24, 2012 Posted January 24, 2012 Hi and thanks for any assistance. I currently have a program that states: If Garage Door Sensor is On Then notify me So I get a text everytime the garage door opens .. Which after 2 days is alot .. So I would like to modify this but can not figure it out ... I want to say something like: If Garage door sensor is on Wait 5 minutes If garage door sensor is still on Notify the goal is that if I come home/or leave, open garage, and then close garage when I get into house or car ... I do not get notified.. but If am leaving .. open garage .. leave it open for more than 5 minutes .. I get a notification ... I hope that makes sense? Was hoping i could add nested if statements but do not see how ... Or will this take 2 programs to accomplish this? Thanks and if there are any questions let me know.
oberkc Posted January 24, 2012 Posted January 24, 2012 This may actually be quite simple, given the way programs are triggered and how wait (and repeat) statements work with the ISY. How about: If Status Garage Door Sensor is On <<then wait 5 minutes Then notify me else The beauty of this is that if the status changes during the 5 minute wait period, the program execution will be halted and re-run, based on the newest evaluation and status.
beachfront71 Posted January 25, 2012 Author Posted January 25, 2012 Thanks OberKc.. I also added a If sensor is off then notify ... so now I get a text when garage is opened and when closed .... The goal (revised) would be If you open garage, walk into house, and close garage within 5 minutes ... I do not want a notice as that is normal arriving or leaving behavior.. But.. If you open garage and it stays open for longer than 5 minutes ... then notify "garage open" Now when it closes after the being open longer than 5 minutes .. notify "garage closed" So you come home open garage and 5 minutes later I get a notify, then you close garage later in the day, I also get a notify it has been closed... Also just noticed a variables sub forum so apologies there ...
oberkc Posted January 25, 2012 Posted January 25, 2012 I believe your level of complexity just went one step higher. I don't have exact syntax memorized, so I will offer a conceptual suggestion, hoping that it will give you enough clues or ideas that you can fill in the blanks. Create an integer variable, call it IGarage. Modify the first program as follows: If Status Garage Door Sensor is On then wait 5 minutes set IGarage = 1 <<< a condition indicating that the door was open for at least five minutes Then notify me (garage is open) else run new program (if path) Create a new program, if IGarage = 1 then send notify me (garage is closed) set IGarage = 0 <<else set IGarage = 0 One could actually accomplish this logic without variables if that has value to you, but I see no reason not to take advantage of them given that they exist.
Recommended Posts