Hi Dirk,
Yes, I also understood we can finally write to logics variables on the v7.4.0RC version
In theory this should work:
In the example-flowcard-list.js script output, you can search for homey:manager:logic
Example
await Homey.flow.runFlowCardAction({
"uri": "homey:manager:logic",
"id": "variable_set_string",
"args": [
{
"name": "MyStringVariable",
"type": "autocomplete",
"title": "Text Variable"
},
{
"name": "value",
"type": "Hello World",
"title": "Text"
}
]});
This results in a Rejection error on pre-v7.4.x firmware
Set [[variable]] to [[value]]
{
"uri": "homey:manager:logic",
"id": "variable_set_string",
"args": [
{
"name": "variable",
"type": "autocomplete",
"title": "Text Variable"
},
{
"name": "value",
"type": "text",
"title": "Text"
}
]
}
-----------
Set [[variable]] to [[value]]
{
"uri": "homey:manager:logic",
"id": "variable_set_number",
"args": [
{
"name": "variable",
"type": "autocomplete",
"title": "Number Variable"
},
{
"name": "value",
"type": "number",
"title": "Number"
}
]
}
-----------
Calculate [[variable]] as [[value]]
{
"uri": "homey:manager:logic",
"id": "variable_set_number_math",
"args": [
{
"name": "variable",
"type": "autocomplete",
"title": "Number Variable"
},
{
"name": "value",
"type": "text",
"placeholder": "Number"
}
]
}
-----------
Set [[variable]] to [[value]]
{
"uri": "homey:manager:logic",
"id": "variable_set_boolean",
"args": [
{
"name": "variable",
"type": "autocomplete",
"title": "Yes/No Variable"
},
{
"name": "value",
"type": "checkbox",
"value": true,
"title": "Yes/No"
}
]
}
-----------
Flip [[variable]]
{
"uri": "homey:manager:logic",
"id": "variable_toggle_boolean",
"args": [
{
"name": "variable",
"type": "autocomplete",
"title": "Yes/No Variable"
}
]
}
-----------
Make a HTTP [[method]] request to [[url]] with headers [[headers]] and body [[body]]
{
"uri": "homey:manager:logic",
"id": "http",
"args": [
{
"name": "method",
"type": "dropdown",
"values": [
{
"id": "get",
"title": "GET"
},
{
"id": "post",
"title": "POST"
},
{
"id": "put",
"title": "PUT"
},
{
"id": "delete",
"title": "DELETE"
}
],
"title": "Method"
},
{
"name": "url",
"type": "text",
"title": "URL",
"placeholder": "https://www.athom.com"
},
{
"name": "headers",
"type": "text",
"required": false,
"placeholder": "Content-Type: application/json",
"title": "Headers"
},
{
"name": "body",
"type": "text",
"required": false,
"placeholder": "{ \"your\": \"value\" }",
"title": "Body"
}
]
}
[[droptoken]] is !{{|not}} exactly [[comparator]]
{
"uri": "homey:manager:logic",
"id": "equal",
"args": [
{
"name": "comparator",
"type": "text",
"placeholder": "Value"
}
],
"droptoken": [
"string",
"number"
]
}
-----------
[[droptoken]] is equal to !{{`yes`|`no`}}
{
"uri": "homey:manager:logic",
"id": "equal_boolean",
"droptoken": [
"boolean"
]
}
-----------
[[droptoken]] !{{contains|doet not contain}} [[comparator]]
{
"uri": "homey:manager:logic",
"id": "contains",
"args": [
{
"name": "comparator",
"type": "text"
}
],
"droptoken": "string"
}
-----------
[[droptoken]] is !{{|not}} less than [[comparator]]
{
"uri": "homey:manager:logic",
"id": "lt",
"args": [
{
"name": "comparator",
"type": "number"
}
],
"droptoken": "number"
}
-----------
[[droptoken]] is !{{|not}} greater than [[comparator]]
{
"uri": "homey:manager:logic",
"id": "gt",
"args": [
{
"name": "comparator",
"type": "number"
}
],
"droptoken": "number"
}
-----------
Continue with a chance of [[chance]]
{
"uri": "homey:manager:logic",
"id": "random",
"args": [
{
"name": "chance",
"type": "number",
"min": 0,
"max": 100,
"placeholder": "50%"
}
]
}
-----------
[[variable]] is !{{|not}} equal to [[value]]
{
"uri": "homey:manager:logic",
"id": "var_equal",
"args": [
{
"name": "variable",
"type": "autocomplete",
"title": "Variable"
},
{
"name": "value",
"type": "text",
"placeholder": "value to compare to"
}
]
}
-----------
[[value1]] [[operator]] [[value2]] is !{{true|false}}
{
"uri": "homey:manager:logic",
"id": "equation",
"args": [
{
"name": "value1",
"type": "text",
"placeholder": "Value 1"
},
{
"name": "operator",
"type": "dropdown",
"values": [
{
"id": "eq",
"title": "is equal to"
},
{
"id": "neq",
"title": "is not"
},
{
"id": "lt",
"title": "is less than"
},
{
"id": "gt",
"title": "is more than"
},
{
"id": "lte",
"title": "is less than or equal to"
},
{
"id": "gte",
"title": "is more than or equal to"
}
],
"title": "Operator"
},
{
"name": "value2",
"type": "text",
"placeholder": "Value 2"
}
]
}
-----------
HTTP [[method]] to [[url]] with headers [[headers]] and body [[body]] is !{{|not}} equal to status code [[statusCode]]
{
"uri": "homey:manager:logic",
"id": "http_status_code_equals",
"args": [
{
"name": "method",
"type": "dropdown",
"values": [
{
"id": "get",
"title": "GET"
},
{
"id": "post",
"title": "POST"
},
{
"id": "put",
"title": "PUT"
},
{
"id": "delete",
"title": "DELETE"
}
],
"title": "Method"
},
{
"name": "url",
"type": "text",
"title": "URL",
"placeholder": "https://www.athom.com"
},
{
"name": "headers",
"type": "text",
"required": false,
"placeholder": "Content-Type: application/json",
"title": "Headers"
},
{
"name": "body",
"type": "text",
"required": false,
"placeholder": "{ \"your\": \"value\" }",
"title": "Body"
},
{
"name": "statusCode",
"type": "number",
"min": 100,
"max": 599,
"title": "Response status code"
}
]
}