sensor_door | Documentation SmartMarket
Skip to main content


Opening sensor.

Device functions available

The device may have all the following functions or just some of them. For example, if a sensor cannot indicate the battery charge level, there is no need to include the battery_percentage function in its model description.

Some functions are mandatory for all opening sensors.

battery_low_powerWhether the batter is charged or not
battery_percentageBattery charge level
doorcontact_state✔︎Indicates whether the sensor contacts are open or closed. If the contacts are open, it means that the sashes of a door, window or other similar structure are open. Closed contacts mean that the sashes are closed.
online✔︎Device availability: offline or online
sensor_sensitiveThe level of sensor sensitivity
signal_strengthThe strength of the signal
tamper_alarmAlarm in case the sensor has been tampered with

Sample description of an opening sensor model

The model is described in accordance with the model structure. the sample describes an opening sensor, which is able to report whether the sashes are open or closed now and whether the sensor has been tampered with. The sensor also indicates the signal strength, the battery charge level and whether the battery is discharged; it also has a sensitivity setting.

"id": "QWERTY124",
"manufacturer": "Xiaqara",
"model": "SM1123456789",
"hw_version": "3.1",
"sw_version": "5.6",
"description": "Xiaqara smart opening sensor",
"category": "sensor_door",
"features": [

Sample description of a user’s opening sensor

The model is described in accordance with the device structure. In the sample there is no description of the sensor model, therefore we believe that the models are described in a separate file and it is sufficient to specify only the model ID (in this case, QWERTY124).

The parent_id specified for the sensor is the identifier of the hub through which the sensor is connected to the smart home.

"id": "ABCD_004",
"parent_id": "A_002",
"name": "My opening sensor",
"default_name": "Smart opening sensor",
"nicknames": [
"Magnetic field sensor",
"Open sensor",
"home": "My home",
"room": "Living room",
"model_id": "QWERTY124",
"hw_version": "3.1",
"sw_version": "5.6"