I have tried several times to add my P2 Door sensor (not to be confused with the P2 motion sensor) to HA.
The sensors have the latest firmware. I have an M3 hub.
I tried getting pairing codes from both the Aqara app and Apple Home.
I tried removing a sensor from both apps and install as a new sensor in HA.
Every attempt resulted in a Failed to add device.
I found that this problem has been reported in several Facebook feeds without resolution.
Suggestions?
Edit to add: yes, I reset the sensor and entered pairing mode.
Hi there, it looks like you’re experiencing a support-related issue. We’ve automatically created a support ticket for you and will reach out via the forum email within the next two business days.
If other members have any suggestions or insights on this topic, feel free to share!
I could never get them to work for more than a few hours in Home Assistant, or Apple Home. They constantly disconnected and would not reconnect without rebooting the entire system.
I quickly installed them in the trash can and everything has worked great ever since.
In all fairness, looking back my Thread Network was not ideal. I’ve since added a Thread Antenna to Home Assistant and removed the Eero devices from the Thread Network. (turned off the Thread option).
For me Door Sensors are too important to worry about if they are working or dropping off the network for one reason or another.
At the time I was not willing to spend the time trying to figure out why. Later is when I figured out how Eero was messing things up and that I needed an additional antenna by then it was too late to play around with the P2’s.
In Home Assistant go to Settings-Apps-Matter Server. Open Web UI choose Thread (top right) and look over your Thread Network and see how things are communicating (or not). It can help sometimes.
I have previously tried to use a HA + Matter server using Docker images on an older Mac Mi i Server 2011. Unfortunately, the Matter server doesn’t work unless you use docker’s network mode host. BUT you need Docker Desktop 4.34 or newer for network mode “host”, and my Mac Mini Server didn’t support that.
The Matter pairing failed just like in your case, without any further details.
Generally Matter and Thread will work better if you use HAOS instead of the setup I had. Or just install everything natively instead of running Docker.
Worth checking your Thread network topology in the HA Matter Server add-on and see if there’s more than one border router listed. I’ve found that multiple border routers will sometimes fight over who the preferred router is.
I agree with @srl77411 - I have roughly 20 of the Zogbee door and window sensors installed with a few P100’s on exterior doors for good measure and they are rock solid.
@Outburstin Was that an issue for you? When you mentioned they “fight over who the preferred router is”, were you referring to the Primary BBR (represented by the star icon in the HA Matter Server App) or the Thread Leader (the crown icon )?
If you mean the Primary BBR, that’s completely normal. Multiple Border Routers have to negotiate which one routes the communication into your home network (LAN/Wi-Fi), and the exact TBR that currently has the best connection to your home network takes on that role. Nothing unusual so far.
If you meant the Thread Leader, the question would be whether you turn off any devices at nigh or anything similar. If so, that wouldn’t be unusual either.
HAOS runs Docker too, since the apps (formerly called add-ons) all run in one or more Docker containers. But that’s just a nerdy side note
Home Assistant → Settings → Apps → Matter Server
in the Log tab to see if any error messages show up when adding the sensor. Also, check which log level is set under the Configuration tab. Change it if necessary.
Instead of pairing it directly with Home Assistant, you could try exposing it as signal through the M3 to Home Assistant. You find it under Profile | Connect to Ecosystems | Matter | Scene and Signal Sync
Wow, you are all so nice! Thank you to each of you. I just had to put this all away for a day for mental health reasons.
I did get a very nice email from Aqara that had some helpful points. Like, the QR code does not work for adding a device to the second and third ecosystems. That makes perfect sense now, but as a newb it wasn’t obvious. Also, the M3 is a TBR for Aqara but HA needs its own TBR as well. I have 8 devices that serve as TBRs.
So… I got my back door sensor paired to HA. I was so happy! But then, it went “unavailable” and would not come back. Yikes.
I thought the best move at this point was to remove my 3 door sensors from all 3 apps (Aqara, Apple, and HA) and start over.
I mean, everything connected so well before I brought HA into the picture but I really didn’t like having to have a recording in my Apple Music app that would be fetched whenever a door opened. I wanted local TTS. I wanted Piper.
So, I began adding my door sensors to HA. Then I shared from HA to Apple and Aqara. I swear I did the exact same thing a couple of times. Sometimes it worked and sometimes not. BUT, everything works now!!!
Piper locally generates TTS beautifully. I am also much more comfortable now navigating the HA interface.
I did look at my thread network through HA and using Thread Tools. Signals seem to be acceptable (RSSI > -45). And I looked more closely and discovered that a Docker does exist. It snuck in unknowingly during install just like was mentioned in this thread. The learning curve was quite painful, but I am naturally a puzzle solver so I am content for the moment.
Thank you all!!!
When you put a device in pairing mode it remains available for 10 minutes +/- even though it may not pair or throw error messages. If you turn around and try to repair again before the time runs out and introduce another matter code the system can get all confused (messed up).
Sometimes it’s best to wait a few moments (walk away) and try again.
Of course the good ol’ fashion shut down and reboot will also clear things left over in memory which can also help.
Glad to see everything is working good now. Piper is pretty darn good.
That is not quite correct, unfortunately. Since Matter over Thread communicates natively via IPv6, the Aqara M3 is perfectly sufficient as a Thread Border Router (TBR): it simply routes the IPv6 packets from the Thread devices transparently into your local home network. However, the statement becomes correct again if you replace “own TBR” with “own Matter Controller”. In your HA setup, this controller isn’t additional hardware, but rather the Matter Server Add-on. This runs in the background within a Docker container as a matter.js application (earlier versions used Python for this).
Since we were just talking about IPv6… you might want to check out my Matter & Thread Guide, specifically the section on Link-Local vs. GUA vs. ULA. That could actually be a reason why your devices are dropping their connection. In fact, if it happens again, it’s highly likely to be the issue. Feel free to send me a PM, and we can take a look at it together!
Oh, I believe you @JohnD . This was from the email, " The M3 hub serves as Aqara’s Thread Border Router, but Home Assistant needs its own Thread Border Router to directly add Thread devices."
And I will definitely look at your link! Thanks so much.
Right, pairing mode lasts. I am assuming one thing though about “first-time” pairing codes vs pairing codes from an ecosystem - once I pair/share a device from HA to Apple, I do have to get HA to give me another pairing code for say, Aqara. Right?
If the Aqara M3 creates a separate Thread network but doesn’t properly share its Thread credentials (Active Operational Dataset) with the smartphone’s OS (iOS/Android), Home Assistant won’t initially be able to commission Matter-over-Thread devices into that network because it lacks the required Thread network credentials.
Once those credentials are available through the smartphone’s keychain and imported via the Home Assistant Companion App, you can commission Matter-over-Thread devices directly into Home Assistant without any issues.
@JohnD yes, and then when I do a THIRD pairing I need the original app to give me another pairing code for the third app - i.e., I can’t reuse the pairing code used in the second app, for the third app. HA->Apple->Aqara