Documentation
IPS_IsSearching
bool IPS_IsSearching (int $InstanceID)
Parameters
| InstanceID | ID of the instance to be checked |
Returns
If the instance is in search mode, TRUE is returned, otherwise FALSE.
Description
The function checks whether the instance with the ID InstanceID is in search mode, i.e. whether the search mode started with IPS_StartSearch has neither expired nor been stopped with IPS_StopSearch. For modules without a search mode, it returns FALSE. For an instance that does not exist, it fails with "Instance #... does not exist".
Some device modules support a search mode, e.g. the instances for FS20, HMS, EnOcean or HomeMatic. In search mode, the instance reports every received device with its address, together with an existing instance for this address. The management console shows these results in the search dialog, so a device can be found by triggering it and then be assigned to the instance. The search mode ends automatically after 5 minutes.
The entry InstanceIsSearching of IPS_GetInstance contains the same information.
Example
if (IPS_IsSearching(12345)) {
echo 'The instance is currently searching for devices';
}