Query Scenes in Home

Last Updated on : 2024-03-06 09:29:19download

Query the list of scenes in the specified home.

API address

GET: /v1.1/homes/{home_id}/scenes

Request parameter

Parameter nameTypeINRequiredDescription
home_idStringurifalseThe home ID.

Return parameter

Parameter nameTypeDescription
resultListThe returned result.

Description of result

Parameter nameTypeDescription
scene_idStringThe scene ID.
nameStringThe scene name.
backgroundStringThe background image.
actionsListThe list of actions.
enabledBooleanSpecifies whether to enable the specified scene.

Description of actions

Parameter nameTypeDescription
entity_idStringThe device ID.
executor_propertyJSONObjectThe property of the specified execution action.
action_executorStringThe type of action. Valid value: dpIssue.
extra_propertyStringThe additional information of the specified action.
action_strategyStringThe strategy of the specified execution action.

Request example

GET: /v1.1/homes/6****/scenes

Return example

{
    "result": [
        {
            "scene_id": "53IYSXI3gEn2w***",
            "enabled": true,
            "background": "https://images.tuyacn.com/smart/rule/cover/starry.png",
            "name": "Turn on light bulb",
            "actions": [
                {
                    "entity_id": "0120090568c63a89****",
                    "executor_property": {
                        "work_mode": "scene_2"
                    },
                    "action_executor": "dpIssue"
                }
            ],
            "status": "1"
        },
        {
            "scene_id": "DKgx28KbdPfz****",
            "background": "https://images.tuyacn.com/smart/rule/cover/****.png",
            "name": "Morning",
            "actions": [
                {
                    "entity_id": "012000715ccf7f4f****",
                    "executor_property": {
                        "switch_led": true
                    },
                    "action_executor": "dpIssue"
                }
            ]
        }
    ],
    "t": 1541071460239,
    "success": true
}

Error code

For more information, see error code.