Skip to main content

Self-control Commands

Self-control commands let a device act on what its own user says — "move forward", "lower the volume", "what's the battery level?" — without another device in the loop. You define the commands and their natural-language expressions on the platform, the cloud matches a user utterance to a command after semantic recognition, and the device executes it. They suit smart devices with voice or text interaction, such as AI dolls, AI robots, and smart water dispensers.

Concepts

Self-control commands

A self-control command is an instruction set triggered directly by a user interacting with the device itself. To turn natural language into something the device can execute, you pre-configure these commands on both the device and the cloud. The cloud then delivers the right command after it recognizes the user's intent.

Expression

An expression is one of many phrasings that match a user's natural-language input. Each expression maps to a specific self-control command, which raises recognition accuracy and hit rate.

For example, the command "Turn on the light" can carry expressions such as "Switch the light on", "Turn the lights on", "Activate the lighting", and "Light up the room". A rich expression library lets the system interpret varied phrasing across contexts and trigger the right action.

Self-control commands vs. passive commands

TypeDefinitionTypical scenario and expressionConfigured onTriggered by
Self-control commandsThe device recognizes voice commands and acts on its own, so the user controls the device's own functions directly.• AI doll: turn up the volume, check battery level.
• Robot: move forward, move backward, dance.
The device itself.The user speaks to the device (voice/text).
Passive commandsThe device is controlled by another device for cross-device automation, such as a speaker controlling an air conditioner.• Smart speaker controls the air conditioner: set the temperature higher.
• Lights: turn up the lights. Note: the target device must be specified explicitly.
The controlled device. For cross-device control such as a speaker controlling lights, the target device (the light) needs passive commands configured so it can accept external commands.The user issues voice/text commands to the main control device.

When to use self-control commands

Configure self-control commands when a device must understand and respond to user voice or text commands on its own. This supports:

  • Devices with built-in voice interaction, for direct user-to-device execution — AI dolls, robots, water dispensers. Examples: "lower volume", "check battery level".
  • Devices with native hardware control that need custom semantic handling across many phrasings. Examples: "play a story", "do a dance", "heat the water".
  • Custom expressions, intents, and slot configurations defined on the platform.

Use cases

Home lighting control

Home lighting control example
Home lighting control example

Thermostat control

When a device's PID has AI commands configured (such as thermostat temperature settings) and the agent has the Device Control plugin enabled, chatting with the AI controls the device.

Thermostat control example
Thermostat control example

Prerequisites

  • Develop firmware with Wukong SDK v3.12.12 or later. Self-control skills are not available before v3.12.12.
  • App v6.7.0 or later is required for miniapp or panel-based device control.
  • Platform configuration:
    • Bind an AI agent in the product's AI capabilities and enable the Device Control skill for that agent.

      Device Control skill enabled for the agent
      Device Control skill enabled for the agent

    • Configure and release self-control commands for the product.

note

Configurations take effect about 20 minutes after release.

Step 1: Configure DP commands

DP command configuration is the foundation of device self-control.

  1. Log in to the Tuya Developer Platform.

  2. In the left navigation bar, choose AI Agent > Agent Configuration > AI Control Command Configuration to open the AI Product Command page.

  3. Click the Self-control command tab.

    Self-control command tab
    Self-control command tab

If the product has pre-configured commands, the page shows the functional commands already set for that product category. Click Modify command solution at the bottom to confirm changes to the existing version, then click OK.

note

Release the command solution again after you modify it.

Modify command solution
Modify command solution

Then add DP commands or non-DP commands as needed. For detailed steps, see:

Add command options
Add command options

Add DP commands

DP commands are data points that control a device — power on/off, brightness, modes. Once you define the DP structure and type, the platform parses intent and delivers the command automatically.

Click Add Command, select DP command, then complete the configuration on the Create Self-Control Command page:

Create Self-Control Command page
Create Self-Control Command page

Select language

Select the languages this command supports, used to match expressions locally:

  • For Chinese interaction, select Chinese and provide expressions in Chinese.
  • For multilingual control, add multiple languages and configure expressions for each.

Language selection affects matching accuracy. Configure it for your users' actual languages.

Select DP

Select the DPs to control in the device function definition. The platform supports these DP types:

  • Bool: Boolean
  • Enum: Enumeration
  • Value: Numeric value
  • String: String

