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.

Need Help Writing A Query Program

Featured Replies

Posted

I need some help writing a query program to keep the device status of my system up to date. What I want to do is write a program that does a query on all devices in my system, similiar to the 3AM event, except I want it to pause for a few seconds after each query to allow for regular traffic from programs and cotrollers. I also want it to start over as soon as it finishes so every device is rechecked every few minutes. Any thoughts on the best way to approach this?

Hello Upstate,

 

I use the following to periodically poll my outdoor lights during the day. To do what you have described, you could query individual devices (with delays between) or scenes (again with delays between).

 

Setting the "Last Run Time" will determine how often the program executes. Note that the "Last Run Time" is when the program STARTS execution. If you have a long query sequence (minutes) you'll need to be careful not to set the iteration time too short - I'm not sure what would occur (multiple instances or program re-starts and misses statements at the end).

 

If
       From    Sunrise +  1 minute
       To      Sunset  - 10 minutes (same day)
   And Time is Last Run Time for 'Outside Daytime Poll' + 30 minutes

Then
       Set Scene 'SC Outside Sunset' Query

Else
  - No Actions - (To add one, press 'Action')

Sorry UpState,

 

Just saw that you wanted you program to re-start immediately. I think that will require two programs. You'll also want to play with the wait times - this can put a pretty heavy load on your system.

 

Query Timer

If
       From    Sunrise
       To      Sunset  (same day)
   And Program 'Query Program' is False

Then
       Run Program 'Query Program' (Then Path)

Else
  - No Actions - (To add one, press 'Action')

 

 

Query Program

If
  - No Conditions - (To add one, press 'Schedule' or 'Condition')

Then
       Set Scene 'SC Outside Off' Query
       Wait  5 seconds
       Set Scene 'SC BSMT Game' Query
       Wait  5 seconds
       Run Program 'Query Program' (Else Path)

Else
  - No Actions - (To add one, press 'Action')

  • Author

Thanks for the examples. It takes about 15 minutes for the "all devices" query to run at 3AM so I will have to make some guesses about the timing for doing each scene separately with a pause in between.

 

I don't really care about the system load. I would be happy to completely give up ISY's ability to control stuff in trade for truly accurate status.

I hear you Upstate! I can't get my devices to provide an accurate status to the ISY in real-time either. If I flip the switch on a ToggleLinc, the ISY doesn't pick up on it til the next query. Wreaks havoc on my IF statements and makes it completely impossible to use something like a ToggleLinc as a trigger for a program. They tell me it's supposed to report its status back to the ISY immediately, but I can't get it to do that. They tell me it's a defective PLM, but I'm not sure. I may swap it at some point and see.

 

Best of luck to you!

Hello wpmjones,

 

All controller type devices, if linked properly to ISY, SHOULD report their status when you turn them on/off.

 

Did you always have this problem or is it something new? Do you have this problem with ALL your controller devices or only the ToggleLinc? Have you tried Restore on that device?

 

With kind regards,

Michel

Hello wpmjones,

 

It seems that your PLM has NO records (Tools | Diagnostics | Show PLM Links Table).

 

Is this a new PLM? If so, I strongly recommend getting it replaced.

 

With kind regards,

Michel

Guest
This topic is now closed to further replies.

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.