|  Developer
Updated on March 28, 2023

setVariable

  • Action and then block to set a variable (typed, non-typed ones).
  • This feature is available since advanced_scenes/1.36 version
Edit
Field Type Required Description
blockOptions.method.args.name string + A name of an existing variable expression
blockOptions.method.args.value any A value of a variable expression. Can be of any possible JSON type: bool, int, float, object, array. A more exact type definition can be set via the valueType field.
blockOptions.method.args.valueType string, one of valueTypeEnum An item value type, one of the valid value types supported by the firmware: see Item Value Types.
blockOptions.method.args.type string + A constant “value”, indicates that the next “value” field contains a value of a variable
blockOptions.method.args.metadata object Metadata value of a variable.
Edit
Data Internal error code Message
rpc.params.invalid.{FIELD} BAD_PARAMS Wrong params,
Edit
				
					{
    "blockOptions": {
        "method": {
            "args": {
                "name": "name",
                "type": "type",
                "value": "value",
                "valueType": "valueType",
                "metadata": "metadata"
            },
            "name": "setVariable"
        }
    },
    "blockType": "then",
    "fields": [
        {
            "name": "name",
            "type": "string",
            "value": "expression.name"
        },
        {
            "name": "type",
            "type": "string",
            "value": "value"
        },
        {
            "name": "value",
            "type": "<valueType>",
            "value": <value of a variable to set here>
        },
        {
            "name": "valueType",
            "type": "string",
            "value": "<one of valueTypeEnum>"
        },
        {
            "name": "metadata",
            "type": "<type of metadata>",
            "value": <metadata value>
        }
    ]
}