Step 3. Adding device models
If you have multiple identical devices describe their models in your SmartMarket Studio project. You will be able to use these models when you add devices on customer controllers: you will only need to select a device model, and the boilerplate list of its functions will be filled out automatically. There will be no need to select functions manually.
The fields used to describe models in Smart Home API are described in the Device model (model) section. This will help you when you add models in SmartMarket Studio: you will need to describe the same fields, only via the interface.
In SmartMarket Studio, open the integration project.
On the
tab, in the right upper corner, click on Create model (Создать модель).Enter model features and functions in the form fields:
Model ID (Идентификатор модели). Model ID (often, product_id).
Manufacturer (Производитель). Device manufacturer.
Model name (Название модели). Model name as used by the manufacturer.
Hardware version (Версия оборудования). Hardware module version.
Firmware version (Версия прошивки). Hardware module firmware version.
Description (Описание). Free-format device description.
Device category (Категория устройства). What category the device model relates to.
Functions list (Список функций). Device model functions: what devices of this model can do. The available functions range depends on the device category; for more, see the Device functions section.
Function dependencies (Зависимости функций). This block describes cases when one function will only be available if another one is in a certain state. For example, colored lamps of certain models may work in two modes: colored light mode and white light mode. Depending on which mode the user has selected, the range of available functions should change, too: if the colored light mode is selected, the lamp colour change function should become available; if the white light mode is selected, the colour change function should be blocked.
In the Function (Функция) list, select a dependent function – its availability will depend on another function. In the depends on (зависит от) list, select the defining function – the dependent function will depend on its state. In the last drop-down list, select defining function's values at which the dependent function becomes available.
For more on dependencies, see the Function dependencies section.
Click on Create model (Создать модель).
Model description example
The example describes a relay capable of turning on and off a connected device on a remote command, and also capable of metering power consumption. The relay functions have no dependencies.
Model ID: QWERTY124
Manufacturer: Xiaqara
Model name: SM1123456789
Hardware version: 3.1
Firmware version: 5.6
Description: Xiaqara smart relay
Device category: relay
Functions list: online, on_off, current, power, voltage