You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This document defines the Object ID and Object format in MiBeacon usage scenarios. The device needs to broadcast the MiBeacon containing the Object when reporting events or properties. The gateway will parse the valid Object and report it to the Mijia backend, which can be displayed by the APP or perform a series of automated operations.
BLE Object format
Field
length
description
Object ID
2
Mijia definition ID
Object Data Len
1
Data length
Object Data
N
data
BLE gateway restrictions
The BLE device reports events or attributes (MiBeacon including Object) to the Xiaomi IoT platform through the gateway. In order to ensure that the gateway can report data normally and enable users to get a good user experience, the BLE gateway needs to follow the following restrictions:
Support up to 50 devices to report information under the same gateway;
Older gateways such as MTK7697 1.x, etc. only support access to devices of up to 15 categories;
When there are more than 200 BLE devices broadcasting data around the gateway, the performance of the gateway will be affected;
MiBeacon data with a length greater than 31 bytes (Byte) is not supported;
Each BLE device can only support up to 7 objects;
Each MiBeacon broadcast package can only contain one Object;
The effective data length of each Object is up to 10 bytes (Byte).
ID definition
Defined by Mijia, the distribution is as follows:
0x0000-0x1001 are Bluetooth general events
0x1002-0x1FFF are Bluetooth general attributes
0x2000-0x2FFF are vendor-defined attributes, and the corresponding vendor shall apply to Xiaomi
0x3000-0x3FFF is a manufacturer-defined event, and the corresponding manufacturer applies to Xiaomi
In order to ensure that the data is timely and effective, and not to cause heavy load pressure on the Mijia server, the Mijia BLE gateway will filter different types of data according to the ID. When the data is separated from the previously reported data by a certain time and exceeds a certain amount of change, The BLE gateway will forward the data to the Mijia server. Therefore, the time interval and variation are specifically defined, as shown in the following table.
In order to ensure that the events and attributes represented by the Object can be received by the Mijia BLE gateway, the MiBeacon containing the Object needs to be retransmitted many times. Refer to the Mijia BLE MiBeacon protocol for details.
Passing case
name
ID
Time interval (seconds)
Variation
connection
0x0001
0
0
Easy pairing
0x0002
0
0
near
0x0003
0
0
keep away
0x0004
0
0
Lock (obsolete)
0x0005
0
0
fingerprint
0x0006
0
0
Gate
0x0007
0
0
Armed
0x0008
0
0
Gesture controller
0x0009
0
0
body temperature
0x000A
60
0
lock
0x000B
0
0
Flooding
0x000C
0
0
smoke
0x000D
0
0
Gas
0x000E
0
0
Someone is moving (with light)
0x000F
0
0
Toothbrush incident
0x0010
0
0
Cat eye incident
0x0011
0
0
Weighing event
0x0012
0
0
button
0x1001
0
0
General attributes
name
ID
Time interval (seconds)
Variation
Sleep
0x1002
600
0
RSSI
0x1003
0
ten
temperature
0x1004
600
one
humidity
0x1006
600
one
Light illuminance
0x1007
600
one
Soil moisture
0x1008
600
one
Soil EC value
0x1009
600
one
Power
0x100A
600
0
lock
0x100E
60
0
Gate
0x100F
60
0
formaldehyde
0x1010
600
one
Bind
0x1011
600
0
switch
0x1012
600
0
Remaining amount of consumables
0x1013
600
0
Flooding
0x1014
one
one
smoke
0x1015
one
one
Gas
0x1016
one
one
No one moves
0x1017
one
one
Light intensity
0x1018
one
one
Door sensor
0x1019
one
one
Weight attributes
0x101A
600
0
No one moves over time
0x101B
one
one
Smart pillow
0x101C
60
one
Vendor custom attributes
name
ID
Time interval (seconds)
Variation
Body temperature (measured every second)
0x2000
600
0
Mi Band (Huami)
0x2001
600
one
Vacuum cleaner (Rui Mi)
0x2002
600
0
Black plus bracelet (like one)
0x2003
600
0
Vendor-defined event
name
ID
Time interval (seconds)
Variation
Monitor (flowers and grasses)
0x3000
600
one
Sensor location (Qingping)
0x3001
600
0
Pomodoro incident (Qingping)
0x3002
0
0
Xiaobei toothbrush incident (Qinghe Xiaobei)
0x3003
0
0
Event format definition
Easy pairing event
name
length
description
Object ID
2
Object ID to be paired, such as key press event (0x1001)
Fingerprint event
name
length
description
Key ID
4
See above
Match result
1
see below
Key ID is divided into the following categories:
0x00000000: the administrator of the lock
0xFFFFFFFF: unknown operator
The matching results are divided into the following categories:
0x00: match successfully
0x01: match failed
0x02: Timeout is not put
0x03: Low quality (too light, fuzzy)
0x04: insufficient area
0x05: The skin is too dry
0x06: The skin is too wet
Gate incident
name
length
description
status
1
see below
The status is divided into the following categories:
0x00: open the door
0x01: Close the door
0x02: Timeout is not closed
0x03: knock on the door
0x04: Pry the door
0x05: The door is stuck
Armed event
name
length
description
Whether to enable
1
Open (0x01), close (0x00)
Timestamp
4
UTC time (optional)
Gesture controller event
name
length
description
gesture
2
see below
Gestures are divided into the following categories:
0x0001: Shake
0x0002: flip 90 degrees
0x0003: flip 180 degrees
0x0004: plane rotation
0x0005: tap
0x0006: Nudge
Body temperature incident
name
length
description
body temperature
2
Signed variable, the unit is 0.01 degrees, example: A7 0E = 0x0EA7 means 37.51 degrees
Lock event
name
length
description
operating
1
see below
Key ID or Exception ID
4
see below
Timestamp
4
Operation timestamp
The lower 4 bits of the operation field represent action, which is divided into the following categories:
0000b: unlock outside the door
0001b: Locked (If it is not possible to distinguish the lock inside or outside the door, use this type to report)
0010b: Turn on anti-lock
0011b: Release the anti-lock
0100b: unlock inside the door
0101b: The door is locked
0110b: Turn on child lock
0111b: Turn off the child lock
1000b: Lock outside the door
1111b: Abnormal
The upper 4 bits of the operation field represent the method, which is divided into the following categories:
0x07: All lock tongues pop out (square tongue, dull tongue, oblique tongue pop out)
Door attributes
name
length
description
status
1
Open the door (0x00), close the door (0x01), abnormal (0xFF)
Formaldehyde properties
name
length
description
Formaldehyde value
2
The accuracy is 0.01mg/m3, example: 10 00 = 0x0010 means 0.16mg/m3
Binding properties
name
length
description
status
1
Unbound (0x00), bound (0x01)
Switch attribute
name
length
description
switch
1
Close (0x00), open (0x01)
Consumables remaining quantity attributes
name
length
description
remaining
1
Remaining percentage, range 0~100
Flooding properties
name
length
description
Submerged state
1
Submerged (0x01), not submerged (0x00)
Smoke properties
name
length
description
Smoke state
1
Normal monitoring (0x00), fire alarm (0x01), equipment failure (0x02)
Gas properties
name
length
description
Gas status
1
With leakage (0x01), no leakage (0x00)
Unmanned mobile properties
name
length
description
length of time
4
The duration of the unmanned state, in seconds
Remarks: If someone moves, you need to report the attribute of unmanned movement with time 0
Light intensity attributes
name
length
description
Light intensity
1
Strong light (0x01), weak light (0x00)
Note: If the child device can report accurate illuminance, please use the illuminance attribute (0x1007) to report
Door magnetic properties
name
length
description
Door sensor status
1
0x00: open the door, 0x01: close the door, 0x02: not closed after timeout, 0x03: device reset
Weight attributes
name
length
description
Current weight value
2
Unit is grams
No one moves over time
name
length
description
status
1
0 means someone is moving, 1 means no one is moving in X seconds
Note: The user configures X seconds for unmanned movement on the plug-in side, the firmware side stores this set value, and reports this object when the time expires.
Smart pillow
name
length
description
status
1
Current state of the smart pillow: 0x00: "Get out of bed" (not on the pillow); 0x01: "In bed" (lie on the pillow); 0x02-0xFF reserved
Measure body temperature in seconds
name
length
description
Skin temperature
2
Accurate to 0.01 degree
PCB temperature
2
Accurate to 0.01 degree
Power
1
Battery percentage
Huami bracelet attributes
name
length
description
Step count
2
Current step
Sleep
1
Fall asleep (0x01), wake up (0x02)
RSSI
1
Absolute value of current signal strength
Ruimi vacuum cleaner properties
name
length
description
mode
1
Charging (0x00), standby (0x01), standard (0x02), strong (0x03), abnormal (0xFF)