Delete Zone
Delete zone of an area.
Description
This action allows you to delete an existing zone within an area by providing the zone address.
Request Topic
LYT/f7bdc7e7-1847-4c54-b1d4-64d3d0a833f7/ZONE/ACTION
Request Payload
{
"version":"v1.0",
"action": "delete",
"data": {
"zone_address": 51507
}
}
Request Field Descriptions
| Field | Type | Required | Description |
|---|---|---|---|
| version | string | Yes | API version identifier (must be "v1.0") |
| action | string | Yes | Action to perform (must be "delete") |
| zone_address | number | Yes | Zone address should be like this : data > zone_address |
Response Topic
LYT/f7bdc7e7-1847-4c54-b1d4-64d3d0a833f7/ZONE/E/ACTION
Response Payload
Success Response
{
"message":"success",
"version":"v1.0",
"action":"delete",
"data":{
"zone_address": 51507
}
}
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:
- Verify the project UUID is correct
- Check if you have the necessary permissions
- Ensure the project exists
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
- The zone doesn't belong to the specified project
How to resolve:
- Verify the zone address is correct
- Check if the zone exists in the project
- Ensure the zone hasn't been already deleted
3. Node Already Exists in Zone Error (Code: 3012)
{
"message": "error",
"message_type": {
"code": 3012,
"message": "Node already exists in zone",
"errorCode": "NODE_ALREADY_EXISTS_IN_ZONE"
}
}
When it occurs:
- The zone contains devices (nodes) that need to be removed first
How to resolve:
- Remove all devices from the zone before deleting
4. Group Already Exists in Zone Error (Code: 3013)
{
"message": "error",
"message_type": {
"code": 3013,
"message": "Group already exists in zone",
"errorCode": "GROUP_ALREADY_EXISTS_IN_ZONE"
}
}
When it occurs:
- The zone contains groups that need to be deleted first
How to resolve:
- Delete all groups in the zone before deleting
5. Scene Already Exists in Zone Error (Code: 3014)
{
"message": "error",
"message_type": {
"code": 3014,
"message": "Scene already exists in zone",
"errorCode": "SCENE_ALREADY_EXISTS_IN_ZONE"
}
}
When it occurs:
- The zone contains scenes that need to be deleted first
How to resolve:
- Delete all scenes in the zone before deleting
6. Gateway Already Exists in Zone Error (Code: 3015)
{
"message": "error",
"message_type": {
"code": 3015,
"message": "Gateway already exists in zone",
"errorCode": "GATEWAY_ALREADY_EXISTS_IN_ZONE"
}
}
When it occurs:
- The zone has a gateway assigned that needs to be removed first
How to resolve:
- Remove the gateway assignment before deleting
7. Zone Already Assigned Error (Code: 3016)
{
"message": "error",
"message_type": {
"code": 3016,
"message": "Zone already assigned",
"errorCode": "ZONE_ALREADY_ASSIGNED"
}
}
When it occurs:
- The zone is assigned to another entity that needs to be unassigned first
How to resolve:
- Unassign the zone from any entities before deleting
Note: Zone deletion requires the zone to be completely empty of all dependencies.
8. Constraint Error (Code: 3005)
a. Zone Address Error
{
"message": "error",
"message_type": {
"code": 3005,
"message": "zone_address 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, get-groups, get-nodes, get-scenes, create, delete, edit",
"errorCode": "CONSTRAINT_ERROR"
}
}
Constraint errors occur in the following cases:
-
Zone Address Constraints:
- Zone Address must be a number
- Zone Address field should not be empty
- Zone Address field has incorrect type
-
Action Constraints:
- Action must be one of: get, get-groups, get-nodes, get-scenes, create, delete, edit
- Action field is missing
- Action field has incorrect value
-
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
9. 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:
- Verify the cloud is connected / activated.
- Enable cloud connection.
- Connect to the cloud.
Error Code Summary
| Code | Error Code | Description | Solution |
|---|---|---|---|
| 2002 | PROJECT_NOT_FOUND | Project doesn't exists | Check project UUID valid or not |
| 2005 | ZONE_NOT_FOUND | Zone doesn't exists | Check zone address valid or not |
| 3012 | NODE_ALREADY_EXISTS_IN_ZONE | Zone contains devices | Remove all devices from zone first |
| 3013 | GROUP_ALREADY_EXISTS_IN_ZONE | Zone contains groups | Delete all groups in zone first |
| 3014 | SCENE_ALREADY_EXISTS_IN_ZONE | Zone contains scenes | Delete all scenes in zone first |
| 3015 | GATEWAY_ALREADY_EXISTS_IN_ZONE | Zone has gateway assigned | Remove gateway assignment first |
| 3016 | ZONE_ALREADY_ASSIGNED | Zone is assigned to another entity | Unassign zone from entities first |
| 3005 | CONSTRAINT_ERROR | Parameter validation failed | Check input values |
| 3010 | CLOUD_NOT_ACTIVATED | Cloud not activated | Check cloud connection |