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.

Prerequisites​

Before you begin, make sure you have added devices in Aqara Studio. For the related steps, see the Device Integration documentation.

Create an Automation​

In the left navigation bar, click Automation. Under the Automation tab, click the Create button.

Click the Create button

Rename an Automation​

In the editor, click the automation name area in the upper left to rename it.

Rename an automation

Assign Automation to a Space​

Below the automation name area, you can select and assign a space for the automation.

Assign automation to a space

Add a Block​

What is a Block?​

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.

Click the + button, select the detailed card, and 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.

Add Variables​

What are Variables Used For?​

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.

Debug and Test​

After adding blocks and variables to the canvas and completing the connections, you can debug and test to ensure the automation Flow works correctly.

Debug​

Debugging is used to check whether the flow between blocks in the automation process runs smoothly without obstruction.

tip

In debug mode, Aqara Studio does not send simulated values to simulate trigger conditions, so devices will not actually execute operations.

Follow these steps:

  1. Enable Debug Mode in the upper-left corner of the canvas.
  2. Click the ▶ icon to open the Test Run list. This list displays all Trigger blocks on the canvas.
  3. Select a Trigger block from the list. Aqara Studio will treat that trigger condition as satisfied and start executing the subsequent automation Flow.
  4. Wait for the Flow test completed prompt, which indicates that the Flow has passed debugging and can run normally.

Debug

Test​

Testing is used to simulate a trigger condition being satisfied, thereby starting the automation Flow. You can observe whether actions are completed correctly (for example, whether a device state changes or a Flow is enabled).

Follow these steps:

  1. Click the ▶ icon to open the Test running list. This list displays all Trigger blocks on the canvas.
  2. Select a Trigger block from the list. Aqara Studio will treat that trigger condition as satisfied and start executing the subsequent automation Flow.
  3. Wait for the Flow test completed prompt, which indicates that the Flow has passed testing and can run normally. Also observe whether actions are completed correctly (for example, whether a device state changes or a Flow is enabled).

Test

Save​

After completing the configuration, debugging, and testing above, and confirming that the current automation setup is correct, click the Save button to save the automation to Aqara Studio.

Save

The page then navigates to the automation list, where you can see the automation you just saved. It is enabled by default.

Automation list

Templates​

Aqara Studio lets you convert an existing automation into a template so you can later reuse it as the basis for a new automation.

You can also export a template for local backup or import it into another Aqara Studio instance.

Generate a Template​

To convert an automation into a template:

  1. In the automation list, find the automation you want to convert, then click ... > Generate Template.

    Convert to template

  2. In the dialog, enter a template name. Aqara Studio generates a default description, which you can edit as needed to further explain the template’s purpose.

    Define template name and description
  3. When the Template created successfully prompt appears, the automation has been converted into a template. Switch to the Template Management tab to see the newly converted template in the list.

    Template list

Create an Automation from a Template​

Creating an automation from a template lets you quickly build a new automation based on an existing template.

Follow these steps:

  1. In the template list, find the template you want to use, then click ... > Use Template to Create. You will enter the automation editor.

    Create an automation from a template

  2. Return to the Automation tab. You will see a new automation added to the automation list.

    Check the new automation

Export a Template​

In the template list, find the template you want to export, then click ... > Export to download the template locally in JSON format.

Export a template

Import a Template​

To import a local automation template JSON file into Aqara Studio, click the Import button on the Template Management tab to start the import.

Import a template