TapHome

Aqara Vibration Sensor

Packet Parser → MQTT
Submitted by
Last updated: 03. 2026

Requires external gateway

tasmota zigbee2tasmota-gateway — product page

Aqara Vibration Sensor

This device communicates via Zigbee through a Tasmota gateway. Make sure you have the Zigbee2Tasmota Gateway template imported and your device paired before proceeding.

The Aqara DJT11LM is a compact battery-powered Zigbee vibration sensor that detects three types of movement: vibration, tilt and drop. It communicates with TapHome over MQTT through a Zigbee2Tasmota gateway — the sensor sends event data via the tele/{gateway}/SENSOR topic, and the template parses the proprietary AqaraVibrationsOrAngle and AqaraVibrationMode fields from the ZbReceived JSON payload.

The sensor is powered by a CR2032 coin cell battery (approximately 2-year lifespan). The template monitors battery level and voltage via service attributes, warns when battery drops below 30%, and detects device offline states (warning after 12 hours, error after 24 hours).

Configuration

Pairing the sensor
  1. On the Zigbee2Tasmota gateway, enable Permit Join (via the gateway template switch in TapHome or Tasmota console command ZbPermitJoin 1)
  2. Press and hold the button on the Aqara vibration sensor until the blue LED starts blinking, then release
  3. The sensor should pair within 60 seconds
  4. Note the assigned Device ID (e.g., 0xC9A9) from the gateway’s service attributes or Tasmota console
Import parameters

After pairing, import the device template with these parameters:

ParameterDescriptionExample
MQTT Broker IP AddressIP of the MQTT broker192.168.1.10
MQTT Broker PortBroker port (default 1883)1883
Gateway nameTasmota MQTT topic (Configuration → MQTT → Topic)tasmota_XXXXX
Device IDShort Zigbee address from pairing0xC9A9

Aqara/Xiaomi Zigbee devices do not fully comply with the Zigbee standard and may experience connectivity issues with certain Zigbee routers. Known incompatible routers include Centralite, General Electric, OSRAM, Sylvania, SmartThings and Securifi. Use routers confirmed compatible with Xiaomi devices (e.g., IKEA TRADFRI).

Device capabilities

Tilt angle

The Tilt Angle device reads the AqaraVibrationsOrAngle field from the ZbReceived JSON payload. The value is reported in degrees as a direct assignment — the listener script parses the angle from each SENSOR message and updates the sensor value immediately.

The tilt angle reflects the current orientation of the sensor relative to the surface it is attached to. It updates whenever the sensor detects a tilt event and transmits a SENSOR message.

Vibration mode

The Vibration Mode device reads the AqaraVibrationMode field from the ZbReceived JSON payload. It maps the string values to numeric states via a SWITCH expression:

StateValueDescription
Drop0Free-fall or dropping event detected
Tilt1Tilting or angle change detected
Vibrate2Vibration or touch detected

The mode updates on each movement event. States 3-9 are defined in the template as placeholders but are not actively mapped by the listener script — value 4 is used as a default fallback for any unrecognized mode.

Battery and device health

The module exposes several service attributes populated by the ZbInfo polling mechanism (1-hour interval via the ReadScript):

  • Battery Percentage — estimated CR2032 battery level. A warning is raised when the level drops below 30%.
  • Battery Voltage — current battery voltage in volts.
  • Link Quality — Zigbee signal strength scaled from 0-254 to 0-100%.
  • IEEEAddr, ModelId, Manufacturer, Endpoints, Config — device identification and Zigbee configuration metadata.

The template also tracks LastSeenEpoch from ZbInfo responses. If the sensor has not been seen for more than 12 hours, a warning is raised. After 24 hours, an error is raised — indicating the sensor may be offline, out of range, or its battery is depleted.

CR2032 battery updates from Zigbee devices can take up to 24 hours to refresh. A sudden drop does not necessarily mean the battery is failing — wait for the next reporting cycle.

Additional capabilities

The DJT11LM also supports 3 sensitivity levels (low, medium, high) configurable via manufacturer-specific Zigbee commands (ZbSend with Manuf: 0x115F). Some Zigbee platforms additionally expose a separate vibration intensity/count value alongside the tilt angle. These capabilities can be added in a future template update.

Troubleshooting

Sensor not reporting data
  1. Verify the Zigbee2Tasmota gateway is connected to the MQTT broker and receiving messages (check tele/{GWname}/SENSOR in an MQTT client)
  2. Confirm the Device ID in the template matches the short address assigned during pairing (e.g., 0xC9A9)
  3. Check the Link Quality service attribute — values below 20% indicate a weak Zigbee signal. Move the sensor closer to the gateway or add a compatible Zigbee router device
  4. Press the sensor button once to force a transmission and verify the gateway receives the message
