
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 Door and Window Sensor (MCCGQ11LM) is a compact, battery-powered Zigbee contact sensor. It detects whether a door or window is open or closed using magnetic reed switch proximity sensing. TapHome communicates with the sensor over MQTT through a Zigbee2Tasmota gateway — the sensor publishes its contact state in the ZbReceived JSON payload whenever the state changes.
This template creates two devices from a single physical sensor: a Door Sensor and a Window Sensor. Both parse the same Contact field from the Zigbee message. This allows users to assign one device as a door contact and the other as a window contact in TapHome, or use only the one that matches the actual installation. Unused devices can be hidden in TapHome settings.
Configuration
Pairing the sensor
- In TapHome, turn on the Permit Join switch in the Zigbee2Tasmota Gateway module
- On the sensor, press and hold the small button until the blue LED starts blinking, then release
- Wait for the Devices Found counter to increment — the sensor’s Device ID (e.g.,
0x1234) appears in the gateway service attributes - Import this device template using the Device ID from pairing
Import parameters
| Parameter | Description | Example |
|---|---|---|
| MQTT Broker IP Address | IP of your 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 | Zigbee short address from pairing | 0x1234 |
Device capabilities
Door and window contact detection
The template provides two reed contact devices — Door Sensor and Window Sensor — both mapped as PacketParserReedContact with the security capability. Each device parses the Contact field from ZbReceived.{DeviceID} in the MQTT SENSOR message:
- Contact = true → closed (door/window shut)
- Contact = false → open (door/window opened)
The sensor reports its contact state instantly on each state change, enabling real-time automation triggers (e.g., turn on lights when door opens, send alert on unexpected window opening).
Battery monitoring
The module tracks battery health through two service attributes:
- Battery Percentage — estimated charge level; a low battery warning triggers when the level drops below 30%
- Battery Voltage — raw CR1632 cell voltage in volts
Battery data is parsed from BatteryPercentage and BatteryVoltage fields in the ZbReceived payload.
Offline detection
The template monitors device availability using the LastSeenEpoch timestamp from ZbInfo polling (every 1 hour):
- Warning — device has not been seen for more than 12 hours
- Error — device has not been seen for more than 24 hours
This helps detect situations where the sensor has lost Zigbee connectivity or the battery is fully depleted.
Diagnostic service attributes
The module exposes additional Zigbee metadata retrieved via ZbInfo polling:
| Attribute | Description |
|---|---|
| IEEEAddr | Unique 64-bit hardware identifier |
| ModelId | Zigbee model ID (lumi.sensor_magnet.aq2) |
| Manufacturer | Manufacturer string reported by the device |
| Endpoints | Active Zigbee endpoints |
| Config | Device Zigbee configuration |
| Link Quality | Signal strength scaled from 0–100% |
Additional capabilities
The Aqara MCCGQ11LM also reports internal device temperature via Zigbee. Per-message link quality (LQI) is available in each SENSOR payload but is currently only exposed at module level via hourly ZbInfo polling. These capabilities can be added in a future template update.
Troubleshooting
Sensor not reporting contact state
- Verify the sensor is paired with the Zigbee2Tasmota gateway — check
ZbStatusin the Tasmota console - Confirm the Device ID in the template matches the short address from pairing (e.g.,
0x1234) - Open and close the door/window to trigger a state change — the sensor only publishes on change, not continuously
- Use an MQTT client (e.g., MQTT Explorer) to subscribe to
tele/{GWname}/SENSORand verify the sensor publishesZbReceivedmessages with aContactfield
Offline warning despite working sensor
- The offline detection relies on
ZbInfopolling (hourly). If the sensor has not sent any message within 12 hours, a warning appears - Battery-powered Zigbee devices sleep between events — this is normal behavior. The warning typically clears after the next contact state change or
ZbInfopoll - If the warning persists beyond 24 hours, check the battery (CR1632) and re-pair the device if necessary
Both Door Sensor and Window Sensor showing the same state
This is expected — both devices parse the same physical sensor’s Contact field. Hide the unused device in TapHome (Settings → Devices → select the device → Hide).
The Aqara MCCGQ11LM uses a CR1632 coin cell battery. Battery life is typically 2+ years under normal use. Frequent state changes (e.g., high-traffic doors) or weak Zigbee signal (requiring message retransmissions) can reduce battery life.