« Back to Product

Documentation

RequestActionEx

Require: Symcon >= 5.0

 bool RequestActionEx (int $VariableID, mixed $Value, string $Sender) 

Parameters

VariableID

ID of the variable

Value

Value for the action

Sender

Name of the sender

Returns

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

Description

The function executes the action of the Variable with the ID VariableID with the value Value and the sender Sender. The same switching action as in the WebFront and other Visualizations is used here. If a separate Action Script is defined for the variable, this PHP script is executed. Otherwise, if available, the standard action of an Instance Variable is executed. If there is neither a custom nor a standard action, the RequestActionEx function leads to an error. Variable actions usually switch the associated property of a device according to the new value and then set the value of the variable accordingly. If an error occurs while switching, an error message is output. It is important to ensure that the type of value matches the type of variable. If the target variable is of type string, the value should also be type string. Furthermore, the System Variable with $_IPS["SENDER"] = Sender is available in the script.

Warning

If the variable and value types do not match, the value is converted to the type of the variable. The result of this conversion can deviate from the expected result. It is recommended to pass the correct type.

Example

// Switch on Boolean variable with Sender AlarmSystem
RequestActionEx(12345, true, "AlarmSystem");

// Set integer variable with Sender TemperatureAirConditioning
RequestActionEx(23456, 18, "TemperatureAirConditioning");
Any questions?