Each action component in the Action Editor has a pre Pre Mappings / Post Mappings area on the right side of the screen:
Press the “+” button to add a new line to either the Pre-Mappings or the Post-Mappings. Pre Mappings are executed before the main function of the component is conducted. Accordingly, Post Mappings are executed thereafter. Clicking on the + icon will add a new line:
You can write the name of the variable on the left side and the expression or value to be assigned to the variable on the right side. In this example, we are in the Gravio Light component and assign a color to the light:
cp. prefix which refers to the Component Parameter variable. By clicking on the “Show Variable Names” button you can see how the variables in the component are being referred to.
Note that the sequence of execution is from top to bottom
The expressions on the right-hand side can be written as quadratic operations (
/ ) or functions. You can also describe variables with prefixes such as
cv. as variables.
When you assign the evaluation result of a right-hand expression to the left-hand side, the type of the right-hand value (
DateTime ) is converted to the type of the left-hand side.
If you write an expression that is not an assignment (e.g.,
cv.Payload > 10 ), it will return a value of type Bool.
To return a Bool value, you can perform a comparison operation on a number or string.