Documentation
IPS_GetEventIDByName
int IPS_GetEventIDByName (string $EventName, int $ParentID)
Parameters
EventName | Name of the event |
ParentID | Object whose child objects are searched for the event |
Returns
ID of the found event, otherwise FALSE.
Description
The command is trying to determine the ID of an event with the name EventName and the parent with the ID ParentID. It will return the ID of the first found event whose name matches with EventName. If such an event is found, the command returns its ID and FALSE otherwise.
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 described in the PHP manual.
Example
$EventID = @IPS_GetEventIDByName("TimerABC", $ParentID);
if ($EventID === false)
echo "Event not found!";
else
echo "The Event ID is: ". $EventID;