Transmitting status change commands (commands)
Last updated on December 22, 2024
Direction: cloud → client.
Sber Smart Home requests from the agent app changes in the state of devices.
Use case example:
- The user changes the lamp state, e.g. by turning it off, in the Salute app, on SberPortal, SberBox or on another device with installed Salute assistant.
- The Smart Home sends a lamp state change request to the agent app installed on the controller.
- The agent delivers the request to the controller, and the controller switches the lamp off.
Message format
Topic:
sberdevices/v1/<username>/down/commands
Parameter | Type | Mandatory? | Description |
username | string | ✔︎ | Login for connection to the Sber MQTT server (see [Getting data for connecting an agent to the cloud](/en/smarthome/mqtt-diy/agent-authorization) section) |
Message body:
Field | Type | Mandatory? | Description |
devices | dict<string, object> | ✔︎ | Devices whose state needs to be changed. For each device, the device ID in the vendor's system and the new state of its functions are transmitted |
ID | string | ✔︎ | Device ID in the vendor's system |
states | list<object> | ✔︎ | List of new states (see Device state (state)) |
{
"devices": {
"id1": {
"states": [
{
"key": string,
"value": {
"type": string,
"type_value": object
}
},
{
// ...
}
]
}
}
}
Message example
Sber Smart Home requests from the agent app installed on the controller changes in the socket state.
Topic:
sberdevices/v1/1234567/down/commands
Message body:
{
"devices": {
"ABCD_003": {
"states": [
{
"key": "online",
"value": {
"type": "BOOL",
"bool_value": true
}
},
{
"key": "on_off",
"value": {
"type": "BOOL",
"bool_value": true
}
}
]
}
}
}