The Raw type is not supported yet.

Select command type

The command types you can configure depend on the DP type:

DP typeConfigurable command type
BoolSet. For example, on/off.
EnumSet. For example, switch to a specific mode.
ValueSet, raise, lower. For example, set brightness to 80%, raise the temperature.
StringSet. For example, play a specific song.

Set synonyms

Set synonyms for DP values to normalize varied phrasing so the right command is triggered.

Example:

  • DP value on — synonyms: start, activate, enable.
  • DP value off — synonyms: shut down, sleep, stop.

How to configure:

  • Add multiple synonyms under each DP value for flexible matching.
  • Use the #dpValue# placeholder in expressions to reference a matched synonym dynamically.

You can set synonyms only for Boolean and enumeration DPs.

Set expressions

Expressions match users' natural-language input and trigger the matching command. Guidelines:

  • Each expression should represent a typical phrasing. Example:
    • Turn on the bedroom light
    • Set the fan to level 3
  • Use placeholders for reuse. Example:
    • #percentValue#: percentage values for numeric DPs.
    • #dpValue#: DP value synonyms.

Expression examples

Device typeCommand typeDP typeExpression exampleValue description
AI dollDPValueSet the volume to #dpValue#DP: volume (such as DP ID: 101), value = #number#
DPValueIncrease the volume a bitDP: volume, value = current value + 10 (example)
DPValueLower the volumeDP: volume, value = current value - 10 (example)
RobotNon-DP-Move forwardCustom value: forward (example)
Non-DP-Move backwardCustom value: backward (example)
Non-DP-Do a dance for meCustom value: dance (example)
Non-DP-Turn leftCustom value: left (example)
Non-DP-Walk a few steps to the rightCustom value: walk (example)
  • DP-based devices (such as AI dolls): the platform sends a specific DP (such as volume) and assigns the value dynamically using the #dpValue# placeholder in expressions.
  • Non-DP devices (such as robots): you define custom action commands (such as forward and dance), parsed and executed on the device.

Save configurations

After completing the configuration, save it to see the command in the solution list.

Add non-DP commands

Non-DP commands apply when a device does not rely on platform-defined DPs but uses custom control commands instead. Devices with custom protocol parsing — robots, robotic arms — use non-DP commands.

Click Add Command and select Non-DP command. On the Create Self-Control Command page, complete:

Create non-DP command page
Create non-DP command page

Select language

Select the languages the command supports to enable multilingual interaction. Each language needs its own expressions.

Example:

  • Devices for Chinese-speaking markets must include Chinese expressions.
  • For English control, configure English expressions alongside Chinese ones.

Set custom command code

Configure a custom code for each non-DP command to identify the action the device performs.

The command code is the unique identifier the device uses to recognize the command. Keep it concise and clear.

Set expressions

Configure multiple expressions per command so users can use varied voice or text input for the same command.

Use placeholders like #dpValue# to make expressions more versatile and scalable.

Set the value

Devices receive and parse a custom-formatted value through a non-DP command.

  • You can send a value in custom JSON, a string, or a protocol-specific format.
  • The device developer defines the value's format and parsing logic entirely.

Example:

Command codePayload (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
  • The platform only transmits the value to the device; execution logic runs on the device.
  • Non-DP commands give custom-protocol devices more control flexibility. Combine custom expressions, command codes, and values to build varied human-machine interactions.

After you configure the command solution, click Confirm and Test.

Step 2: Test the configuration

Test entry
Test entry

Click Go to test and follow the steps:

Test flow
Test flow

  1. Configure allowlist accounts. Under Allowlist Account, click Add Account. Select the mobile app, add the accounts, then click Save. You can add up to three accounts.
  2. Add a virtual device. Use the OEM app or the SmartLife app to scan the QR code and add the virtual device.
  3. Scan and test. Scan the QR code to enter the AI Smart Assistant and test.

Step 3: Publish

Click Next Step: Publish Effect to publish the commands. Confirm the settings and click OK.

warning

Published commands cannot be revoked.

Publish confirmation
Publish confirmation

The page then shows Released.

Released status
Released status

Manage versions

Click Manage Versions to view and edit versions on the History Version page.

Manage Versions entry
Manage Versions entry

History Version page
History Version page

Click Add Version to test a configuration and release a new version.

Add Version
Add Version

See also