Jump to content

Using Query in a Program


markgam

Recommended Posts

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!

Posted

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

Posted

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.

Posted

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,

Posted

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

Posted

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

Guest
This topic is now closed to further replies.

×
×
  • Create New...