Create a Homey logic variable
homey_variable_createCreate a new logic variable to store values for Homey automations, enabling data persistence between runs and flow-to-flow value passing. Requires name, type, and starting value.
Instructions
Creates a new logic variable. Use this when an automation needs to remember something between runs, or to hand a value from one flow to another. A logic variable is the better choice over a tag published from a script whenever a person may want to see or change the value: logic variables appear in the Homey app, can be set by hand, and are readable here through homey_home_overview. Exactly three types exist: string, number and boolean. The type is fixed once created and the value must match it. It is created with the value given, so pick a starting value the house can live with: flows may read it immediately. Creating something the owner did not ask for clutters their Homey, so confirm is required.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | What it is called, as shown in the Homey app. Names are not unique, so check homey_home_overview first. | |
| type | Yes | Fixed at creation and cannot be changed afterwards. | |
| value | Yes | The starting value, matching the type. | |
| confirm | Yes | Must be true. Confirms the owner asked for a new variable on their Homey; do not set it on their behalf. |