Posted December 27, 200717 yr What's the best way to query a device every 10 minutes? Would something like this be OK: If From 12:00:00AM To 11:59:59PM (same day) Then Repeat Every 10 minutes Set 'OfficeLight' Query Else - No Actions - (To add one, press 'Action') ..or am I missing something more efficient? Anyone have any sample code they'd like to share? EDIT: CORRECTED CODE
December 27, 200717 yr Author Correction. This is the code I am testing/using: If From 12:00:00AM To 11:59:59PM (same day) Then Repeat Every 10 minutes Set 'OfficeLight' Query Else - No Actions - (To add one, press 'Action')
December 27, 200717 yr Hi Mike, What's the difference between the two codes? In both cases, this should work fine. With kind regards, Michel Correction. This is the code I am testing/using: If From 12:00:00AM To 11:59:59PM (same day) Then Repeat Every 10 minutes Set 'OfficeLight' Query Else - No Actions - (To add one, press 'Action')
December 28, 200717 yr Author I edited my original post after the fact. I didn't want bad code floating around. Thanks Michel.
December 29, 200717 yr What's the best way to query a device every 10 minutes? Mike, Out of curiosity, what do you use this for? Do you do this with several devices or have you found this specific device to not stay consistent with what the ISY is seeing?
December 29, 200717 yr Author I'm beta testing a product which needs to be queried to know it's current state.
December 29, 200717 yr Thanks for the insight. Since this is a different request than I have seen on here in a while, I was curious if there was a new issue floating around.
December 29, 200717 yr Hello Mike: I've never tried this, but how about if you eliminate the conditional time statement entirely, and only keep the "Then" statement. Then, in the Program Summary, you change the program to "Run" instead of enable? Once you do that, won't the program just keep running? Best wishes,
December 29, 200717 yr Author Then, in the Program Summary, you change the program to "Run" instead of enable? Once you do that, won't the program just keep running? Hey Frank - Thanks for the suggestion. I think that would work, but then if the ISY were rebooted it would not start - unless I set it to 'run at reboot'. Anyone have any opinions on whether or not this would be a 'cleaner' solution?
December 29, 200717 yr Hello Mike: Actually, I was going to suggest that "Run at Reboot" be used. But I haven't tried it to see if that option is selected if the program will run anyway, without the need for reboot. I would think that it would just wait for the next reboot. Maybe you could first select "Run", then after the program starts executing, you could change it to "Run at Reboot", and it would continue to keep chugging along anyway, since you had already told it to Run. Then it would also restart after rebooting. Or, the logic of the ISY may be set such that if you just set it up as "Run", it inherently knows to restart it at reboot. I think that "Run at Reboot" may be more for programs that only need to run "unconditionally" at reboot, such as a program that turns something on or off only after a power failure or other ISY reboot. If a program is simply set to "Run" all the time, I would think that even if the ISY rebooted, it would restart the program automatically. I'm certain that Michel will be able to clarify this for us. Best wishes,
December 29, 200717 yr Good idea Frank! I believe the program will begin to run as soon as it is Saved. It did with my holiday lights cycle program. If that is the case it certainly should Run at Reboot. Give it a shot, it can't hurt. Rand
December 29, 200717 yr Author I could certainly be wrong, but my understanding that setting a program to RUN simply tells it to start running now, but doesn't necessarily set it to ALWAYS run.
December 29, 200717 yr Author I confirmed that this seems to be correct. I can set it to run, and it will run and stay running (since the THEN statements are continuous). But, if the ISY is rebooted it needs to be started manually. Setting the program to 'run at reboot' causes the ISY to re-start the program when the ISY is rebooted, and it works like I hoped. Thanks for the suggestion Frank! This feels like a 'cleaner' solution than putting a time value under IF since I want the program to always run.
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.