Create Zone
Create zone of an area.
Description
This action allows you to create a new zone within an area by providing the zone name and area UUID.
Note: (User can create isolated zone and non-isolated zone both but response will be same for both type of zone)
Request Topic
LYT/f7bdc7e7-1847-4c54-b1d4-64d3d0a833f7/ZONE/ACTION
Request Payload
Create a regular zone:
{
"version":"v1.0",
"action": "create",
"data": {
"zone_name": "Living Room",
"area_uuid": "8067232e-b301-47c6-99d6-d4cf04369114"
}
}
Create an isolated room:
{
"version":"v1.0",
"action": "create",
"data": {
"zone_name": "Master Bedroom",
"area_uuid": "8067232e-b301-47c6-99d6-d4cf04369114",
"isolated": true
}
}
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 "create") |
| zone_name | string | Yes | Zone name should be like this : data > zone_name |
| area_uuid | string | Yes | Area UUID should be like this : data > area_uuid |
| isolated | boolean | No | Whether the zone is isolated (default: false) |
Response Topic
LYT/f7bdc7e7-1847-4c54-b1d4-64d3d0a833f7/ZONE/E/ACTION
Response Payload
Success Response
{
"message":"success",
"version":"v1.0",
"action":"create",
"data":{
"zone_address":54423,
"zone_name":"Living Room",
"area_uuid":"2b7c1d3d-babb-4498-af52-a252bf7fe515",
"area_name":"My Sweet Hom",
"models":[]
}
}
Error Handling
1. Project Not Found Error (Code: 2002)
{
"message": "error",
"message_type": {
"code": 2002,
"message": "Project not found",
"errorCode": "PROJECT_NOT_FOUND"
}
}
e 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. Area Not Found Error (Code: 2003)
{
"message": "error",
"message_type": {
"code": 2003,
"message": "Area not found",
"errorCode": "AREA_NOT_FOUND"
}
}
When it occurs:
- The area UUID is invalid
- The area has been deleted
- The area doesn't belong to the specified project
How to resolve:
- Verify the area UUID is correct
- Check if the area exists in the project
- Ensure the area hasn't been already deleted
3. Constraint Error (Code: 3005)
a. Zone Name Error
{
"message": "error",
"message_type": {
"code": 3005,
"message": "zone_name must be a string",
"errorCode": "CONSTRAINT_ERROR"
}
}
b. Area UUID Error
{
"message": "error",
"message_type": {
"code": 3005,
"message": "area_uuid must be a string",
"errorCode": "CONSTRAINT_ERROR"
}
}
c. Version Error
{
"message": "error",
"message_type": {
"code": 3005,
"message": "version must be one of the following values: v1.0",
"errorCode": "CONSTRAINT_ERROR"
}
}
d. 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 Name Constraints:
- Zone Name must be a string
- Zone Name field should not be empty
- Zone Name field has incorrect type
-
Area UUID Constraints:
- Area UUID (area_uuid) must be a string
- Area UUID field should not be empty
- Area UUID field has incorrect type
-
Isolated Constraints:
- Isolated field must be a boolean
- Isolated field is optional (defaults to false)
-
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 "create" as the action value
- Validate all parameters before sending
4. 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 |
| 2003 | AREA_NOT_FOUND | Area doesn't exists | Check area UUID valid or not |
| 3005 | CONSTRAINT_ERROR | Parameter validation failed | Check input values |
| 3010 | CLOUD_NOT_ACTIVATED | Cloud not activated | Check cloud connection |