Aqara Door and Window Sensor P2 Setup
Mount the Aqara Door and Window Sensor P2, pair it with Home Assistant over Matter and Thread, and use it in the door and lock recipes.
The Aqara Door and Window Sensor P2 speaks Matter over Thread. It joins the home’s Thread network and pairs with Home Assistant’s Matter integration, with no Aqara hub in between, and reports locally.
Before You Start
- The Thread network is up. Home Assistant needs a Thread border router, for example a SONOFF Dongle Plus MG24 in Thread mode. See Thread Integration Setup.
- The phone is ready to commission. The Home Assistant Companion app is signed in to this home, Bluetooth is on, and the phone has the Thread credentials. See Pairing Matter Devices.
- Save the Matter code in Selora Connect. The QR code is in the manual or on the box, and the numeric code is printed on the sensor. Scan the QR code into the home’s Pairing Codes before mounting the sensor.
Mount the P2
The P2 has two parts. Fix the main unit on the door frame and the magnet on the door, with their alignment marks lined up and less than 22 mm (about 7/8 in) apart when the door is shut. Mount it no higher than 2 m (6.5 ft). It runs on one CR123A battery.
Pair the P2
- In the Companion app, go to Settings > Devices & Services > Add Device > Add Matter device.
- Pull the battery tab. The LED starts breathing slowly: the sensor is in pairing mode. If it does not, hold the button for 5 seconds until the LED blinks, then release it.
- Scan the QR code, or type the manual pairing code saved in Pairing Codes.
- Name it after the door or window, and assign the area.
It appears with a door binary sensor, a sensitivity setting, and a battery sensor.
Use the P2 in Recipes
- Door or Window Left Open Alert: pick the P2 door sensors.
- Auto-Lock at Night: pick the front door’s P2, so the lock holds off while the door is open.
P2 Firmware Updates
Home Assistant installs the Matter firmware updates that manufacturers publish to the CSA’s Distributed Compliance Ledger, and skips the versions marked invalid there. Aqara’s P2 firmware in the ledger is marked invalid, so for now Home Assistant offers no update for the P2: it updates through an Aqara hub and the Aqara Home app.
P2 Troubleshooting
- The sensor does not enter pairing mode. Hold the button for 5 seconds until the LED blinks, then release it.
- The sensor keeps going unavailable. Update the Matter Server app in Home Assistant. If it persists, remove the device and pair it again.
Last modified December 1, 2026: docs: setup guides for Aqara P2, FP300, U400, Third Reality leak sensor, and Hue Bridge (11bb9493)
