int IPS_GetObjectIDByName (string $ObjectName, int $ParentID)
The searched object name
ID of the object whose children object are searched
ID of the found object, otherwise FALSE
This function tries to detect the object with the name ObjectName whose parent object has the ID ParentID. It will return the ID of the first object whose name matches ObjectName. If no object is found, this function returns FALSE.
The parameter "ObjectName" must not be an empty string ("").
Caution: Names in IP Symcon can be chosen freely, so they are not unique. For this reason, the command can return the ID of another object.
This function generates a warning if the ident is not found. The @ operator can be used to supress this message. Please see the PHP manual for the exact functionality of this operator.
$ObjectID = @IPS_GetObjectIDByName("Rain sensing", $ParentID); if ($ObjectID === false) echo "Object not found!"; else echo "The Object ID is: ". $ObjectID;