Vibration mode stuck on fallback value
  1. Check the Zigbee2Tasmota firmware version — the AqaraVibrationMode field uses proprietary Aqara Zigbee attributes that require up-to-date firmware
  2. Verify that the ZbReceived payload contains the AqaraVibrationMode field (use an MQTT client to inspect the raw tele/{GWname}/SENSOR messages)
  3. If the mode always reports value 4 (fallback), the device may be sending an unrecognized event type — check the Tasmota console for the full JSON payload
Device shows offline warning
  1. Check the battery level — a depleted CR2032 will cause the sensor to stop transmitting
  2. The Aqara vibration sensor is a Zigbee end device (not a router) and communicates through nearby Zigbee router devices. If a router goes offline, the sensor may become unreachable
  3. Try pressing the sensor button to wake it and force a re-association with the Zigbee network
  4. If the issue persists, re-pair the device by holding the button until the blue LED blinks
Adjusting sensitivity manually

The TapHome template does not include sensitivity configuration. To change sensitivity, use the Tasmota console directly:

  • Low sensitivity: ZbSend {"Device":"0xC9A9","Manuf":"0x115F","Write":{"0000/FF0D%20":21}}
  • Medium sensitivity: ZbSend {"Device":"0xC9A9","Manuf":"0x115F","Write":{"0000/FF0D%20":11}}
  • High sensitivity (default): ZbSend {"Device":"0xC9A9","Manuf":"0x115F","Write":{"0000/FF0D%20":1}}

Replace 0xC9A9 with the actual Device ID of the sensor.

How to install in TapHome

Prerequisites

  • Zigbee gateway with Tasmota firmware (e.g., Sonoff ZBBridge, eWeLink ZB-GW03)
  • MQTT broker running on your local network (TapHome built-in broker or external)
  • TapHome CCU on the same network

TapHome has a built-in MQTT broker — enable it in SettingsHardwareMQTT Broker. No additional software is needed.

Step 1 — Set Up the Tasmota Zigbee Gateway

  1. Flash Tasmota firmware on a supported Zigbee coordinator (e.g., Sonoff ZBBridge, eWeLink ZB-GW03)
  2. Connect the gateway to your Wi-Fi network via the Tasmota web UI
  3. Navigate to ConfigurationConfigure MQTT and set:
    • Host: your MQTT broker IP (e.g., 192.168.1.10)
    • Port: 1883
    • Topic: note down the topic name (e.g., tasmota_XXXXX) — you will need it during template import

For detailed instructions, see the Tasmota Zigbee documentation.

Step 2 — Import the Gateway Template in TapHome

  1. Download the gateway template from the Zigbee2Tasmota Gateway compatibility page
  2. In TapHome, go to SettingsHardwarePacket ParserImport
  3. Import the template with these parameters:
    • MQTT Broker IP Address: your broker IP (e.g., 192.168.1.10)
    • MQTT Broker Port: 1883
    • Gateway name: the Tasmota MQTT topic from Step 1 (e.g., tasmota_XXXXX)

After import, you will see two devices: Permit Join (switch) and Devices Found (counter).

Step 3 — Pair a Zigbee Device

  1. In TapHome, turn on the Permit Join switch — this opens a 60-second pairing window
  2. On the Zigbee device, start the pairing procedure (typically hold the reset button for 5 seconds until the LED blinks)
  3. Watch the Devices Found counter — it increments when a new device joins
  4. Check the Service Attributes of the gateway to see the new device’s ID (e.g., 0x1234), manufacturer, and model
  5. The pairing mode deactivates automatically after the timeout

Step 4 — Import the Device Template

  1. Download the device-specific template from the corresponding compatibility page
  2. Import the template with these parameters:
    • MQTT Broker IP Address: same as the gateway
    • MQTT Broker Port: 1883
    • Gateway name: same Tasmota MQTT topic as above
    • Device ID: the short address from pairing (e.g., 0x1234)

Available devices

Aqara Vibration Sensor Module
Service Attributes
IEEEAddr
ModelId
Manufacturer
Endpoints
Config
Link QualityZigbee signal strength — 0% (no signal) to 100% (excellent)
Battery Voltage
Battery PercentageEstimated CR2032 battery level — warning at less than 30%
Custom Variables
GWname (string)Tasmota MQTT topic name of the Zigbee gateway (found in Configuration → MQTT → Topic)
ID (string) = 0xC9A9Zigbee short address of the sensor (assigned during pairing)
After pairing the sensor via Permit Join, find the device short address in the gateway's Devices Found service attribute or via Tasmota console command ZbStatus

