Trigger
This document explains the trigger blocks in Flow.
Overview
In automation Flows, trigger nodes define the starting conditions of a process and serve as the entry point to activate the entire automation. Only when the trigger node listens to a specific event (such as a device state change, schedule, manual operation, or alarm event) will subsequent condition checks and actions be executed. By configuring different types of trigger nodes, you can flexibly implement automatic responses for various scenarios to meet diverse automation needs.
In Flow, the following can be used as triggers, serving as the starting point of a process:
- Device: Triggers the process when listening for device events or state changes
- Time: Triggers at a set time or on a repeating cycle
- Alarm: Triggers the process when the state of a specified alarm changes
- Variable: Triggers the process when listening for variable changes
- External Event: Triggers the process when a Claude or CodeX task completes or is waiting for confirmation, or when a custom external event is received
Device
A device-based trigger block monitors a device property (such as value change or status change) or event (such as a switch being pressed), and triggers the next steps when a change or event satisfies the comparison. Supports a required hold duration, repeat-trigger suppression and rising/falling threshold crossings.
By configuring the device and its supported events or states, you can flexibly define auto-response trigger conditions. For example: when someone enters a room, when temperature or humidity exceeds thresholds, when a light is turned on manually, etc.—all can use device-based trigger blocks to initiate the automation process.
You can select multiple events/states of different devices to monitor, meeting various automation needs.
How to Use
-
In the left sidebar of the canvas, click the + button. Under Trigger, select Device. Then select the device you want to monitor from the device list.
-
Next, you will see a list of available blocks for this device, which are readable function points for the device. Click the required block to add it to the canvas.
-
Click the first parameter on the block to choose the specific condition to listen for (such as equal, not equal, greater than, less than, etc.).
tipThe available conditions for device function points vary by type. For example, switch types usually support "equal" and "not equal", whereas numeric types may offer "greater than" and "less than" as well.
Click the second parameter to specify the target value to monitor.
By clicking the second parameter, you can further specify the value target to be monitored.
-
After completing the above configuration, you can connect this with Condition Blocks and Action Blocks.
Time
Time-based trigger blocks include Periodic Trigger, Scheduled Trigger, Interval Trigger and Trigger After Sustained Match, which can be used to meet the automation scheduling needs of different scenarios.
| Type | Applicable Scenario Description | Example |
|---|---|---|
| Periodic Trigger | This card triggers at a selected time on selected weekdays (such as Monday, Wednesday, Friday, etc.), or at sunrise/sunset with an offset at the configured location. Use it for daily or weekly automations. | Turn on the lights at 7:00 from Monday to Friday |
| Scheduled Trigger | This card triggers once at a selected date and time, or at sunrise/sunset with an offset at the configured location. Past times are not replayed. | Open curtains at 2024/07/01 08:00 |
| Interval Trigger | This card triggers repeatedly at a fixed interval with a configurable initial running/stopped state and repeat count. A count of 0 loops indefinitely. Wait one full interval before the first trigger and stop after the configured count. The interval must be greater than 0. | Turn on the lights every 10 minutes |
| Trigger After Sustained Match | This card monitors changes to a device property, flow variable or global variable, and triggers **once **after the comparison remains true for the required duration. A false condition cancels timing; after firing, the condition must become false and then hold true again before another trigger. | Turn on the lights when the temperature is above 25°C for 10 minutes |
In addition, these time trigger blocks support a variety of parameter settings, such as custom periods, a specified time, and time points based on sunrise or sunset (by selecting a city or entering the latitude and longitude manually). This helps you precisely control when the automation runs. Used together, they make it easy to build complex scheduled automations that better fit everyday life and work.
How to Use
-
In the left sidebar of the canvas, click the + button. Under Trigger, select Schedule. Click any block to add it to the canvas.
-
Configure the parameters:
- For Periodic Trigger:
- Select the first parameter on the block to choose the days of the week on which the trigger should occur.
- Select the second parameter “Trigger Time” on the block. You can set it as a specific time, or choose a time relative to sunrise or sunset (such as before/after sunrise or sunset). For details, see Time Types.
- For Scheduled Trigger:
- Select the first parameter on the block to specify the exact date for the trigger.
- Select the second parameter “Trigger Time” on the block. For details, see Time Types.
- For Interval Trigger:
Select the time interval parameter on the block, which indicates how often the flow will be triggered. - For Trigger After Sustained Match:
-
Select the first parameter on the block, and set the device property, flow variable, or global variable to monitor as comparison parameter A.
-
Select the second parameter on the block to set the comparison condition.
-
Select the third parameter on the block, and set a device property, flow variable, global variable, or trigger value as comparison parameter B.
-
Select the fourth parameter on the block to set how long the comparison condition must remain true.
-
- For Periodic Trigger:
-
Connect the above blocks with Condition Blocks and Action Blocks.
Time Types
Aqara Studio supports three types of times when configuring trigger times: Specified Time, Sunrise/Sunset Time, or Relative to Sunrise/Sunset.
The descriptions are as follows:
| Time Type | Description |
|---|---|
| Specified Time | Set a specific time in 24-hour format for precise control over the trigger moment. |
| Sunrise/Sunset Time | You need to provide the latitude and longitude of your location. Rules:
|
| Before/After Sunrise/Sunset | Enter the latitude and longitude as well as the desired relative time interval (e.g., 15 minutes) to enable more flexible time control. |
Alarm
This card is used to monitor the state of a configured alarm and trigger the next blocks when its state matches the selected active, acknowledged, restored or closed state.
How to Use
-
In the left sidebar of the canvas, click the + button. Under Trigger, select Alarm to add an Alarm Trigger block to the canvas.
-
Select the first parameter on the block to choose the alarm to monitor.
-
Select the second parameter on the block to choose a target alarm state, such as
Active-UnacknowledgedorNormal-Acknowledged.
-
Connect the block with Condition Blocks and Action Blocks.
Variable
In automation workflows, the variable trigger is used to sense and respond to changes in variables within the system, enabling dynamic and intelligent process control. The system supports monitoring three types of variables: global variable, local variable, and device variable.
Device variable: Refers to data points on specific devices, such as sensor values, switch status, etc.
The variable trigger allows your automation processes to be more flexible and is suitable for a wide range of complex and dynamic scenarios.
Prerequisites
Before using this block, please make sure you have created a variable or integrated a device.
How to Use
- In the left sidebar of the canvas, click the + button. Under Trigger, select Variable to add this block to the canvas.
- For the first parameter on the block, select a global variable, local variable, or device variable. When this variable updates, the automation flow will be triggered.
- Connect the block with Condition Blocks and Action Blocks.

External Event
External event trigger blocks can monitor a service event property or receive a selected event reported by an external system. When Aqara Studio receives a new event, the card trigger the next steps on a new event. Event data can be referenced by later blocks and used in conditions.
The following external events are currently supported:
- Claude task finished
- Claude needs attention
- CodeX task finished
- CodeX needs attention
- Custom external event