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.
This is how it looks live, when a person is sleeping on the bed and another one (myself) is walking around the room
How it works:
Aqara FP2 sensor installed in room and in HA
Remove all Zones from HA
Use the Aqara app in any device to setup your room
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
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.
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
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.
You need to start from getting the FP2 in Aqara app. There are a lot of guides around the web on how to accomplish this and even tricks and tips if something goes wrong.
Let me know when you reach there , and I can help for the rest of the part to define in HA. As soon as you have the FP2 in Aqara App and then you delete in the Home app (iOS) then HomeKit will appear in HA as new device and you can then import it in HA and then all zones you define in Aqara app are automatically updated/added/changed in HA