Skip to main content

Shelly BLU Distance

Short device name: SBDI-003E

Functional description

  • Buttons: 1
  • LED
  • Ultrasonic distance sensor
  • Vibration sensor

The main function of the device is to measure distance using ultrasonic technology. The measurements are done periodically on 30 seconds interval (by default). Measurement is also activated on button press, and optionally on vibration. Data is transmitted through two channels:

  • BLE Advertising - The measured values are broadcast periodically as BLE advertising packets
  • Zigbee Communication - The sensor data is also sent over the Zigbee network to the bound devices

Device specific features

Measured ranges

Measurment algorithm works different on short, middle and long ranges. These 3 ranges can be enabled separately.

Ranges are set using a bitmask: CLOSE = 0x01, MIDDLE = 0x02, FAR = 0x04. By default - all ranges are enabled.

CharacteristicUUIDTypeLengthPropertiesFunction
Measured rangesd61da5aa-5515-46ae-a2b2-f9a5a9ad5f1ebyte1Read, Write bonded, write without response bondedBit mask of enabled ranges

Measure interval

Valid range is 5 seconds to 300 seconds. Default value is 30 seconds.

CharacteristicUUIDTypeLengthPropertiesFunction
Measure interval342d88e8-88e3-4aa6-8cf8-178ad229a049byte2Read, Write bonded, write without response bondedMeasurement period in seconds [5-300]

Measure on vibration (deprecated)

Measure on vibration is enabled by default.

CharacteristicUUIDTypeLengthPropertiesFunction
Measure on vibrationb65a6119-889b-4275-869e-946a93bd23c4byte1Read, Write bonded, write without response bonded1 - enable, 0 - disable
  • this feature is planned for removal in the forecomming firmwares.

Configuration using the button

  • Press 1 time: Trigger on-demand measurement.
  • Press 3 times rapidly: Send Zigbee Identify query broadcast.
  • Press 4 times rapidly: Enter Bluetooth pairing mode.
  • Press 5 times rapidly: Enter Zigbee inclusion mode.
  • Press and hold for 10 seconds: Enter Bluetooth pairing mode.
  • Press and hold for 30 seconds: Factory reset.

BLE pairing

Duration: 1 min

To enter BLE pairing, press the button 4 times or hold it for 10 seconds. The BLE pairing process is indicated by the LED flashing. (0.5s on/0.5s off)

Adding to a ZigBee network

Duration: 1 min

To start the ZigBee steering process, press the button 5 times. Indicated by the LED flashing. (0.2s on/0.8s off)

ZigBee identify

Duration: 5 seconds

To trigger ZigBee identify, press the button 3 times. Indicated by the LED flashing. (0.2s on/0.2s off)

Factory reset

To trigger a factory reset, hold the button for 30 seconds. The LED will turn on, and a reset of the device will follow.

Bluetooth

Advertising (BTHome)

Beacon

BTHome sensor data objects
idnamedata typescale factordescription
0x00packet iduint81revolving counter
0x01batteryuint81battery level in percent (0-100)
0x2Cvibration*uint81vibration detected
0x3Abuttonuint161button press event
0x40distance mmuint161measured distance
  • Vibration is planned for removal

Button press events

idnameexample
0x00None0x3A00
0x01press0x3A01

Characteristics

CharacteristicUUIDTypeAccessDefaultMeaning
Measured rangesd61da5aa-5515-46ae-a2b2-f9a5a9ad5f1euint8rw0x07Bit mask of enabled ranges (CLOSE=0x01, MIDDLE=0x02, FAR=0x04)
Measure interval342d88e8-88e3-4aa6-8cf8-178ad229a049uint16rw30Measurement period in seconds [5-300]
Measure on vibrationb65a6119-889b-4275-869e-946a93bd23c4uint8rw10: disabled, 1: enabled
Measure algorithm881959c1-8e34-4cb8-9393-0e8aa6610d54uint8rw00: Basic algorithm, 1: Confidence algorithm
Attenuation configurationa7432eac-3518-4931-9867-b03e2674e8adbyte[13]rw0Attenuation bit array (see below)
Factory resetb0a7e40f-2b87-49db-801c-eb3686a24bdbuint8w-1: perform factory reset

Confidence algorithm

