timdenike Posted March 8, 2012 Posted March 8, 2012 Hey all, Hoping I could get some thoughts on a funny problem.. I've got a CatGenie automated catbox. It's connected to a Synchrolinc to sense when it's running. Currently the following program sends me an email whenever it runs. CatGenie Trigger: if Control 'CatGenie Sensor' is switched On Then Run Program 'CatGenie Run' CatGenie Run: Then: Disable Program 'CatGenie Trigger' Set 'CatGenie Exhaust Fan' On Send Notification to .... Wait 40 minutes Set 'CatGenie Exhaust Fan' Off Enable Program 'CatGenie Exhaust' This works swell, although the email isn't terribly helpful, aside from knowing my CatGenie is working when I'm away. What I'd LOVE is an email only if the CatGenie hasn't run in 9 hours. (Or better yet, 4 hours, with a gap overnight when the CatGenie doesn't run.) Is this getting too advanced? I figured I'd try to solve this externally, but thought I'd try here first.
Michel Kohanim Posted March 8, 2012 Posted March 8, 2012 Hello timdenike, The answer is the use of Wait. As you may know, Wait and Repeat are interruptible. This means that while a program is waiting in the Wait statement, if the condition turns to false, the the program exits and the rest of the statements after Wait are NOT executed. So, if you put a Wait (4 hours) at the beginning of the Then statement for your programs, the ONLY way the rest of the statements after Wait are executed is if and only if the condition has not changed for that duration. With kind regards, Michel
timdenike Posted March 8, 2012 Author Posted March 8, 2012 Aha! That's very helpful. I added the following: CatGenie Alert: If $Int_1 is 0 # default value and From 8:00am to 11:59pm (same day) # Time when CatGenie and me sleep. Then: Wait 4 hours # will likely tune this higher Send email # alert me that something's wrong. Added set Int_1 to 1, then a subsequent set Int_1 back to 0 in my CatGenie Run program to abort the previous program. I'll see tomorrow how it goes. Many thanks - this is awesome. It's great to know everything's running smoothly when I'm away - if I get this email, I can have a friend stop by to avert a disaster. Tim
Recommended Posts