Devices status transmission (status)
Last updated on December 22, 2024
Direction: client → cloud.
The agent app notifies Sber Smart Home of changes in the device state.
Use case example:
- The device’s function state has changed for any reason. E.g. the lamp was turned off manually.
- The agent receives from the controller the current device state and sends a message indicating it. The message can be sent independently or as a response to the Smart Home's message: sberdevices/v1/<username>/down/status_request.
- The Smart Home receives a new state of the device and updates it in the Salute app, on SberPortal, SberBox and other devices with Salute assistant.
Message format
Topic:
sberdevices/v1/<username>/up/status
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 status information is being transmitted. For each device, the device ID in the vendor's system and the status of its functions are transmitted |
ID | string | ✔︎ | Device ID in the vendor's system |
states | list<object> | ✔︎ | List of states (see Device state (state)) |
{
"devices": {
"id1": {
"states": [
{
"key": string,
"value": {
"type": string,
"type_value": object
}
},
{
// ...
}
]
}
}
}
Message example
The agent app installed on the controller notifies Sber Smart Home of changes in the state of the online
and on_off
functions of the socket.
Topic:
sberdevices/v1/1234567/up/status
Message body:
{
"devices": {
"ABCD_003": {
"states": [
{
"key": "online",
"value": {
"type": "BOOL",
"bool_value": true
}
},
{
"key": "on_off",
"value": {
"type": "BOOL",
"bool_value": true
}
}
]
}
}
}