int IPS_GetInstanceIDByName (string $InstanceName, int $ParentID)
Name of the searched instance
Object whose child objects are searched
ID of the found instance, otherwise FALSE
The command is trying to determine the ID of the Instance called InstanceName, whose parent has the ID ParentID. It will return the ID of the first found object whose name matches with the InstanceName. If such an object is found, its ID is returned, otherwise FALSE.
Caution: Names in IP-Symcon can be chosen freely, so they are not unique. For this reason, the command can return a wrong ID.
This function generates a warning if the name was not found. Use the @ operator, if you want to suppress this message. The exact function of this operator is found in the PHP manual.
$InstanceID = @IPS_GetInstanceIDByName("Rainfall", $ParentID); if ($InstanceID === false) echo "Instance not found!"; else echo "The Instance ID is: ". $InstanceID;