getSceneAndAuto(devOrGroupId: string)
Requires:
@tuya-miniapp/cloud-api≥1.1.0
Description
Get all scenes and automations for a device
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
devOrGroupId | string | Yes | Device ID or group ID, used to query all scenes and automations associated with the device or group |
Return Value
Type: Promise<SceneAndAuto>
SceneAndAuto (autos is the automation list, scenes is the Tap-to-Run list; see the type definitions and minituya return parameters for field meanings)
Referenced Types
type
SceneAndAuto| Property | Type | Description |
|---|---|---|
autos | SceneOrAuto[] | Automation list |
scenes | SceneOrAuto[] | Tap-to-Run list |
Examples
Request example
Response example
Additional notes
-
Concepts:
autos(automations): include trigger conditions and actions; they run automatically when conditions are met. Automations include thesceneIconsfield.scenes(one-tap scenes): run manually when tapped; they have no trigger conditions. One-tap scenes do not include thesceneIconsfield.
-
Parameters:
devOrGroupIdaccepts a device ID or group ID and returns all scenes and automations related to that device or group.- The API separates automations and one-tap scenes into the
autosandscenesfields.
-
Errors:
- If
devOrGroupIdis empty or invalid, the API throws:"getSceneAndAuto failed: devId or groupId is null!". - Errors are normalized internally; use
.catch()to handle failures.
- If