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.

Using Query in a Program

Featured Replies

Posted

Guys --

Can someone give me a real world example of using the "Query" option of a control in the then portion of a program.

 

Thanks!

Hi Mark,

 

During the daytime I run a query on my outside lamps. If one is inadvertently switched on, the periodic query will pick it up and trigger the Daytime Status program.

 

Note that this is really a belt and suspenders approach. It the Switches are communicating properly, the Daytime Status Program should detect the on condition itself and shut the lamps down after 2 minutes.

 

Outside Daytime Poll

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

 

Daytime Status Off Program

If
       From    Sunrise +  1 minute
       To      Sunset  - 10 minutes (same day)
   And (
            Status  'Entry Deck' > Off
         Or Status  'Mud KPL 1 - Entry Garage' > Off
         Or Status  'Entry Patio' > Off
         Or Status  'Entry Porch' > Off
       )

Then
       Wait  2 minutes 
       Set Scene 'SC Ouside Night' Off

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

  • Author

Mike,

Thanks for the response, so what is the following line of code exactly doing:

 

Set Scene 'SC Outside Sunset' Query 

 

I am not able to wrap my head around the Query function.

I think that its part of the set command is what makes it confusing. Its not setting anything in the devices its just querying for their current status so the ISY is in sync with those devices. And in this example it will be querying only the ones in that scene.

 

Thanks,

Hello MarkGram,

 

MarkSanctuary nailed the explanation - I am requesting a status update of the members of my "Outside sunset" scene. If one of these devices comes back with a Status of > Off, it will trigger the second program to turn them off after 2 minutes. I do this to ensure that I don't have outside lights burning during the Day (infuriates me).

 

As I had stated previously, this is a backup (may not be required for most installations). If the insteon system is working properly, the ISY will know whether the lights are on without the separate Query.

 

I did this because I am using dimmable CFL's for my outside lights. These bulbs generate a lot of noise at lower Dim levels. The noise also varies with outside temperature.

 

I had a number of occasions during the past winter when the Switches would not respond to the initial off command due to morning temperatures below -10F. The query program is a backup to repeatedly sample/turn off the lights prior to my returning home from work (saves on burst blood vessels in my brain).

  • Author

So basically, the Query key word forces the ISY to re-poll the devices in that scene, right?

  • Author

Thanks!

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.