Skip to main content

Common Errors

Each RPC request can be successful or unsuccessful. In the first case the response frame contains a result object while in the second case it contains an error object as stated in the RPC Protocol page. Each error object has:

  • code: number, code ifdentifying the type of the error
  • message: string, description of the error

Here are listed all common errors that can be returned as a response to a request send to a Shelly device.

-103: INVALID ARGUMENT#

This error is received when the parameters sent in the request do not match the ones specified by the method in the request. It has code -103.

Example:

Request invoking the method Switch.GetStatus with no parameters:
curl -X POST -d '{"id":1, "src":"user_1", "method":"Switch.GetStatus"}' \
http://${SHELLY}/rpc
Response containing error -103: INVALID ARGUMENT:
{
"id": 1,
"src": "shellypro4pm-f008d1d8b8b8",
"dst": "user_1",
"error": {
"code": -103,
"message": "Missing required 'id'"
}
}

-105: NOT FOUND#

This error is received when an instance specified in the request is not found. It has code -105.

Example:

Request invoking the method Input.GetConfig with invalid [arameter id=3:
curl -X POST -d '{"id":1, "src":"user_1", "method":"Input.GetConfig", "params":{"id":7}}' \
http://${SHELLY}/rpc
Response containing error -105: NOT FOUND:
{
"id": 1,
"src": "shellypro4pm-f008d1d8b8b8",
"dst": "user_1",
"error": {
"code": -105,
"message": "Bad id=3"
}
}

-108: RESOURCE EXHAUSTED#

This error is received when a required resourse has reached its limit. For example, when you try to create 21 schedule jobs on one Shelly device (the limit is 20). This error has code -108.

Example:

Response containing error -108: RESOURCE EXHAUSTED:
{
"id": 1,
"src": "shellypro4pm-f008d1d8b8b8",
"dst": "user_1",
"error": {
"code": -108,
"message": "Job limit reached"
}
}

-109: FAILED PRECONDITION#

This error is received when a precondition for a requested action is not satisfied. For example, when you try to turn a switch on in a situation of overpower condition. This error has code -109.

Example:

Response containing error -109: FAILED PRECONDITION:
{
"id": 1,
"src": "shellypro4pm-f008d1d8b8b8",
"dst": "user_1",
"error": {
"code": -109,
"message": "Overtemp condition present"
}
}