Skip to main content

Flow

With flexible visual configuration, you can use various blocks to build data flow logic. This helps you quickly create automation flows for different scenarios. It also makes it easy to achieve smart control of IoT devices.

Create an Automation

To learn how to create a flow, please see Automation - Create an Automation.

Then, you can add and connect different blocks on the canvas. Build device interaction logic for your specific needs.

Blocks

In Aqara Studio, blocks serve as the "information hub" and "control center" of automation. Blocks visually transform complex backend automation logic (such as "turn on the light if someone is present and the light is low") into clear device states and one-tap scene switches, making automation intuitive and manageable.

Steps to Add

  1. Click the + button on the left sidebar of the canvas.
  2. Browse and select the required block type (such as trigger, condition, or action).
  3. Under the selected block type, further choose a specific block. For example, under trigger, click time to see the periodic trigger, scheduled trigger, and loop trigger blocks.
  4. Click the desired block to add it to the canvas.

Block Components

A block consists of the following elements:

ElementDescription
Input NodeIf a block has an input node, it can be triggered.
ParametersUsed to set status to watch for, actions to perform, or other operations.
Output NodeIf a block has an output node, it can trigger other steps.

Block Categories

Flow supports the following types of blocks, each with its own role:

CategoryDescription
TriggerThe starting node of a Flow.
Can be triggered by device state changes (like a light being turned on), timing triggers, alarm events, and more to start the process.
ConditionThe intermediate node of a Flow.
Used to determine whether device state, time, logic, or comparisons meet the set criteria and accordingly direct the flow.
ActionThe end node of a Flow.
Used to deliver and execute various actions, including single or batch device control, data processing, delay, and more, to complete the automation loop.

Connection Line

The connection method between different categories of blocks is as follows:

  • Trigger: It only has output nodes, no input nodes. The output of one trigger block can be connected to multiple other blocks, serving as the starting point of a flow.
  • Condition: It has both input and output nodes. Multiple blocks can have their outputs connected to the input of the same condition block; each output (such as for different condition results) of a condition block can connect to multiple subsequent blocks, enabling flow branching.
  • Action: It acts as the endpoint of the flow, supports multiple input nodes, and can be triggered by several blocks at once; based on the actual requirement, it can also be set up with multiple output nodes to extend subsequent flows.
tip

The input and output nodes of Flow blocks are mainly used for flow control, determining the direction of the process. For example, multiple inputs mean that flows from several blocks can converge on a single block, while multiple outputs mean the flow from one block can branch out to several subsequent steps.

These input and output nodes are not related to the actual flow of "data". Data processing and calculation are done inside the block and are not directly passed between blocks.

Additionally, the output of condition blocks features true/false branches to further control flow branching.

Block Operations

After adding a block to the canvas, you can right-click the block to open the action menu, allowing you to rename, copy, test, or delete the block.

Variables

You can create variables in Flow as trigger nodes, or use them in comparison operations, math operations, and data aggregation. These variables can also be modified or toggled by blocks, making your flows more flexible and intelligent.

Variable Types

Variables in Flow can be either global variables or local variables, with different application scopes as follows:

TypeApplication Scope
Global VariableShared and available across all Flows.
Local VariableOnly effective within the Flow where it was created, not accessible by other Flows.

Create Variables

To create a variable:

  1. Click the variable icon on the left sidebar of the canvas, expand the variable drawer, then click the add button.
  2. In the pop-up New variable window, choose the data type, set the variable name, enter the initial value, and select the scope (global or local). After filling in the details, click Save.
  3. Once created, you can use the filter at the top of the variable drawer to view global or local variables, and find the new variable.