Add device models (post models)
The vendor adds a new device model to the database of Sber Smart Home.
Sample case:
- The vendor has started to produce or sell a new device model in Russia: a light bulb, a socket or other goods.
- The vendor notifies Sber Smart Home about the new model.
- Smart Home Sber adds the new device model to its base.
Query format
The vendor sends a notification to Sber Smart Home endpoint: https://partners.iot.sberdevices.ru/
. Please note that in order to access the Sber cloud, Russian certificates must be installed on vendor's server.
For the headers, see Query headers.
POST /v1/models
Query body:
Field | Type | Mandatory? | Description |
models | list<object> | ✔︎ | List of device models (see Device model (model)) |
{
"models": [
{
"id": string,
"manufacturer": string,
"model": string,
"hw_version": string,
"sw_version": string,
"description": string,
"category": string,
"features": [
string,
string,
// ...
],
"dependencies": {
"func_name": {
"key": string,
"value": [
{
"type": string,
"type_value": object
},
{
// ...
}
]
}
},
"allowed_values": {
"func_name": {
"type": string,
"type_values": {
"min": object,
"max": object,
"step": object
},
},
{
// ...
}
}
},
{
// ...
}
]
}
Response format
Sber Smart Home sends a response to the vendor's endpoint. For the headers, see Query headers.
Success response:
HTTP/1.1 200 OK
If an error occurs, Sber Smart Home may return:
- A list of
errors
, containing error objects. Each object points to specific devices with their adding unsuccessful. - A common error that describes the problem as a whole and is returned when the problem cannot be juxtaposed with specific models.
If a vendor notified of several devices, and Sber Smart Home has managed to post some of them, but an error occurs when posting the rest, Sber Smart Home will send an error response containing a list of devices not posted.
Device-specific error:
{
"errors": [
{
"id": string,
"code": integer,
"message": string
}
]
}
Common error:
{
"code": integer,
"message": string,
"details": list<string>
}
Sample query and response
The vendor notifies Sber Smart Home that a model of smart socket has been added.
Query:
curl -i -X POST /v1/models HTTP/1.1 \
-H Host: example.com \
-H Content-Type: application/json \
-H Authorization: Bearer qwerty-1234-... \
-H X-Request-Id: abcd-0000-ifgh-...
{
"models": [
{
"id": "QWERTY123",
"manufacturer": "Xiaqara",
"model": "SM1123456789",
"hw_version": "3.1",
"sw_version": "5.6",
"description": "Smart socket Xiaqara",
"category": "socket",
"features": [
"online",
"on_off",
"sleep_timer",
"child_lock",
"current",
"power",
"voltage"
],
"allowed_values": {
"power": {
"type": "INTEGER",
"integer_values": {
"min": "10",
"max": "45000",
"step": "1"
}
}
}
}
]
}
Success response:
HTTP/1.1 200 OK
Error response:
{
"errors": [
{
"id": "QWERTY123",
"code": 500,
"message": "System error"
}
]
}