Skip to content

Room events ​

Field paths are relative to one object in the message array. [] means an array item: for example, services[].rid is the rid of each service. Fields under value are shown as value.name, value.color_arr[].x, and so on.

Room added ​

Topic ​

res/room/add

Example message ​

json
[
    {
        "id": "748670A4-EE28-4D08-B9A7-3D7F217A7E6B",
        "type": "room",
        "name": "主卧",
        "room_kind": 0,
        "room_type": "",
        "background": 1,
        "icon": "assets/room/room4.png",
        "sequence": 0,
        "children": [],
        "services": [
            {
                "rid": "B59EAB99-7D80-4AD2-8C2C-126ED7BED25F",
                "rtype": "group_light"
            }
        ]
    }
]

Fields ​

FieldTypeDescription
idstringRoom UUID.
typestringAlways room.
namestringRoom name
room_kindintegerAlways 0.
room_typestringRoom category, expressed as a free-form string.
sequenceintegerRoom order, expressed as a number.
childrenobject[]Always an empty array.
servicesobject[]List of supported services.
services[].ridstringResource UUID
services[].rtypestringResource type
backgroundintegerBweeApp only: room wallpaper index.
iconstringBweeApp only: room wallpaper name.

Event details ​

  • Sent when a new room is created.
  • New rooms have no devices yet, so children is empty in this event.

Room deleted ​

Topic ​

res/room/remove

Example message ​

json
[
    {
        "id": "748670A4-EE28-4D08-B9A7-3D7F217A7E6B",
        "type": "room"
    }
]

Fields ​

FieldTypeDescription
idstringRoom UUID.
typestringAlways room.

Event details ​

  • Sent when a room is deleted.

Room updated ​

Topic ​

res/room/update

Example message ​

json
[
    {
        "id": "748670A4-EE28-4D08-B9A7-3D7F217A7E6B",
        "value": {
            "name": "主卧(南)"
        }
    }
]

Fields ​

FieldTypeDescription
idstringRoom ID.
valueobjectFields changed by this event.

Fields in value

FieldTypeDescription
value.namestringRoom name
value.room_typestringRoom type
value.sequenceintegerRoom sequence number
value.backgroundintegerRoom background index
value.iconstringRoom background name
value.device_addstring[]UUIDs of devices added to the room.
value.device_delstring[]UUIDs of devices removed from the room.

Event details ​

  • Sent when the room's properties change. The value object contains only the changed fields.
  • Apply the fields in value to your local state. Fields absent from the message have not changed.