Jump to content
View in the app

A better way to browse. Learn more.

Universal Devices Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Query a device every 10 minutes

Featured Replies

Posted

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

  • 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')

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')

  • Author

I edited my original post after the fact. I didn't want bad code floating around. :)

 

Thanks Michel.

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?

  • Author

I'm beta testing a product which needs to be queried to know it's current state.

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.

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,

  • 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?

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,

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

  • 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.

  • 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.

Guest
Reply to this topic...

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.