---
title: "Aqara Vibration Sensor"
description: "Detect vibration, tilt and drop events via Zigbee through a Tasmota gateway. Tilt angle in degrees, vibration mode with battery and offline monitoring."
url: "https://taphome.com/en/compatibility/zigbee2tasmota-aqara-vibration-sensor/"
language: en
lastmod: 2026-03-29
generator: hugo
ai:
  topics: ["mqtt","sensor","zigbee","battery-powered","vibration-detection"]
  questions: ["How to integrate Aqara DJT11LM vibration sensor with TapHome?","What does the Aqara vibration sensor TapHome template detect?","How to connect an Aqara vibration sensor to TapHome via Tasmota?","Why is my Aqara vibration sensor showing offline in TapHome?","How to pair an Aqara DJT11LM with a Zigbee2Tasmota gateway?","Does TapHome report tilt angle from the Aqara vibration sensor?"]
---

# Aqara Vibration Sensor

Communication: Packet Parser → MQTT

- [Aqara Product Page](https://www.aqara.com/eu/product/vibration-sensor)

> Network address
> 
> With the MQTT broker built into TapHome, enter `127.0.0.1` as the broker address in TapHome. In the device, enter the IP address of the TapHome Core and give the Core an IP reservation in the router.
> 
> [Network Preparation](https://taphome.com/en/docs/setup/network-preparation/)

## Integration guide

> [!IMPORTANT]
> This device communicates via **Zigbee** through a Tasmota gateway. Make sure you have
> the [Zigbee2Tasmota Gateway](https://taphome.com/en/compatibility/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:

| Parameter | Description | Example |
|-----------|-------------|---------|
| MQTT Broker IP Address | IP of the MQTT broker | `192.168.1.10` |
| MQTT Broker Port | Broker port (default 1883) | `1883` |
| Gateway name | Tasmota MQTT topic (Configuration → MQTT → Topic) | `tasmota_XXXXX` |
| Device ID | Short Zigbee address from pairing | `0xC9A9` |

> [!WARNING]
> 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:

| State | Value | Description |
|-------|-------|-------------|
| Drop | 0 | Free-fall or dropping event detected |
| Tilt | 1 | Tilting or angle change detected |
| Vibrate | 2 | Vibration 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.

> [!TIP]
> 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

> [!TIP]
> TapHome has a built-in MQTT broker — enable it in **Settings** → **Hardware** → **MQTT Broker**. No additional software is needed.

### Step 1 — Set Up the Tasmota Zigbee Gateway

1. Flash [Tasmota firmware](https://tasmota.github.io/docs/Getting-Started/) 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 **Configuration** → **Configure MQTT** and set:
   - **Host:** the IP address of the TapHome Core for the built-in broker (with an IP reservation in the router → [Network Preparation](https://taphome.com/en/docs/setup/network-preparation/)), or your 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](https://tasmota.github.io/docs/Zigbee/).

### Step 2 — Import the Gateway Template in TapHome

1. Download the gateway template from the [Zigbee2Tasmota Gateway](https://taphome.com/en/compatibility/zigbee2tasmota-gateway/) compatibility page
2. In TapHome, go to **Settings** → **Hardware** → **Packet Parser** → **Import**
3. Import the template with these parameters:
   - **MQTT Broker IP Address:** `127.0.0.1` for the TapHome built-in broker, otherwise 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 2

These devices appear in TapHome after import.

Aqara Vibration Sensor Module

Service Attributes

|                    |                                                             |
|--------------------|-------------------------------------------------------------|
| IEEEAddr           |                                                             |
| ModelId            |                                                             |
| Manufacturer       |                                                             |
| Endpoints          |                                                             |
| Config             |                                                             |
| Link Quality       | Zigbee signal strength — 0% (no signal) to 100% (excellent) |
| Battery Voltage    |                                                             |
| Battery Percentage | Estimated 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) = 0xC9A9 Zigbee 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

Read (module)

```taphome
MQTTPUBLISH("cmnd/" + GWname+ "/ZbInfo", ID)
```

Listener

```taphome
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

```taphome
MQTTPUBLISH("cmnd/" + GWname+ "/ZbInfo", ID)
```

ModelId

```

```

Manufacturer

```

```

Endpoints

```

```

Config

```

```

Link Quality

```

```

Battery Voltage

```taphome
BatteryVoltage + " V"
```

Battery Percentage

```taphome
BatteryPercentage + "%"
```

Tilt Angle Variable Read-only

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

numeric Unit: °

Listener

```taphome
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 · ???

Listener

```taphome
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).

## Import parameters

Enter these values when you import the XML.

| Asked in the app                                            | Default         |
|-------------------------------------------------------------|-----------------|
| Mqtt Broker IP address                                      | `192.168.0.1`   |
| Mqtt Broker port                                            | `1883`          |
| Gateway name (Tasmota-&gt;Configuration-&gt;MQTT-&gt;Topic) | `tasmota_XXXXX` |
| Device ID                                                   | `0xFFFF`        |

## Sources

- Tasmota Zigbee Documentation
  
  [tasmota.github.io](https://tasmota.github.io/docs/Zigbee/)
- Zigbee Compatible Devices Database
- Blakadder Device Entry — Aqara DJT11LM
  
  [zigbee.blakadder.com](https://zigbee.blakadder.com/Aqara_DJT11LM.html) 2026-03-29
- Aqara Product Page — Vibration Sensor
  
  [www.aqara.com](https://www.aqara.com/eu/product/vibration-sensor) 2026-03-29

## Related Documentation

- [MQTT Integration](https://taphome.com/en/compatibility/mqtt-guide/)
- [Packet Parser (HTTP, TCP, UDP, FTP, MQTT)](https://taphome.com/en/docs/integration/packet-parser/)
- [Packet parser functions](https://taphome.com/en/docs/script/packet-parser/)
- [Parsing functions](https://taphome.com/en/docs/script/parsing-functions/)
- [MQTT Broker](https://taphome.com/en/docs/integration/packet-parser/mqtt-broker/)
- [Listener scripts](https://taphome.com/en/docs/script/listener-scripts/)

