Switch Node Status
Get the current status of switches in a node.
Description
The switch status allows you to retrieve the current state of switches in a node including:
- Current power state (on/off)
Request Topic
LYT/41e0d6b2-37de-43d8-a348-4ba94853b6cd/NODE/STATUS
Request Payload
{
"version": "v1.0",
"type": "switch",
"address": 57364
}
Request Field Descriptions
| Field | Type | Required | Description |
|---|---|---|---|
| version | string | Yes | API version identifier (must be "v1.0") |
| type | string | Yes | Message type (must be "switch") |
| address | number | Yes | Address of the node |
Response Topic
LYT/41e0d6b2-37de-43d8-a348-4ba94853b6cd/NODE/E/STATUS
Response Payload
Success Response
{
"version": "v1.0",
"message": "success",
"type": "switch",
"address": 57364,
"switch": {
"power": true
}
}
Error Handling
1. Node Not Found Error (Code: 2028)
{
"message": "error",
"message_type": {
"code": 2028,
"message": "Node not found",
"errorCode": "NODE_NOT_FOUND"
},
"type": "fan",
"address": 50646
}
When it occurs:
- The specified node address doesn't exist
- Node has been deleted
- Node is not configured
How to resolve:
- Verify the node address is correct
- Check if the node exists in the system
- Ensure the node is properly configured
- Use node management API to list available nodes
2. Constraint Error (Code: 3005)
a. Address Constraint:
{
"message": "error",
"message_type": {
"code": 3005,
"message": "address must be a number conforming to the specified constraints",
"errorCode": "CONSTRAINT_ERROR"
},
"type": "fan",
"address": 50646
}
b. 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"
},
"type": "fan",
"address": 50646
}
c. Version Constraint:
{
"message": "error",
"message_type": {
"code": 3005,
"message": "version must be one of the following values: v1.0",
"errorCode": "CONSTRAINT_ERROR"
},
"type": "fan",
"address": 50646
}
Constraint errors occur in the following cases:
-
Address Constraints:
- Address must be a valid number
- Address field is missing
- Address field has incorrect type
-
Type Constraints:
- Type must be one of: "cct", "dimmer", "switch", "fan", "curtain", "rgb"
- Type field is missing
- Type 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 "switch" as the type value
- Ensure address is a valid number
- Validate all parameters before sending
3. Project Not Found Error (Code: 2002)
{
"message": "error",
"message_type": {
"code": 2002,
"message": "Project not found",
"errorCode": "PROJECT_NOT_FOUND"
},
"type": "fan",
"address": 50646
}
When it occurs:
- The project_uuid in your MQTT topic is invalid
- The project has been deleted
- The user doesn't have access to the project
How to resolve:
- Verify the project_uuid in your MQTT topic is correct
- Check if you have the necessary permissions to access the project
- Contact system administrator if you should have access but don't
4. Request Timeout Error (Code: 3002)
{
"message": "error",
"message_type": {
"code": 3002,
"message": "Request timeout",
"errorCode": "REQUEST_TIMEOUT"
},
"type": "fan",
"address": 50646
}
When it occurs:
- Network connectivity issues
- Node devices are not responding
- MQTT broker connection issues
How to resolve:
- Check your network connection
- Verify MQTT broker is accessible
- Ensure node devices are powered and connected
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 exists |
| 2002 | PROJECT_NOT_FOUND | Project doesn't exist | Check project_uuid |
| 3002 | REQUEST_TIMEOUT | Request took too long | Check connectivity |