getSceneListByHomeID(params: GetSceneListByHomeIDParams)

Requires:
@tuya-miniapp/cloud-api≥1.1.0

Description

Get the list of one-tap execution and automation scenes for a home

Parameters

ParameterTypeRequiredDescription
YesRequest body

Return Value

Type: Promise<GetSceneListByHomeIDResult>
GetSceneListByHomeIDResult (see type definitions and minituya return parameters for field meanings)

Referenced Types

typeGetSceneListByHomeIDResult
Scene[]

Examples

Request example

import { getSceneListByHomeID } from '@tuya-miniapp/cloud-api';

getSceneListByHomeID({
  gid: '123456789',
})
  .then(response => {
    console.log(response);
  })
  .catch(error => {
    console.error('Failed to get scene list:', error);
  });

Response example

[
  {
    "id": "scene_001",
    "name": "Home mode",
    "coverIcon": "https://example.com/icon.png",
    "description": "Automatically turn on the lights when you arrive home",
    "displayColor": "6559D1",
    "enabled": true,
    "matchType": 1,
    "ruleGenre": 2,
    "ruleType": 3,
    "runtimeEnv": "prod",
    "scenarioRule": true,
    "actions": [
      {
        "id": "action_001",
        "actionExecutor": "dpIssue",
        "actionStrategy": "edge",
        "attribute": 3,
        "defaultIconUrl": "https://example.com/icon.png",
        "deleteDevIcon": "https://example.com/icon.png",
        "devDelMark": true,
        "enabled": true,
        "entityId": "device_001",
        "executorProperty": {
          "28": 18
        },
        "executorPropertyKeyOrder": [
          "28"
        ],
        "extraProperty": {
          "dpScale": 0,
          "path": "/pages/device/detail/index"
        },
        "gmtModified": 1699200000000,
        "offGwSync": false,
        "orderNum": 1,
        "ruleId": "scene_001",
        "status": false,
        "uid": "user_001"
      }
    ],
    "conditions": [
      {
        "id": "condition_001",
        "attribute": 3,
        "condType": 1,
        "defaultIconUrl": "https://example.com/icon.png",
        "deleteDevIcon": "https://example.com/icon.png",
        "devDelMark": true,
        "enabled": true,
        "entityId": "device_002",
        "entitySubIds": "1",
        "entityType": 1,
        "expr": [
          [
            "$dp1",
            "==",
            "disarmed"
          ]
        ],
        "extraInfo": {},
        "handleStrategy": "",
        "iconUrl": "https://example.com/icon.png",
        "orderNum": 1,
        "ruleId": "scene_001",
        "serviceProvider": "",
        "support": 0
      }
    ],
    "arrowIconUrl": "https://example.com/arrow.png",
    "attribute": 4,
    "auditStatus": 0,
    "background": "",
    "boundForPanel": false,
    "boundForWiFiPanel": false,
    "categorys": [
      "home",
      "light"
    ],
    "code": "",
    "commonField": "{\"subMatchType\":1}",
    "containDeviceDelete": false,
    "deviceIds": [
      "device_001",
      "device_002"
    ],
    "disableTime": 0,
    "forceCloudTrigger": false,
    "gmtCreate": 1699200000000,
    "gmtModified": 1699200000000,
    "iotAutoAlarm": false,
    "isAlarmIssue": false,
    "isLogicRule": false,
    "linkageType": 0,
    "localLinkage": false,
    "needCleanGidSid": false,
    "needValidOutOfWork": false,
    "newLocalScene": false,
    "offGwSync": false,
    "offGwSyncSuccess": false,
    "orderWeight": 1,
    "outOfWork": 0,
    "ownerId": "123456789",
    "panelType": 0,
    "permissionCode": "",
    "ruleSource": 0,
    "status": true,
    "statusConditions": [],
    "stickyOnTop": true,
    "subMatchType": 1,
    "uid": "user_001"
  }
]