Skip to main content

Get Scenes

Get all scenes of zone.

Description

This action allows you to retrieve all scenes within a area, including:

  • Scene Number
  • Scene Name
  • Zone Information

Request Topic

LYT/41e0d6b2-37de-43d8-a348-4ba94853b6cd/ZONE/ACTION

Request Payload

{
"version": "v1.0",
"action": "get-scenes",
"limit": 2,
"offset": 1,
"data": {
"zone_address": 63035
}
}

Request Field Descriptions

FieldTypeRequiredDescription
versionstringYesAPI version identifier (must be "v1.0")
actionstringYesAction to perform (must be "get-scenes")
zone_addressstringYesZone Address should be like this : data > zone_address
limitnumberNoMaximum number of records to return (default: 50)
offsetnumberNoNumber of records to skip (default: 0)

Response Topic

LYT/41e0d6b2-37de-43d8-a348-4ba94853b6cd/ZONE/E/ACTION

Response Payload

Success Response

{
"message": "success",
"version": "v1.0",
"action": "get-scenes",
"data": [
{
"scene_number": 33012,
"scene_name": "Night",
"zone_name": "Test 1",
"zone_address": 63035,
"models": [
{ "type": "dimmer", "count": 1 },
{ "type": "switch", "count": 2 }
]
},
{
"scene_number": 47637,
"scene_name": "Good Morming",
"zone_name": "Test 1",
"zone_address": 63035,
"models": [
{ "type": "dimmer", "count": 1 },
{ "type": "switch", "count": 1 }
]
}
]
}

Error Handling

1. Project Not Found Error (Code: 2002)

{
"message": "error",
"message_type": {
"code": 2002,
"message": "Project not found",
"errorCode": "PROJECT_NOT_FOUND"
}
}

When it occurs:

  • The project UUID is invalid
  • The project has been deleted
  • The user doesn't have access to the project

How to resolve:

  1. Verify the project UUID is correct
  2. Check if you have the necessary permissions
  3. Ensure the project exists
  4. Contact system administrator if you should have access

2. Zone Not Found Error (Code: 2005)

{
"message": "error",
"message_type": {
"code": 2005,
"message": "Zone not found",
"errorCode": "ZONE_NOT_FOUND"
}
}

When it occurs:

  • The zone address is invalid
  • The zone has been deleted

How to resolve:

  1. Verify the zone address is correct
  2. Check if you have the necessary permissions
  3. Ensure the zone exists

3. Constraint Error (Code: 3005)

a. Zone Address Error

{
"message": "error",
"message_type": {
"code": 3005,
"message": "zone_address must be number",
"errorCode": "CONSTRAINT_ERROR"
}
}

b. Version Error

{
"message": "error",
"message_type": {
"code": 3005,
"message": "version must be one of the following values: v1.0",
"errorCode": "CONSTRAINT_ERROR"
}
}

c. Action Error

{
"message": "error",
"message_type": {
"code": 3005,
"message": "action must be one of the following values: get, get-zones, get-nodes, get-scenes, get-groups",
"errorCode": "CONSTRAINT_ERROR"
}
}

Constraint errors occur in the following cases:

  1. Zone Address Constraints:

    • Zone Address must be a number
    • Zone Address field should not be empty
    • Zone Address field has incorrect type
  2. Action Constraints:

    • Action must be one of: get, get-zones, get-nodes, get-scenes, get-groups
    • Action field is missing
    • Action field has incorrect value
  3. Version Constraints:

    • Version must be exactly "v1.0"
    • Version field is missing
    • Version field has incorrect format

Resolution:

  • Always use "v1.0" as the version value
  • Use "get-scenes" as the type value
  • Ensure zone address is correct
  • Validate all parameters before sending

Error Code Summary

CodeError CodeDescriptionSolution
2002PROJECT_NOT_FOUNDProject doesn't existsCheck project UUID valid or not
2005ZONE_NOT_FOUNDZone doesn't existsCheck zone address valid or not
3005CONSTRAINT_ERRORParameter validation failedCheck input values