Integrating Aqara Fp2 Presence Sensor directly into Home Assistant

Hello all,

I was wondering if there’s a way to connect or integrate the Aqara FP2 Presence Sensor directly into Home Assistant without having to use the Aqara App? Let me explain why real quick.

I currently have the FP2 connected to my HA server via the Homekit Integration, after I’ve configured the zones within the Aqara App. However, every so often, the Aqara app will act up and say that the “Network connection times out. Please check the network status (Network -100)”. Checking my network connection shows that the wifi connectivity is good if not perfect most of the time, and rebooting either the FP2 or the router doesn’t help fix the “network times out” issue. Only after several minutes of fussing around the app with no real purpose does the “connection” return to normal and the detection works normally again.

The problem here is that it seems the FP2 isn’t capable of sensing properly without what it thinks is a reliable internet connection to the app. The app is not slow to refresh or detect the location of a person on the map, it can’t locate at all without an internet connection, or at least it can’t send the data from the FP2 to the app. If you block the FP2 on the router, either LAN or WAN, it doesn’t work at all. The app can’t connect to the FP2 and it throws a “Hub or device is not responding” error. Which, btw, means their claim that it works without an internet connection is BS. The problem seems to be more that the Aqara app considers anything but stellar wifi connection as problematic, and everything stops working.


Is there any way that I’m not aware of to -

a) connect the FP2 directly to Home Assistant without the need for Homekit or the Aqara app?
b) create the zones in either Home Assistant or an add-on connected to HA that frees the FP2 from the confines of the Aqara app?

The FP2 has its quirks, but for the most part, it works very well and reliably for me, when the app doesn’t act up and say my network connection is shit.

2 Likes

Is it really using the app though? I have 3 FP2s in my house and from my understanding the app is really used just to setup the wifi and zones in the presence sensor. Once that is setup all that information is stored on the device itself and it is ran locally through homekit. This is why things like custom zone names do not come over as that information is stored in the app on your Aqara account. I figured this to be true because my app disconnected basically logged out some time after I setup the devices and everything still worked fine. I only has to log back into the app to update the firmware last week.

I think your problem is most likely your FP2 does not have a reliable WiFi connection. Things like a combo 2.4/5ghz network on the same SSID or the device being in a dead spot can be the cause of this.

1 Like

I have the same general questions and am asking here instead of opening a near-duplicate thread. I have just blocked my Aqara FP2 from the network at the router and all the HomeAssistant sensors (zones) reported “unavailable.” I can kind of wrap my head around this, but don’t know how to deal with it. My Netgear Orbi router allows me to block the device from the network, which evidently means literally prevent it from connecting to the network and not just “block this device from the external internet” and that would explain why HA couldn’t see it anymore.

My setup: all devices in the house (including the FP2) connect to the router. The router connects to AdGuardHome running on the HomeAssistant for DNS / internet connectivity. So: how can I prevent a device such as the FP2 from reaching outside of my home network (and ultimately eating my ISP-capped bandwidth) but continue to make use of the device’s functionality within my local network?

Depending on your router capability (sorry, I do not know Netgear equipment, personally I’m in the Draytek team) you can use one of several options:

  • create firewall rule to block traffic from this IP from accessing internet.
  • load ballancing rule, directing traffic from FP2 IP to non existant/inactive WAN interface (in some cases this can be achieved by setting static routing rule for source IP).
  • set bandwith limit to 0 for this IP.
  • assign allowed access schedule to this IP and then make schedule empty.
1 Like

Thank you very much, @mirekmal ! Blocking the TCP and UDP services did the trick I was looking for. HA still gets presence detection, but it’s not leaving the house as evidenced by the Aqara app no longer communicating with the sensor. Now – if only we could get some sort of integration for HA that would be able to present the room layout / map like the Aqara app, then I’d be totally ecstatic! :slight_smile:

1 Like

Wow, I’m so glad that I found this thread. I’ve been struggling with this issue for weeks now. I have 2 Aqare FP2 Presence Sensors, 1 is working like a charm, but with the other sensor, I kept running into the issue that there seemed to be a delay in HA of a good 10 seconds. E.g. I’ve set an automation that when I walk into a zone the lights will turn on, but it would take 10 seconds before the zone will show as ‘detected’ in HA which would turn on the lights. Restarting HA would fix the issue for an hour or so, but I couldn’t find a permanent fix.
When I opened the sensor in the Aqara app, it would often say, “The connection network times out. Please check the network status”, implying that it might be related to the WiFi connection. I tried various things in Unifi to fix this issue (forcing the sensor to different APs, static IP, different 2.4 GHz channels, min. data rate control), but nothing worked.

After seeing this thread I added a firewall rule that basically only allowed traffic from the sensor to my HA servers and blocks everything else. I had to force close the current network session but now the sensor is working great! :slight_smile:
Thanks a lot for the suggestion

1 Like

Can anyone provide instructions on how to get the fp2 into HA in the first place? Mine is already in the Aqara app which I thought setup the connection with HomeKit.

If you’re using an iOS device, the Aqara app pairs the FP2 with the Apple Home app. So you have to go into the Apple Home app and delete the FP2. After that, it should show up as discovered in HA (sometimes I have to reboot the FP2 to get it discovered, and every once in awhile I have to reboot HA too). At that point you just need to follow the instructions provided by HA after you click the CONFIGURE button on the HA screen.

2 Likes

Thank you!

Though this doesn’t answer to the question: is there a way to run it without HomeKit ?
And why this need of HomeKit in the first place BTW ?

Not if you want to use it in Home Assistant. Aqara provides no API for the FP2, so there is no easy way to write an integration for it. Since the FP2 can be connected via HomeKit and HA has a HomeKit integration, that is the way to integrate the two.

How and where did you add this firewall rule?