Skip to main content

Delete Scene

Delete scene of a zone.

Description

This action allows you to delete an existing scene from zone by providing the scene number.

Request Topic

LYT/f7bdc7e7-1847-4c54-b1d4-64d3d0a833f7/SCENE/ACTION

Request Payload

{
"version":"v1.0",
"action": "delete",
"data": {
"scene_number": 53586
}
}

Request Field Descriptions

FieldTypeRequiredDescription
versionstringYesAPI version identifier (must be "v1.0")
actionstringYesAction to perform (must be "delete")
scene_numbernumberYesScene number should be like this : data > scene_number

Response Topic

LYT/f7bdc7e7-1847-4c54-b1d4-64d3d0a833f7/SCENE/E/ACTION

Response Payload

Success Response

{
"message":"success",
"version":"v1.0",
"action":"delete",
"data":{
"scene_number": 53586
}
}

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

How to resolve:

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

2. Scene Not Found Error (Code: 3007)

{
"message": "error",
"message_type": {
"code": 3007,
"message": "Scene not found",
"errorCode": "Scene_NOT_FOUND"
}
}

When it occurs:

  • The scene number is invalid
  • The scene has been deleted
  • The scene doesn't belong to the specified project

How to resolve:

  1. Verify the scene number is correct
  2. Check if the scene exists in the project
  3. Ensure the scene hasn't been already deleted

3. Node Already Exists in Scene Error (Code: 3019)

{
"message": "error",
"message_type": {
"code": 3019,
"message": "Node already exists in scene",
"errorCode": "NODE_ALREADY_EXISTS_IN_SCENE"
}
}

When it occurs:

  • The scene contains devices that need to be removed first

How to resolve:

  1. Remove all devices from the scene before deleting

Note: Scene deletion requires the scene to be completely empty of all dependencies.

4. Constraint Error (Code: 3005)

a. Scene Number Error

{
"message": "error",
"message_type": {
"code": 3005,
"message": "scene_number must be a 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, create, delete, edit",
"errorCode": "CONSTRAINT_ERROR"
}
}

Constraint errors occur in the following cases:

  1. Scene Number Constraints:

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

    • Action must be one of: get, create, delete, edit
    • 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 "delete" as the action value
  • Validate all parameters before sending

5. Scene Already Assigned Error (Code: 3020)

{
"message": "error",
"message_type": {
"code": 3020,
"message": "Scene already assigned",
"errorCode": "SCENE_ALREADY_ASSIGNED"
}
}

When it occurs:

  • The scene is assigned to another entity that needs to be unassigned first

How to resolve:

  1. Unassign the scene from any entities before deleting

6. Cloud Not Activated Error (Code: 3010)

{
"message":"error",
"message_type":
{
"code":3010,
"message":"Cloud not activated",
"errorCode":"CLOUD_NOT_ACTIVATED"
}
}

When it occurs:

  • The Cloud connection is deactivated
  • The Cloud connection is disconnected

How to resolve:

  1. Verify the cloud is connected / activated.
  2. Enable cloud connection.
  3. Connect to the cloud.

Error Code Summary

CodeError CodeDescriptionSolution
2002PROJECT_NOT_FOUNDProject doesn't existsCheck project UUID valid or not
3007SCENE_NOT_FOUNDScene doesn't existsCheck scene number valid or not
3005CONSTRAINT_ERRORParameter validation failedCheck input values
3010CLOUD_NOT_ACTIVATEDCloud not activatedCheck cloud connection
3017SCENE_ALREADY_ASSIGNEDScene is assigned to another entityUnassign scene from entities first
3019DEVICE_ALREADY_EXISTS_IN_SCENEScene contains devicesRemove all devices from scene first