I have an M3 hub and a P2 motion sensor among other Aqara products. I use Home Assistant and have the Aqara app. When I changed batteries in the P2 motions sensor, the P2 became unavailable in Home Assistant. It was still in the Aqara app. I couldn’t figure out how to reconnect in Home Assistant and thanks to advice from Microsoft’s Copilot, I deleted it from the Aqara app with the intentions of re-adding it. When I tried to re-add it, I scanned the QR code on the device, but the app rejected it, saying it was the wrong code. The QR code sticker doesn’t have the Matter code numbers or any numbers on it, just the QR code. I’ve looked inside and there isn’t a different QR code inside. How can I reconnect the P2 sensor to the app?
Hello and welcome.
The Matter code for my P2 Motion Sensor is on the top. The Matter code is shown as a number underneath.
Is it different for you?
John, the top of mine is blank, no matter code.
Okay, then there are probably only two possibilities:
a) It is actually a P1, not a P2: They look identical from the outside. Since you mentioned the M3 Hub and Home Assistant: The P1 is a Zigbee device that can be bridged to Matter via the M3. If it’s a P1, it doesn’t have a Matter code on the housing. You pair it by pressing the button for a few seconds while the M3 is in Zigbee pairing mode. Please check the model number on the bottom to be 100% sure.
b) It is a P2 and the code is missing: Matter devices require the unique 11-digit code or QR code for commissioning. If it’s not on the device anymore:
- Check the battery compartment: Look inside the sensor or on the inside of the battery cover.
- Check the manual/box: There is usually a spare sticker in the box or printed on the manual.
If none of the above works, the device unfortunately cannot be added to a new Matter controller, effectively making it unusable.
Same here, no code on top