Measurement algorithm selection

CharacteristicUUIDTypeLengthPropertiesFunction
Measure algorithm881959c1-8e34-4cb8-9393-0e8aa6610d54byte1Read, Write bonded, write without response bondedvalue*
  • 0 = Basic algorithm, 1 = Confidence algorithm

The Basic algorithm returns the distance detected in the first range possible.

Confidence algorithm compares the data from all enabled ranges and reports the distance from the most confident object.

  • Factory default: 0 = Basic algorithm

Attenuation

Attenuation by default is set to all zeroes - no change.

CharacteristicUUIDTypeLengthPropertiesFunction
Attenuation configurationa7432eac-3518-4931-9867-b03e2674e8adbyte13Read, Write bonded, write without response bondedBit array - read below.
  • A single attenuation setting is applied to a whole decimeter.
  • Decimeter is rounded so the setting for decimeter 10 (1m) applies to the range 950mm-1049mm.
  • Total attenuation ranges: 52 for proper byte padding.
  • Attenuation: 2 bits per range.
Bit settingMultiplierAttenuationDescription
0x01x2+6dBDouble the confidence
0x00x10dBDo not change
0x11x0.5-6dBHalve the confidence
0x10x0-∞Clear result

Byte ordering: Sample: 00112233445566778899AABBCC 00 - decimeters 0 to 3 11 - decimeters 4 to 7 ... CC - decimeters 48 to 51

Bit ordering: Sample: 0bwwxxyyzz zz - decimeter 0 yy - decimeter 1 xx - decimeter 2 ww - decimeter 3

BTHome sensor data objects (Confidence algorithm)

Packet 1:

idnamedata typescale factordescription
0x00packet iduint81revolving counter
0x01batteryuint81battery level in percent (0-100)
0x2Cvibrationuint81vibration detected
0x3Abuttonuint161button press event
0x40distance mmuint161measured distance
0x09countuint8_t1confidence in % of the reported value

Packet 2:

idnamedata typescale factordescription
0x00packet iduint81revolving counter
0x54rawuint8 x10-packed listing of top 5 results with their confidence *

Raw data consits of 10 bytes - 5 groups of 2 bytes.

2-byte group format

byte 2*n+0byte 2*n+1, bit 0byte 2*n+1, bits 1-7
Distance in cm - LSBDistance in cm - MSB 1 bitConfidence

Example data as can be seen on Shelly BLE Debug App's screen:

raw:0: C16AD022EE1C88156409

  • C16A: 193cm distance with 53% confidence
  • D022: 208cm distance with 17% confidence
  • EE1C: 238cm distance with 14% confidence
  • 8815: 392cm distance with 10% confidence
  • 6409: 356cm distance with 4% confidence

Values are sorted by confidence decreasing. Distance is rounded to cm (35mm to 44mm = 4cm) to save packet space. Total sum of percents may be between 95-100 due to integer rounding.

ZigBee

ZigBee device info

Device Id: 0x0107 (Occupancy Sensor) Profile Id: 0x0104 (Home Automation)

EPDirIdClusterIdAttribute/CommandAccess/Direction
1S0x0000Basic0x0000ZCL Versionr
0x0001Application versionr
0x0004Manufacturer namer
0x0005Model Identifierr
0x0007Power sourcer
0x4000Sw Build Idr
0xFFFDCluster Rev.r
S0x0001Power config0x0021Battery percentage remainingrp
0xFFFDCluster Rev.r
C0x0003Identify0xFFFDCluster Rev.r
0x0000IdentifyC->S
0x0001IdentifyQueryC->S
S0x0003Identify0x0000Identify timer
0xFFFDCluster Rev.r
0x0000IdentifyC->S
0x0001IdentifyQueryC->S
S0x0406Occupancy Sensing0x0000Occupancyrp
0x0001Occupancy sensor typer
0x0002Occupancy sensor type bitmapr
0xFFFDCluster Rev.r
S0xFC22Occupancy Config MFC:0x14900x0000Distance (mm)rp
0x0001Occupied thresholdrw
0x0002Hysteresisrw
0xFFFDCluster Rev.r

Bootloader

To enter bootloader mode, hold the button while the device starts (when inserting the battery).

LED will blink rapidly, indicating bootloader mode.