Skip to main content

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

FieldTypeRequiredDescription
versionstringYesAPI version identifier (must be "v1.0")
typestringYesMessage type (must be "switch")
addressnumberYesAddress 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:

  1. Verify the node address is correct
  2. Check if the node exists in the system
  3. Ensure the node is properly configured
  4. 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:

  1. Address Constraints:

    • Address must be a valid number
    • Address field is missing
    • Address field has incorrect type
  2. Type Constraints:

    • Type must be one of: "cct", "dimmer", "switch", "fan", "curtain", "rgb"
    • Type field is missing
    • Type 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 "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:

  1. Verify the project_uuid in your MQTT topic is correct
  2. Check if you have the necessary permissions to access the project
  3. 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:

  1. Check your network connection
  2. Verify MQTT broker is accessible
  3. Ensure node devices are powered and connected

Error Code Summary

CodeError CodeDescriptionSolution
3005CONSTRAINT_ERRORParameter validation failedCheck input values
2028NODE_NOT_FOUNDNode not availableVerify node exists
2002PROJECT_NOT_FOUNDProject doesn't existCheck project_uuid
3002REQUEST_TIMEOUTRequest took too longCheck connectivity