« Back to Product

Documentation

RequestActionEx

Require: IP-Symcon >= 5.0

 variant RequestActionEx (int $VariableID, variant $Value, string $Sender) 

Parameters

VariableID

ID of the variable

Value

Value for the action

Sender

Name of the sender

Returns

If the command 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 Scripts 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 RequestAction 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 variables accordingly. If an error occurs while switching, an error message will be put out. 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"] = Action is available in the script.

Warning

If the type of the variable and the value do not match, PHP tries to conduct a suitable conversion. The result of this conversion can, however, differ from the expected result. It is therefore better to hand over the correct type from the start.

Example

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

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