ym88659208ym87991671
Device relay | Documentation for developers

relay

Last updated on May 25, 2023

A relay is a device that turns the connected device’s (lamp, socket, etc.) power on/off upon getting a command. It is usually connected to the power grid.

Available device functions

The device can have all the functions listed below or some of them. E.g. if the smart relay cannot measure the current energy consumption, there is no need in including the current, power, voltage functions in its model description.

The device has two mandatory functions: online, on_off. All relays must have them.

FunctionMandatory?Description
currentExisting current, mA
on_off✔︎Turning the device on and off remotely
online✔︎Device availability: offline or online
powerExisting power, W
voltageExisting voltage, V

Relay model description example

The model shall be described in accordance with the model structure. 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.

Besides, allowed values for the power function (consumed power) of the model are changed: devices of this model can measure the power from 10 to 45,000 W at an interval of 1 W.

{
"id": "QWERTY124",
"manufacturer": "Xiaqara",
"model": "SM1123456789",
"hw_version": "3.1",
"sw_version": "5.6",
"description": "Xiaqara smart relay ",
"category": "relay",
"features": [
"online",
"on_off",
"current",
"power",
"voltage"
],
"allowed_values": {
"power": {
"type": "INTEGER",
"integer_values": {
"min": "10",
"max": "45000",
"step": "1"
}
}
}
}

User's relay description example

The device shall be describe in accordance with the device structure. The example contains no relay model description as we believe that models are described independently and the model ID will be enough (in this case, QWERTY124).

{
"id": "ABCD_004",
"name": "My relay",
"default_name": "Smart relay",
"nicknames": ["Intelligent relay", "Smart switcher"],
"home": "My home",
"room": "Living room",
"groups": ["Video equipment", "Wiring"],
"model_id": "QWERTY124",
"hw_version": "3.1",
"sw_version": "5.6",
"partner_meta": {
"internal-id": 1234,
"specificity": "microchip 2A"
},
}
Sber process cookies only to personalize services according to Cookies Usage Policy. You can prevent the processing of cookies in your browser settings.