Last Updated on : 2025-06-26 10:07:57download
Self-control commands refer to instruction sets that directly trigger device operations through user interactions with the device itself. They are designed for smart devices with voice or text interaction capabilities, such as AI dolls, AI robots, and smart water dispensers.
For example, when a user issues commands like “Move forward” or “Dance” to a robot, or says “Lower the volume” or “What’s the battery level?” to an AI doll, the system must convert these natural language inputs into executable control commands that the device can recognize and process. To implement these control capabilities, self-control commands pre-configured on the device and the cloud are required. They ensure accurate command delivery after semantic recognition is completed.
Expressions refer to a diversified set of linguistic patterns designed to match natural language inputs from users. Each expression corresponds to a specific self-control command, enhancing the system’s recognition accuracy and hit rate.
For example, the self-control command “Turn on the light” may include multiple expressions such as “Switch the light on”, “Turn the lights on”, “Activate the lighting”, and “Light up the room”. By maintaining a comprehensive expression library, the system can accurately interpret varied user phrasing across contexts and trigger the corresponding device control actions.
Type | Definition | Typical scenario and expression | Command configuration entity | How to trigger |
---|---|---|---|---|
Self-control commands | The device independently recognizes voice commands and executes corresponding actions, enabling direct user-device interaction to control its own functionalities. |
|
The device itself. | User speaks to the device (voice/text). |
Passive commands | The device is controlled by external devices to enable cross-device automation scenarios, such as speakers controlling air conditioners. |
|
The controlled device. For cross-device control scenarios such as speaker controlling lights, the target device (light) must have passive commands configured to accept external commands. | The user issues voice/text commands to the main control device to initiate control operations. |
When a device is required to autonomously understand and respond to user voice/text commands, self-control commands should be configured. This feature supports the following scenarios:
Devices with embedded voice interaction capabilities support direct user-to-device command execution. For example, AI dolls, robots, and water dispensers.
Examples: “Lower volume” and “check battery level”.
Devices with native hardware control support custom semantic processing and understand various expressions.
Examples: “Play a story”, “do a dance”, and “heat the water”.
You can customize expressions, intents, and slot configurations on the platform.
Home lighting control
Thermostat control
When the PID of a device is configured with AI commands (such as thermostat temperature settings) and the agent has the “Device Control” plugin enabled, chats with AI can achieve device control.
Bind an AI agent in the product AI capabilities and enable the Device Control skill for this agent.
You have configured and released self-control commands for the product. Note: Configurations will take effect approximately 20 minutes after release.
DP command configuration serves as the foundation for enabling device self-control capabilities.
Log in to the Tuya Developer Platform.
In the left-side navigation bar, choose AI Agent > Agent Configuration > AI Control Command Configuration to enter the AI Product Command page.
Click the Self-control command tab.
If the product has pre-configured commands, the page will show the functional commands already set up for the specific product category. You can click Modify command solution at the bottom of the page to confirm changes to the existing version and click OK. You need to release this command solution again after modification.
Then, choose to add DP commands or non-DP commands as needed. For detailed configuration steps, refer to the following contents:
DP commands are data points used to control devices, such as power on/off, adjusting brightness, and setting modes. After you define the DP structure and type, the platform can automatically complete intent parsing and command delivery.
Click Add Command, select DP command, and then complete the following configuration on the Create Self-Control Command page.
Select the language(s) to be supported for this command, used for localized matching of subsequent expressions. Example:
Language selection affects expression matching accuracy. Always configure based on your actual users’ language preferences.
Select the DPs to be controlled in the device function definition. The platform supports the following DP types:
Bool
: Boolean typeEnum
: Enumeration typeValue
: Value typeString
: String typeThe Raw
type is not supported yet.
Configurable command types vary depending on the DP types. See the following table for details.
DP type | Configurable command type |
---|---|
Bool | Set. For example, on/off. |
Enum | Set. For example, switch to a specific mode. |
Value | Set, raise, and lower. For example, set the brightness to 80% and raise the temperature. |
String | Set. For example, play a specific song. |
Enable unified normalization of expressions by setting synonyms for DP values, allowing diverse user phrasing to accurately trigger the correct commands.
Example:
on
, and the configurable synonyms are: start
, activate
, and enable
.off
, and the configurable synonyms are: shut down
, sleep
, and stop
.How to configure:
#dpValue#
placeholder in expressions to dynamically reference matched synonyms.You can set synonyms only for the Boolean and enumeration type DPs.
Expressions are used to match users’ natural language inputs and trigger corresponding commands. Configuration guidelines:
#percentValue#
: Percentage values for numeric DPs.#dpValue#
: DP value synonyms.Device type | Command type | DP type | Expression example | Value description |
---|---|---|---|---|
AI doll | DP | Value | Set the volume to #dpValue# | DP: volume (such as DP ID: 101), value = #number# |
DP | Value | Increase the volume a bit | DP: volume, value = current value + 10 (example) | |
DP | Value | Lower the volume | DP: volume, value = current value - 10 (example) | |
Robot | Non-DP | - | Move forward | Custom value: forward (example) |
Non-DP | - | Move backward | Custom value: backward (example) | |
Non-DP | - | Do a dance for me | Custom value: dance (example) | |
Non-DP | - | Turn left | Custom value: left (example) | |
Non-DP | - | Walk a few steps to the right | Custom value: walk (example) |
#dpValue#
placeholder in expressions.forward
and dance
) can be defined and are parsed/executed locally on the device.After completing the above configurations, save the configurations to view the command details in the solution list.
Non-DP commands apply to specific scenarios where devices do not rely on platform-defined DPs, but instead use custom control commands to complete interactions. Devices with custom protocol parsing capabilities, such as robots and robotic arms, can utilize non-DP commands for interaction.
Click Add Command and select Non-DP command. On the Create Self-Control Command page that appears, complete the following configurations.
Select supported languages for commands to enable multilingual natural language interaction capabilities. Each supported language requires corresponding expressions.
Example:
Configure a custom code for each non-DP command to identify the specific action to be performed by the device.
The command code is the unique identifier for the device to identify the command. It is recommended to keep it concise and clear.
Configure multiple expressions per command, in order to enable diverse voice or text input by assigning varied phrasings to each command.
Incorporate placeholders like #dpValue#
to improve expression versatility and scalability.
Devices can receive and parse custom-formatted values through non-DP commands.
Example:
Command code | Payload (example) | Description |
---|---|---|
forward | { "action": "move", "dir": "fwd" } |
Move forward |
dance | "action_dance" |
Do a dance (string-based) |
turn_left | { "cmd": "turn", "value": "left" } |
Turn left |
After you configure the command solution, you can click Confirm and Test.
Click Go to test and follow the process to try out the command:
Proceed with Next Step: Publish Effect to publish the commands. Important notice: Published commands cannot be revoked. Confirm the settings and click OK.
Then, the page shows Released.
Click Manage Versions to view and edit the versions on the page of History Version.
You can also click Add Version to try out the configuration and release a new version.
Is this page helpful?
YesFeedbackIs this page helpful?
YesFeedback