« Back to Product

Documentation

IPS_RunAction

 boolean IPS_RunAction (string $ActionID, array $ActionParameters) 

Parameters

ActionID

GUID of the executed action

ActionParameters

List of Parameters for the executed action

Returns

If the command succeeds, it returns TRUE, otherwise FALSE.

Description

This function causes the execution of the Action with the GUID ActionID and the parameters ActionParameters. The execution is running concurrently (at the same time) to the calling script.

The action parameters need to include the following entries:

Parameter Beschreibung
TARGET ID of the target object of the action (-1 for general actions)
ENVIRONMENT The execution environment of the action, see Environments
PARENT ID of the object that executes the action, e.g. the PHP script or the Flow Script

Example

// Execute Script with the ID 12345
IPS_RunAction("{7938A5A2-0981-5FE0-BE6C-8AA610D654EB}", ["TARGET" => 12345, "ENVIRONMENT" => "Default", "PARENT" => $_IPS['SELF']]);

// Show all actions and their GUIDs
foreach(json_decode(IPS_GetActions(), true) as $action) {
    echo $action['id'] . " -> " . $action['caption'] . PHP_EOL;
    // var_dump($action); <-- Shows more details, for example: restrictions
}
Any questions?