Skip to content

Device 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.

Device added ​

Topic ​

res/device/add

Example message ​

json
[
    {
        "ext_button": [],
        "ext_light": [],
        "ext_sync": {},
        "has_new": 0,
        "id": "10E48D35-0ABD-47EB-BA4B-C150D68C4B23",
        "join_status": 1,
        "name": "Bar Lamp",
        "new_version": "",
        "online": 1,
        "product": {
            "cat1_id": 2,
            "cat1_name": "Light",
            "cat2_id": 205,
            "cat2_name": "RGB CW Light",
            "cat3_id": 20504,
            "cat3_name": "Bar Lamp",
            "hardware_version": "6",
            "manufacturer": "Bweetech",
            "model": "915005988001",
            "software_version": "",
            "zigbee_version": "4.11.11_50"
        },
        "services": [
            {
                "rid": "8BAD2C8A-38BE-41CB-A4D3-563B5C7E9C03",
                "rtype": "light"
            }
        ],
        "type": "device"
    }
]

Fields ​

FieldTypeDescription
idstringDevice UUID.
typestringAlways device.
namestringDevice name
join_statusinteger1: the device has been added.
onlineinteger1 when the device is first added successfully.
has_newinteger1 if a firmware update is available; otherwise 0.
new_versionstringAvailable firmware version.
productobjectProduct details. See DeviceDetail.
servicesobject[]Services
services[].ridstringResource UUID
services[].rtypestringResource type
ext_lightobject[]Light state. See LightDetail.
ext_syncobjectSync device state. See SyncDetail.
ext_buttonobject[]Button state.

Event details ​

  • The gateway sends this event once the device has joined the network and join_status is set to 1.

Device deleted ​

Topic ​

res/device/remove

Example message ​

json
[
    {
        "id": "10E48D35-0ABD-47EB-BA4B-C150D68C4B23",
        "type": "device"
    }
]

Fields ​

FieldTypeDescription
idstringUnique device ID.
typestringAlways device.

Event details ​

  • Sent when a device is deleted or its join_status changes to 0.

Device updated ​

Topic ​

res/device/update

Example message ​

json
[
    {
        "id": "10E48D35-0ABD-47EB-BA4B-C150D68C4B23",
        "value": {
            "name": "吧灯01"
        }
    }
]

Fields ​

FieldTypeDescription
idstringDevice ID.
valueobjectFields changed by this event.

Fields in value

FieldTypeDescription
value.namestringDevice name
value.room_idstringRoom UUID.

Event details ​

  • Sent when the device'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.