skunkiechris Posted May 28, 2009 Posted May 28, 2009 I have a few programs that I've written to check weather conditions. Basically, they're all scheduled to run at 11:59:00, and are very simple -- things such as 'If time is 11:59:00 and total rainfall is >.1"', 'If time is 11:59:00 and high temperature is > 70 degrees', etc. I use these to check the true/false status the next day for making determinations on whether to run the sprinklers and for how long. My question is this: Yesterday is the first day that I've had rain since I set these up. I checked this morning, expecting to see one of them true, but they were all still false. Looking further, all of the weather related programs ran at 12:00:57. (They show a next run time tonight at 11:59:00.) I looked through my list of programs, and all of the others show a last run of exactly their scheduled time. Why would these have started almost two minutes late? In this case it makes them worthless, since they pick up the weather conditions for the wrong day... Thanks!
skunkiechris Posted May 28, 2009 Author Posted May 28, 2009 I think I answered myself... it wasn't actually running late. I had both the time & climate conditions in the same "If" clause. I didn't realize that would cause it to be evaluated each time the climate condition changed. I moved those programs into a folder that has a time condition on it, and now each program only has its specific climate condition to check. That should fix it I think? Thanks!
skunkiechris Posted May 29, 2009 Author Posted May 29, 2009 Okay, well that didn't work either. Even though the folder only ran at 11:59 last night, the programs are still running whenever there is a change in the climate conditions I'm checking. I don't understand why the programs are running inside the folder when the folder conditions aren't met. Despite the folder limitation, the 'Last Run' for this program shows at 5:22 AM today. How do I make this work?? Help! Here is an example: Folder code: Folder Conditions for 'Daily Checks' Add conditions to limit when programs in this folder are allowed to run. If Time is 11:59:00PM Then Allow the programs in this folder to run. Program in that folder: If Module 'Climate' Rain Today >= 0.1 " And Module 'Climate' Rain Today < 0.2 " Then - No Actions - (To add one, press 'Action') Else - No Actions - (To add one, press 'Action')
Sub-Routine Posted May 29, 2009 Posted May 29, 2009 Hi Chris, I think you need an End time for the folder. Folder Conditions for 'Evening' Add conditions to limit when programs in this folder are allowed to run. If From 11:57:00PM For 3 minutes Then Allow the programs in this folder to run. Rand
skunkiechris Posted May 29, 2009 Author Posted May 29, 2009 Hi Chris, I think you need an End time for the folder. Folder Conditions for 'Evening' Add conditions to limit when programs in this folder are allowed to run. If From 11:57:00PM For 3 minutes Then Allow the programs in this folder to run. Rand Thanks, I'll give that a try. Using the "Time is" folder condition, why would it allow it to run when it is not that time?
Sub-Routine Posted May 29, 2009 Posted May 29, 2009 Thanks, I'll give that a try. Using the "Time is" folder condition, why would it allow it to run when it is not that time? I would have to experiment to be sure but I think the folder is activated at that time and never deactivated. A folder is different than a program in that way. A program would just run until it ends, but a folder never performs any actions so it can never 'finish'. Maybe we should delete the Time is from the dropdown for folders and only allow the use of From. Plus I would suggest letting it remain active for more than an instant in case the ISY is busy at that exact moment. That is what I thought happened in your first post. Rand
skunkiechris Posted May 29, 2009 Author Posted May 29, 2009 Ahhh, well that makes sense. That also explains why I was having trouble isolating the problem. I was making changes (using temperature to test since it changes frequently), and it would appear to work correctly - not running. Then the next day, it didn't seem to anymore. I was messing with the folder program as well, so now it makes sense -- when it was new everything looked correct, but then the next day it had passed the "activation" time, and was allowing things to run. I changed it as you suggested, I'll see what happens in the morning. Thanks for your help, I would have been driving myself nuts over that one!
skunkiechris Posted May 30, 2009 Author Posted May 30, 2009 Well, that didn't work either. The folder condition is: Folder Conditions for 'Daily Checks' Add conditions to limit when programs in this folder are allowed to run If From 11:57:00PM For 2 minutes and 50 seconds Then Allow the programs in this folder to run. None of programs ran at all last night. It almost seems like they will only run when the condition they are checking changes? Since I'm checking "Rain Today" and it did not change during those three minutes, they programs didn't run. If that's indeed how it's working, it doesn't seem like it makes the most sense... Any ideas?[/code]
Sub-Routine Posted May 30, 2009 Posted May 30, 2009 Program in that folder: If Module 'Climate' Rain Today >= 0.1 " And Module 'Climate' Rain Today < 0.2 " Then - No Actions - (To add one, press 'Action') Else - No Actions - (To add one, press 'Action') Was the Rain Today between 0.1 and 0.2 inches? This should run every time your weather is updated (60 seconds by default). Is the Last Run Time at 11:59:xx? To make it easier to test change the folder time to a few minutes from when you read this. Rand
skunkiechris Posted May 30, 2009 Author Posted May 30, 2009 Well I have several of those programs covering various rainfalls. But no, that's my point -- the last run time for all of them is yesterday afternoon when I had the times off the folder for testing. None of the rain or high temp programs in that folder ran at all last night. I just tried updating the time to a few minutes away, then watched -- still no run. When I have no folder restrictions at all, the rainfall programs only seem to run when there is an actual change to the 'rainfall today' item -- not each time the weather updates (every 75 seconds in my case.) Weird?
Michel Kohanim Posted May 31, 2009 Posted May 31, 2009 sknunkiechris, Hello. I've been watching this thread and I hope I can clarify a few things: 1. When it's 11:59:00 and for the next 3 minutes, the programs in the folder "are allowed" to be re-evaluated. This does NOT mean that as soon as it's 11:59, they are automatically re-evaluated 2. If in those 3 minutes none of the weather variables change and specifically the one you are looking for, then nothing will happen since nothing has changed I think what you may want to do is to force re-evaluation (using Run-If) during those 3 minutes. With kind regards, Michel
skunkiechris Posted May 31, 2009 Author Posted May 31, 2009 Well that would explain the behavior, thank you! So I should have a program in that folder that is called during those three minutes that runs all of the other programs?
Michel Kohanim Posted May 31, 2009 Posted May 31, 2009 Hi skunkiechris, It all depends on what you are trying to accomplish. If your goals is to limit the evaluation to that interval only, then yes. If not, please let me know what it is you are trying to accomplish and we'll figure out the best way to handle it. With kind regards, Michel Well that would explain the behavior, thank you! So I should have a program in that folder that is called during those three minutes that runs all of the other programs?
skunkiechris Posted May 31, 2009 Author Posted May 31, 2009 Yes, basically I'm trying to capture the total rainfall for the day so that I can determine whether to let the sprinklers run the following morning. So I'm running a bunch of programs to determine the rainfall -- 0 - .1", .1 - .2", etc. I only want those programs to run just before midnight (when the total rainfall resets.) I'm assuming now that should limit the folder to, say, 11:58 for 2 minutes, put all those programs in the folder, and then put an additional program in the folder that does something like 'If Time = 11:59:00 then Run (If)" and add every program I want to evaluate to store the rainfall. Sound correct? Thanks again!
Michel Kohanim Posted May 31, 2009 Posted May 31, 2009 Hi skunkiechris, yes, I believe that's going to be a good solution. With kind regards, Michel Yes, basically I'm trying to capture the total rainfall for the day so that I can determine whether to let the sprinklers run the following morning. So I'm running a bunch of programs to determine the rainfall -- 0 - .1", .1 - .2", etc. I only want those programs to run just before midnight (when the total rainfall resets.) I'm assuming now that should limit the folder to, say, 11:58 for 2 minutes, put all those programs in the folder, and then put an additional program in the folder that does something like 'If Time = 11:59:00 then Run (If)" and add every program I want to evaluate to store the rainfall. Sound correct? Thanks again!
skunkiechris Posted June 1, 2009 Author Posted June 1, 2009 That did it! Thanks for all of your help!
Chris Jahn Posted June 1, 2009 Posted June 1, 2009 Well that would explain the behavior, thank you! So I should have a program in that folder that is called during those three minutes that runs all of the other programs? You could also do this by having a set of programs that test climate, but are not enabled, and having a master program that does a Run (If) on each of these at a specific time (eg. 11:59 PM). Doing this, you would not need folder conditions. FYI ... Have a look at this post describing folder conditions; basically you can reference the folder in your 'If' conditions to have a program in the folder run when the folder condition becomes true. http://forum.universal-devices.com/view ... 0666#10666
skunkiechris Posted June 1, 2009 Author Posted June 1, 2009 Wow, lots of great info there -- thanks for the link!
Recommended Posts