ArrayVar() = callback.PreCheckTrigger(trigger As String)
PreCheckTrigger works much like CheckTrigger except that it does NOT trigger an event. Use PreCheckTrigger when you wish to get the triggers that match the trigger string that you provide. Controls in the trigger string that you do not care about can be passed as the asterisk (*) character and they will be ignored.
This callback is useful, for example, in determining triggers configured on analog values. Consider the following trigger string snippet:
"ACME Thermostat" & Chr(2) & "Temperature Trigger" & Chr(2) & "Master Bedroom Thermostat" & Chr(2) & "Greater Than" & Chr(2) & "60"
This was likely generated from a TriggerUI that had a drop down list of thermostats to choose from, then a drop down list of current temperature trigger checks including "Greater Than", and then a text box where the user entered the numerical value for the greater than trigger.
Since temperatures are usually in a large range, e.g. 20-120, you do not wish to make a CheckTrigger call 100 times, once for each temperature, so instead call PreCheckTrigger with this trigger string (using the previous example):
"ACME Thermostat" & Chr(2) & "Temperature Trigger" & Chr(2) & "Master Bedroom Thermostat" & Chr(2) & "Greater Than" & Chr(2) & "*"
This will cause HomeSeer to find the trigger string shown earlier (value 60 at the end) and any other "Greater Than" triggers for the "Master Bedroom Thermostat". You can then get the value 60 out of the string, compare it to your temperature reading, and if the temperature reading is greater than 60, then call CheckTrigger and pass it the full trigger string to trigger the event. Keep in mind that when the temperature is for example 72, that you still need to pass the trigger string matching what the user entered, which is 60, rather than the value 72 -- HomeSeer does not determine the logic of the trigger string, it only matches what the user entered.