« Back to Product

Documentation

IPS_SetEventAction

Require: IP-Symcon >= 6.0

 boolean IPS_SetEventAction (int $EventID, string $ActionID, array $ActionParameters) 

Parameters

EventID

ID of the event to be changed

ActionID

ID of the executed action

ActionParameters

List of Parameters for the executed action

Returns

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

Description

The Action of the Event with the ID EventID is set to the action with the ID ActionID. The parameters of that action are defined as ActionParameters.

Warning

The special parameters TARGET, ENVIRONMENT, and PARENT are not required here and are handled by the event

Migration of IP-Symcon 5.5 oder older

If the event should start the parent script (the default in IP-Symcon 5.5 or older) this connection must be set accordingly since IP-Symcon 6.0. This requires the following line, which assigns the "Run Automation" action to the event.

IPS_SetEventAction($EreignisID, "{7938A5A2-0981-5FE0-BE6C-8AA610D654EB}", []);

Example

// Multiply the target variable of the event by 3
IPS_SetEventAction($EreignisID, "{A3153696-013A-41B1-A001-5E8085D95465}", ["FACTOR" => 3]); 

// Execute the target automation of the event
IPS_SetEventAction($EreignisID, "{7938A5A2-0981-5FE0-BE6C-8AA610D654EB}", []);
Any questions?