Skip to Content

BS IoT Command

Configuration of Bluetooth Low Energy (BLE) sensors with support for multiple device types.


What is it for?

Use caseDescription
🌡️ Environmental monitoringTemperature, humidity and pressure readings with BLE sensors
Fuel controlEscort TD sensors for wireless fuel level
🚪 Door detectionMagnetic BLE sensors for door status
🏃 Motion detectionPIR sensors and BLE accelerometers
📊 Advanced telemetryIntegration of multiple sensors in a single device

Description

The BS command allows configuration of up to 4 BLE sensors in IoT devices. It supports a wide variety of sensor types including iBeacon, Eddystone, Rinho sensors and Escort sensors.

For each configured sensor, a BSaa signal is automatically created that can be used in the event engine.


Features

  • 4 sensors - Indices 00-03 independently configurable
  • 35+ sensor types - iBeacon, Eddystone, Rinho, Escort
  • Attribute query - Individual reading of specific values
  • Configurable timeout - State control by time without update
  • Rules integration - Use in event engine

Commands

Configuration

SBSaab,id,type,time,distance,outval

Response

RBSaab,id,type,time,distance,outval;attrkeyvalue_0,...attrkeyvalue_N

Parameters

ParameterDescription
aaSensor index (00 to 03)
bSensor state (E = enable, D = disable, * = clear configuration)
idBLE device MAC address in hexadecimal format (12 characters)
typeBLE sensor type (see types list)
timeTime in seconds without update to consider signal as false
distanceDistance in meters for sensors like iBeacon
outvalValue to display when reading is not valid
attrkeyvalueSensor attribute, key:value

Associated Signals

SignalIndexConditional useEdges
BSaa00-03YES+ Positive edge, - Negative edge

Available Sensor Types

iBeacon and Eddystone Sensors

TypeNameAttributes
0Automatic SensorNo specific attributes
1iBeaconuuid, major, minor, tx_power, rssi, distance
2Eddystone UIDnamespace, instance, rssi
3Eddystone TLMbatt, temp, adv_cnt, sec_cnt
43-Axis Accelerometerx, y, z, battery, ranging_data, adv_int, sr, full_scale, mt, rssi

Rinho BLE Sensors

TypeNameAttributes
5Device Informationbattery, adv_int, ranging_data, dv_prop_ind, switch_s_ind, fwt, fw, rssi
6MK ButtonaccX, accY, accZ, battery, triggerStatus, triggerCount, deviceId, rssi
7Temperature and Humiditytemp, hum, battery, ranging_data, adv_int, device_type, rssi
8PIR (Passive Infrared)door_status, battery, delay_response_status, sensor_sensitivity, detection_status, major, minor, rssi
9Door Sensor (MK Door)door_status, delay_response_status, sensor_sensitivity, detection_status, battery, major, minor, rssi
10MK Sensor Infomag_st, mot_st, mag_cnt, mot_cnt, x, y, z, temp, hum, batt, tag, rssi

MOKO S02R Sensor (ToF)

TypeNameAttributes
11MOKO S02R (ToF)dist, batt, rssi, type, age

The MOKO S02R sensor measures distance by Time-of-Flight (ToF) and exposes two main readings:

AttributeDescriptionUnit
distDistance measured by ToFmillimeters (mm)
battSensor battery voltagemillivolts (mV)

These values are available through QBS, EVAL and the BSW auto-detection.

Configuration (type 11):

>SBS00E,A1B2C3D4E5F6,11,0,0,NA< // Index 00, Enabled (E), sensor MAC // 11 → MOKO S02R (ToF) // time=0, distance=0, outval=NA

Reading query:

>QBS00.dist< // Distance in mm >QBS00.batt< // Battery in mV

Support for the MOKO S02R sensor (type 11) is available from firmware v1.09.23.


Escort BLE Sensors

TypeNameAttributes
30Escort TD (Fuel)fuel_lvl, battery, temp, fw, opmode, rssi
31Escort TT (Temperature)temp, battery, fw, rssi
32Escort TL (Temperature and Light)temp, lum, battery, fw, rssi
33Escort DU (Angle)mode, event, tilt, roll, pitch, battery, fw, rssi
34Escort TH (Temperature, Humidity and Light)temp, lum, hum, press, mode, battery, fw, rssi
35Escort TH (with Display)temp, lum, hum, di, mode, battery, fw, rssi

Configuration and Query Example

Configuration:

>SBS01E,A1B2C3D4E5F6,30,60,10,INVALID<

Meaning:

  • Index 01, Enabled (E)
  • MAC: A1B2C3D4E5F6
  • Type 30 (Escort TD - Fuel)
  • Timeout: 60 seconds
  • Distance: 10 meters
  • Invalid value: INVALID

Fuel Level Query:

>QBS01.fuel_lvl<

Response:

>432;ID=865413053386354;*25<

Compatibility

💾Firmware:v1.00.00
SP-IOT
SM-IOT
ZE-IOT

See Also

Last updated