What am I doing wrong with this setup? Why is my Aqara P2 sensor not connecting to HA?

First of all, here is my setup:

  • Single Board x86 PC with RHEL 9.5
    – Connected via ethernet to my switch, which is then connected to my ISP Router
    – Docker installed with Home Assistant and Matter Server as separate containers
  • My network contains a Deco X50 Access Point (in AP mode) and my ISP router has Wi-Fi disabled, IPv6 enabled with DHCPv6.
  • I bought an Aqara M3 Hub as I heard that Aqara is a solid start to Home Automation with Home Assistant.
  • I have a Niko Home Control installation with light switches

To start, I’ll be saying what is working.

  • Home Assistant available on Macbook, iPhone 15 and Lenovo Tablet
  • Niko Home Control integration with Home Assistant
    – I see and can control all the devices/areas and such created with Niko sotware
  • WiZ integration based on IP address I assume, because I see within my router that there are 4 wiz devices connected with a DHCPv4 lease
    – I can control those lights with Home Assistant
  • Home Assistant detected automatically some connections. It saw that the Aqara Hub M3 is the Thread Border Router and I’ve set it as the preferred network (it is the only network).
    – It also saw the Aqara Hub as a Matter device automatically and there is a button that I can press which is named Identify. When I press the button, I hear the hub saying “normal link confirmed”.
  • The Aqara Hub M3 has a thread network with a PAN-ID and such which is the same as what I see within Home Assistant when I look at the Thread configuration.

Further more I want to say that I’m new to this and are struggling for a couple of weeks now and will be contacting Aqara support because they’ve for sure heard about my issue. When I have a solution, I’ll be posting it here.


My issue is that Home Assistant is not recognising the Matter devices connected to the Aqara Hub M3.
In particular, the P2 Door and Window Sensor which are Matter-over-Thread devices.

When I add the newly bought P2 sensor to the Aqara Home app, it works great. However, I expected it to be automatically visible for Home Assistant as well, but that is not the case. I have to add the devices manually.

But when I add the device via the iOS HA app, it just says that it could’nt be added without much information. It seems like there is connection between the sensor and HA because I see the device blinking.

When I add the device via the Android HA app on my Lenovo M9 tablet, it gives the error message that I need a Thread Border Router…

I thought the Aqara Hub M3 will automatically be detected as a Thread Border Router, but something is wrong here as well…

Does anyone have an idea what I’m doing wrong? Why is the Aqara P2 sensor not connecting to HA?

Aqara Hub controls one Matter Fabric, and HA Matter will control a second Matter Fabric. The two fabrics don’t know anything about each other really. What you want to do is to tell the Aqara Hub that you want it to “share” the P2 D&W. The Hub should then provide a sharing code that will be given to HA Matter server when HA is adding a Matter device. I don’t have the Hub, but my guess is that the Aqara App is used to tell the Hub to share the device.