Aqara - Vibration Sensor

Read (module)
MQTTPUBLISH("cmnd/" + GWname+ "/ZbInfo", ID)
Listener
if INDEXOF(RECEIVEDMSG.Topic, "SENSOR") > 0
	var ZbReceived := PARSEJSON(RECEIVEDMSG.Payload, "ZbReceived." + ID, true);
    var bat := PARSEJSON(ZbReceived, "BatteryPercentage", true);
    if(!ISNULL(bat), BatteryPercentage := bat);
    var volt := PARSEJSON(ZbReceived, "BatteryVoltage", true);
    if(!ISNULL(volt), BatteryVoltage := volt);
    
    var deviceInfo := PARSEJSON(RECEIVEDMSG.Payload, "ZbInfo." + ID, true);
    if !ISNULL(deviceInfo)
    	LastSeenEpoch := PARSEJSON(deviceInfo, "LastSeenEpoch");
        COMPLETESERVICEATTRIBUTE("IEEEAddr", PARSEJSON(deviceInfo, "IEEEAddr"));
        COMPLETESERVICEATTRIBUTE("ModelId", PARSEJSON(deviceInfo, "ModelId"));
        COMPLETESERVICEATTRIBUTE("Manufacturer", PARSEJSON(deviceInfo, "Manufacturer"));
        COMPLETESERVICEATTRIBUTE("Endpoints", PARSEJSON(deviceInfo, "Endpoints"));
        #COMPLETESERVICEATTRIBUTE("Config", PARSEJSON(deviceInfo, "Config"));
        COMPLETESERVICEATTRIBUTE("Link Quality", ROUND(LINEAR(PARSEJSON(deviceInfo, "LinkQuality"), 0,0, 254, 100)) + "%");
    end
end

if BatteryPercentage < 30
	ADDWARNING("Low battery (<30%)");
end

if !ISNAN(LastSeenEpoch)
	DATETIME now := NOW();
	var secondsSeen := now.UNIXTIME - LastSeenEpoch;
	if secondsSeen > 12 * 60 * 60
		if secondsSeen > 24 * 60 * 60
			ADDERROR("Device is offline > 24H");
		else
			ADDWARNING("Device is offline > 12H");        
		end
	end
end
Service Attributes
IEEEAddr
MQTTPUBLISH("cmnd/" + GWname+ "/ZbInfo", ID)
ModelId
Manufacturer
Endpoints
Config
Link Quality
Battery Voltage
BatteryVoltage + " V"
Battery Percentage
BatteryPercentage + "%"
Tilt Angle Variable Read-only

Current tilt angle in degrees — reads AqaraVibrationsOrAngle from the Zigbee sensor payload

numeric Unit: °

Tilt Angle

Listener
if INDEXOF(RECEIVEDMSG.Topic, "SENSOR") > 0
    var val := PARSEJSON(RECEIVEDMSG.Payload, "ZbReceived." + ID + ".AqaraVibrationsOrAngle", true);
    if(!ISNULL(val), Va := val);
end
Vibration Mode Multi-value Switch Read-only

Type of movement detected — Drop (0), Tilt (1), or Vibrate (2) from the AqaraVibrationMode field

string → enum SWITCH mapping
Values / States: Drop · Tilt · Vibrate · ???

Vibration Mode

Listener
if INDEXOF(RECEIVEDMSG.Topic, "SENSOR") > 0
    var val := PARSEJSON(RECEIVEDMSG.Payload, "ZbReceived." + ID + ".AqaraVibrationMode", true);
    if (!ISNULL(val), SWITCH(val,
    "drop", Mu := 0,
    "tilt", Mu := 1,
    "vibrate", Mu := 2,
    Mu := 4));
end
Connection: Packet Parser → MQTT
Possible improvements (3)
  • Vibration Sensitivity — The DJT11LM supports 3 sensitivity levels (low/medium/high) via manufacturer-specific Zigbee commands (Manuf: 0x115F, cluster 0x0000, attribute 0xFF0D). Not configurable in TapHome template — requires manual ZbSend command via Tasmota console.
  • Link Quality (device-level) — LinkQuality is available per SENSOR message but only exposed as a module-level service attribute via ZbInfo polling.
  • Vibration Count / Intensity — Some Zigbee platforms expose a vibration intensity or count value separately from the angle. The TapHome template only parses AqaraVibrationsOrAngle (angle) and AqaraVibrationMode (event type).

Sources