Control Curtain
Control curtain group by setting their curtain level.
Description
The curtain control allows you to manage curtains by setting:
- curtain_level (0-100%)
Example
Request Topic
LYT/41e0d6b2-37de-43d8-a348-4ba94853b6cd/NODE/CONTROL
Request Payload
You can control the curtain level. The curtain_level parameter is required in the request.
Examples:
Set curtain level:
{
"version": "v1.0",
"type": "curtain",
"address": 50646,
"curtain_level": 60
}
Field Descriptions
| Field | Type | Range | Description |
|---|---|---|---|
| version | string | "v1.0" | API version identifier |
| type | string | "curtain" | Message type for fan control |
| address | number | node address | Unicast address of the target node |
| curtain_level | number | 0-100 | Curtain level in percentage (0 = fully closed, 100 = fully open) |
Response topic
LYT/41e0d6b2-37de-43d8-a348-4ba94853b6cd/NODE/E/STATUS
Response Payload
Success Response
{
"version": "v1.0",
"message": "success",
"type": "curtain",
"address": 50646,
"curtain": {
"curtain_level": 3
}
}
Error Handling
The API may return various error responses based on different scenarios. Here are the possible errors and their resolutions:
1. Constraint Errors (Code: 3005)
a. Curtain level Constraint:
{
"message": "error",
"message_type": {
"code": 3005,
"message": "curtain_level must be an integer between 0 to 100",
"errorCode": "CONSTRAINT_ERROR"
},
"address": 50646
}
b. Version Constraint:
{
"message": "error",
"message_type": {
"code": 3005,
"message": "version must be equal to v1.0",
"errorCode": "CONSTRAINT_ERROR"
}
}
c. Type Constraint:
{
"message": "error",
"message_type": {
"code": 3005,
"message": "type must be one of the following values: cct, dimmer, switch, fan, curtain, rgb",
"errorCode": "CONSTRAINT_ERROR"
}
}
d. Address Constraint:
{
"message": "error",
"message_type": {
"code": 3005,
"message": "address must be a number conforming to the specified constraints",
"errorCode": "CONSTRAINT_ERROR"
}
}
Constraint errors occur in the following cases:
-
Curtain level Constraints:
- Curtain level value must be between 1 and 5
- Curtain level field is missing
- Curtain level field must be number
-
Version Constraints:
- Version is not exactly "v1.0"
- Version field is missing
- Version field has incorrect format
-
Type Constraints:
- Type must be one of: "cct", "dimmer", "switch", "fan", "curtain", "rgb"
- Type field is missing
- Type field has incorrect value
-
Address Constraints:
- Address must be a number
- Address field is missing
- Address field has incorrect type (must be number)
Resolution:
- Ensure curtain_level is an number between 1 and 5
- Always use "v1.0" as the version value
- Use correct type value from allowed list: "cct", "dimmer", "switch", "fan", "curtain", "rgb"
- Ensure address is a number
- Validate all parameters before sending
2. Node Not Found Error (Code: 4004)
{
"message": "error",
"message_type": {
"code": 2028,
"message": "Node not found",
"errorCode": "NODE_NOT_FOUND"
}
}
3. Project Not Found Error (Code: 4003)
{
"message": "error",
"message_type": {
"code": 2002,
"message": "Project not found",
"errorCode": "PROJECT_NOT_FOUND"
}
}
4. Request Timeout Error (Code: 5001)
{
"message": "error",
"message_type": {
"code": 3002,
"message": "Request timeout",
"errorCode": "REQUEST_TIMEOUT"
}
}
Error Code Summary
| Code | Error Code | Description | Solution |
|---|---|---|---|
| 3005 | CONSTRAINT_ERROR | Parameter validation failed | Check input values |
| 2028 | NODE_NOT_FOUND | Node not available | Verify node status |
| 2002 | PROJECT_NOT_FOUND | Project doesn't exist | Check project_uuid |
| 3002 | REQUEST_TIMEOUT | Request took too long | Check connectivity |