Last Updated on : 2025-07-07 06:40:21download
When devices meet specific event conditions, agent triggers can automatically invoke agents to execute tasks, such as user notifications, device control, and cross-system automation.
Typical scenarios
Differences from push notifications
Device requirements: Use Wukong SDK v3.12.14 or later to develop device firmware.
Platform configuration:
Follow the steps below to configure device events based on device PID and DP conditions.
Go to the Tuya Developer Platform. In the left-side navigation bar, choose AI Agent > Agent Configuration > Device Event Management.
Click Create in the top-right corner of the page. Currently, the device event trigger type is supported.
Enter the device event name and select the PID of the target product. After selecting the PID, you can set the event trigger conditions based on the DPs of that PID. The rules will only apply to devices under the selected PID.
Define trigger conditions. Select Generic type trigger condition or Data point (DP) trigger condition, and then add the DP condition rules.
For example, set a low battery alert condition for an AI doll: dp2 (Battery) < 20
and dp3 (Charge Status) = none
.
(Optional) Set a trigger period. The Trigger Mode can be Level Triggering or Edge Triggering. For example, you can configure the event to trigger only during a specific time period (such as 08:00 - 23:00
) to avoid disturbing users.
After the configuration is complete, save and enable the event.
After the event is enabled, it will appear as an option in the trigger configuration and can be selected for use.
Go to My Agent, click Develop in the Operation column, and then scroll down to find the Trigger. Click + to configure the trigger.
Add a trigger.
Select Trigger Event. Select a device event (such as Low Battery) from your account.
Define Task Execution logic. The default task is Agent Push Message.
Currently, only push messages are supported, but plugin or workflow tasks are unavailable.
Edit the prompt to be sent as content to the agent.
{{sys.dp2}}
to represent the current battery value.Sample prompts
For more information, see How to Write a Prompt.
Trigger scenario | Sample prompt | Prompt template |
---|---|---|
Low battery alert | I’m running out of power, please charge me. | Your current battery level is {{dp2}}% . Please remind me (the user) in one sentence to charge your battery. No other irrelevant replies are allowed. |
Overtemperature alert | It is too hot in the room. Can you turn on the air conditioner? | The current room temperature is {{dp4}}°C . Please say something to remind the owner to cool down the room. No other irrelevant replies are allowed. |
Poor air quality | The air is so bad. Do you want to open a window? | The current air quality is {{dp5}} . Please say something to remind the owner of ventilation. No other irrelevant replies are allowed. |
Device offline notification | Device connection error. Please check your network. | You are offline. Please generate a concise prompt to remind users to check the network. No other irrelevant replies are allowed. |
After configuration is complete, click OK.
Test the execution results.
Click the Execute button of the specified event.
In the Simulate Trigger Test dialog box, enter the virtual device ID and use the virtual device panel to view the response effect. Alternatively, click Execute to view the AI’s response.
Currently, only virtual device testing is supported, and real device testing is not supported.
The following extended functionalities will be progressively supported:
Is this page helpful?
YesFeedbackIs this page helpful?
YesFeedback