Device model (model)
The structure describes characteristics and functions of the model of a device, such as a lamp or a socket.
The structure is used:
When the vendor sends information about device models to the Sber Smart Home:
- when sending a request Add device models (post models);
- when sending a request Update device models (put models).
When the Sber Smart Home sends a response to the vendor's request Get a list of device models (get models).
The structure is also used when the vendor or Sber Smart Home sends information about the user's device (the structure device) and the model ID model_id
is not specified for this device.
Field | Type | Mandatory? | Description |
id | string | ✔︎ | Model ID (often product_id) |
manufacturer | string | ✔︎ | Manufacturer |
model | string | ✔︎ | Full model name |
hw_version | string | Equipment version | |
sw_version | string | Firmware version | |
description | string | Description | |
category | string | ✔︎ | Device category (see Devices) |
features | list<string> | ✔︎ | List of functions (see Device functions) |
dependencies | map<string, object> | Function dependencies (see Function dependencies (dependencies) | |
allowed_values | map<string, object> | Allowed values of functions (see Allowed values of functions (allowed_values)) |
{
"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
},
},
{
// ...
}
}
}
Device model description example
The example describes a lamp that can be switched on/off remotely, supports both the white light mode and the colour mode, can change its light intensity, colour and colour temperature. The lamp has a time-out timer.
Besides, a dependency between the light_colour
and light_mode
functions is described for the model: the strip light colour may only be changed if switched to the colour mode.
Allowed values for the light_brightness
functions have also been changed: it is indicated that devices of this model can change the brightness from 10 to 900 at an interval of 1.
{
"id": "QWERTY123",
"manufacturer": "Xiaqara",
"model": "SM0123456789",
"hw_version": "3.2",
"sw_version": "5.7",
"description": "Xiaqara smart lamp",
"category": "light",
"features": [
"online",
"on_off",
"light_mode",
"light_brightness",
"light_colour",
"light_colour_temp",
"sleep_timer"
],
"dependencies": {
"light_colour": {
"key": "light_mode",
"value": [
{
"type": "ENUM",
"enum_value": "colour"
}
]
}
},
"allowed_values": {
"light_brightness": {
"type": "INTEGER",
"integer_values": {
"min": "10",
"max": "900",
"step": "1"
}
}
}
}