integer IPS_GetEventIDByName (string $EventName, integer $ParentID)
|EventName||Name of the event|
|ParentID||Object whose child objects are searched for the event|
ID of the found event, otherwise FALSE.
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.
$EventID = @IPS_GetEventIDByName("TimerABC", $ParentID); if ($EventID === false) echo "Event not found!"; else echo "The Event ID is: ". $EventID;