Room Multi People Detection in HA, with Aqara FP2 sensor

Hi to the HA community.

I tested recently the new Aqara FP2 occupancy sensor and I liked the way the native app in IOS or android is showing live the movement of the people in the respective room where FP2 is installed.

Unfortunately so far I haven’t seen any such example how to import to HA.

Below is my dashboard for multiple people detection in the master bedroom:

Has very good accuracy and so far is working in 95-98% of tested cases.

HA-aqara FP2 dashboard
This is how it looks live, when a person is sleeping on the bed and another one (myself) is walking around the room :slight_smile:

How it works:

  1. Aqara FP2 sensor installed in room and in HA
  2. Remove all Zones from HA
  3. Use the Aqara app in any device to setup your room
  4. How to Setup the Zones in Aqara app
    • app is supporting up to 30 zones (if I recall correctly)
    • split your room in boxes that represent 1-1 the aqara room boxes or that are higher (for instance in this example I am using 4 boxes of Aqara room as my 1 square matrix)
  • be careful on the number you will define - smaller boxes means better movement and more detailed in the room, but also more sensors to setup and work with in HA.
  • trial and error until you find the right number - I choose a 4x4 matrix for the room in my example
  • then in aqara app you can go and define this 4x4 zones = 16 zones
  • then in HA you will have 16 zones + 1 which is for the room

this is how it looks in Aqara app the setup

and that’s it. Now in HA we can go and make some naming of the zones. I used the matrix approach, so Sensor 1 = matrix_1x1, Sensor 2 = matrix_2x1 etc
Then you can group some of the sensors to create custom Zones for occupancy in HA

Multiple People detection - number of people in the room:
using a group of all the sensors and counting how many are “on”, will do the trick and show the number of people in the room with good approximation (considering you split the room in as many boxes as possible from your setup). You can utilize all up to the 30 zones aqara app supports, but this means you need to also setup 30 zones in HA card you will create.


John would you mind describing how you have your FP2 set up? Maybe what the underlying room map looks like to get to this?

Id guess you have each one of those blocks where a person shows up is a detection zone in the app and you’re mapping those sensors to a picture card?

Hi Nathan, I provided some more details in the initial post.

Please see some more below:
For the HA card, I will also update with more details, but the idea is as you said. Use a picture-elements card for the room map and then custom cards linked to the sensors/sensors zones and positions on the map each sensor represents - matrix approach

1 Like

Hello, I’ve been searching for a while but I couldn’t do the mapping thing like you. Can you please share the code? I don’t understand how to do it. Please.

Can aqara fp2 just be set to bluetooth detection? Or does it use another method?

The short answer would be a “no”. Bluetooth detection is commonly done using other sensors, such as this if you want to go DIY route:
ESP32 Bluetooth Low Energy Tracker Hub — ESPHome

… so not FP2.