# Aqara FP1 with Zigbee2mqtt

**URL:** <https://discourse.nodered.org/t/aqara-fp1-with-zigbee2mqtt/79596>\
**Category:** Share Your Projects\
**Created:** [5 July 2023 07:35 UTC](https://discourse.nodered.org/t/aqara-fp1-with-zigbee2mqtt/79596 "2023-07-05T07:35:38Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![xx\_Nexus\_xx](https://avatars.discourse-cdn.com/v4/letter/x/54ee81/32.png) [@xx\_Nexus\_xx](https://discourse.nodered.org/u/xx_Nexus_xx)\
**Post date:** [5 July 2023 07:35 UTC](https://discourse.nodered.org/t/aqara-fp1-with-zigbee2mqtt/79596/1 "2023-07-05T07:35:38Z")

</div>

Hi, I just received my aqara FP1 sensor and it works really well with zigbe2mqtt  
 ![chrome_j9HXwogHyP](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/c/1/c1f1de29bb5b19a9c83e8106a209910918500073.gif)

You will have upto 10 regions out of a 7x4 grid. Below are my first 5 regions

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/e/b/ebdd418812de1fd68bb203e13504050070bcd499.png)

For each region you will receive updates on ENTER, OCCUPIED (shown red in my dashboard),LEAVE and UNOCCUPIED

Sensor is very responsive but I have not tried all the parameters yet.

Anybody else to share experience with this ?

---

<div class="post-metadata">

**Author:** ![stefan24](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/stefan24/32/23075_2.png) [@stefan24](https://discourse.nodered.org/u/stefan24)\
**Post date:** [6 July 2023 18:44 UTC](https://discourse.nodered.org/t/aqara-fp1-with-zigbee2mqtt/79596/2 "2023-07-06T18:44:45Z")

</div>

Not yet, but it sounds very interesting!

EDIT: Just bought one from Aliexpress for 58 EUR. In Amazon there is (only) a FP2, which seems to use WLAN instead of Zigbee and costs 83 EUR.

---

<div class="post-metadata">

**Author:** ![xx\_Nexus\_xx](https://avatars.discourse-cdn.com/v4/letter/x/54ee81/32.png) [@xx\_Nexus\_xx](https://discourse.nodered.org/u/xx_Nexus_xx)\
**Post date:** [6 July 2023 23:22 UTC](https://discourse.nodered.org/t/aqara-fp1-with-zigbee2mqtt/79596/3 "2023-07-06T23:22:36Z")

</div>

The FP2 works similiar but is an improved model able to detect multiple different people in the room, but yes zigbee is key for me as well

---

<div class="post-metadata">

**Author:** ![stefan24](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/stefan24/32/23075_2.png) [@stefan24](https://discourse.nodered.org/u/stefan24)\
**Post date:** [14 July 2023 19:42 UTC](https://discourse.nodered.org/t/aqara-fp1-with-zigbee2mqtt/79596/4 "2023-07-14T19:42:26Z")

</div>

My FP1 arrived today with a chinese documentation, but I managed to connect it with my zigbee2MQTT by pressing the button on the back for several seconds, until a small blue LED was blinking.  
So no Aqara Home app is required to connect, regions are supported directly under zigbee2MQTT someone said.

status in zigbee2MQTT:

```auto
{
    "approach_distance": "medium",
    "device_temperature": 30,
    "linkquality": 72,
    "monitoring_mode": "left_right",
    "motion_sensitivity": "high",
    "power_outage_count": 0,
    "presence": false,
    "presence_event": "left_leave"
}

```

But I was not able to create a region (or at least did not find, how to save it) with the latest zigbee2MQTT v 1.32.1.  
I have to play with it 🤔

---

<div class="post-metadata">

**Author:** ![xx\_Nexus\_xx](https://avatars.discourse-cdn.com/v4/letter/x/54ee81/32.png) [@xx\_Nexus\_xx](https://discourse.nodered.org/u/xx_Nexus_xx)\
**Post date:** [15 July 2023 05:57 UTC](https://discourse.nodered.org/t/aqara-fp1-with-zigbee2mqtt/79596/5 "2023-07-15T05:57:58Z")

</div>

I'm running zigbee2mqqt [1.30.3] at moment. to setup the region you have to:

1. Click the "+" icon in region\_upsert  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/f/d/fd8ef5e9cd145b386c8c63af3ff77109793640fd.png)
2. Select the region number you want to define  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/a/3/a3f45f89dc92b81ac1c4942ca41fed7f5ea722cb.png)
3. set the starting position for "X" and "Y"  
==\> This wiill be the top left corner of your region
4. click the "APPLY" button ( i forgot that before and the regions were wrong)
5. click the green "+" button
6. the area will expand
7. select the end position for "X" and "Y"  
==\> This will be your bottom right corner of your region  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/3/c/3cfd5a25b521019c4dedd3f200b523eb82279003.png)
8. Click the bottom "Apply" button
9. To add further regions you have to start at 2) again ... it is important to set the region\_id first
10. you can have regions with just one X and Y cordinate  
==\> just finish with 4) and proceed to 8)

It is very impotant that you click the respective "Apply" button for start-coordinate and end-coordinat otherwise the region is not properly defined and will not work.

Na dann wuensch ich dir noch viel spass mit den regionen einstellen, hat bei mir auch n bisl gedauert 😉 .. aber wenn du den dreh raus hast dann ist es einfach!

Bonus hint:

- Plan your regions first
- I did it a simple plan on excel as shown in my fisrt post, it will help a lot
- The system does allow overlaps of regions .. but i found it difficult to manage in Node-Red and therefore avoid overlaps
- to check the regions you have to use the "action" item _zigbee2mqtt/Living.Motion/action_... best visible with MQTT-Explorer  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/2/8/28d8ae69f82ff78f23f834e3fb23c949fcbc80eb.png)
- The action is quickly overwritten with "NULL" therfore you have to handle them properly in Node-Red while the region state (e.g. region\_9\_enter) is valid

---

<div class="post-metadata">

**Author:** ![stefan24](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/stefan24/32/23075_2.png) [@stefan24](https://discourse.nodered.org/u/stefan24)\
**Post date:** [15 July 2023 16:01 UTC](https://discourse.nodered.org/t/aqara-fp1-with-zigbee2mqtt/79596/6 "2023-07-15T16:01:49Z")

</div>

> [@xx\_Nexus\_xx](#):
>
> click the "APPLY" button ( i forgot that before and the regions were wrong)

I have no single "Apply" Button on this page, neither with my PC with Firefox, Chrome or Edge nor on my Samsung smartphone, neither near the regions nor the zones.  
But it seems to work, since I got action messages regarding entering or leaving region 2.  
But I have no idea, where or how the regions are saved and what regions I have had defined.

Do you see somewhere in zigbee2mqtt, what regions with which zones you have defined?

> [@xx\_Nexus\_xx](#):
>
> aber wenn du den dreh raus hast dann ist es einfach!

Wenn der Browser mir den APPLY button anzeigen würde, wäre es sicher viel einfacher!!! 🤔

Maybe the firmware of my zigbee adapter is too old according to [Xiaomi RTCZCGQ11LM control via MQTT | Zigbee2MQTT](https://www.zigbee2mqtt.io/devices/RTCZCGQ11LM.html).

CC1352/CC2652: [`20211114`](https://github.com/Koenkk/Z-Stack-firmware/tree/7c5a6da0c41855d42b5e6506e5e3b496be097ba3/coordinator/Z-Stack_3.x.0/bin)

I still have `20210120`. But I won't update it, since I found a possible answer at reddit:

> > I was just attempting to add regions on my FP1, and there are no Apply buttons in my zigbee2mqtt "Exposes" interface. In fact, any time I click on or alter any of the fields it automatically sends the payload, which makes the setup process extremely finicky.
> > 
> > Is this something wrong with my instance, or did zigbee2mqtt change the way it works since this post was written?
> 
> They changed it with + - symbols. Set a region ID, click the green plus. Set the coordinates, click the + and that's it.

---

<div class="post-metadata">

**Author:** ![xx\_Nexus\_xx](https://avatars.discourse-cdn.com/v4/letter/x/54ee81/32.png) [@xx\_Nexus\_xx](https://discourse.nodered.org/u/xx_Nexus_xx)\
**Post date:** [16 July 2023 04:46 UTC](https://discourse.nodered.org/t/aqara-fp1-with-zigbee2mqtt/79596/7 "2023-07-16T04:46:12Z")

</div>

The zgbee firmware is usually only for the networking part..should not impact the UI... can you share your UI screenshot ? ...mine looks like this

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/c/e/ce50b04614b4f248894dee5c13fe5800c99d3762.png)

---

<div class="post-metadata">

**Author:** ![xx\_Nexus\_xx](https://avatars.discourse-cdn.com/v4/letter/x/54ee81/32.png) [@xx\_Nexus\_xx](https://discourse.nodered.org/u/xx_Nexus_xx)\
**Post date:** [6 August 2023 02:38 UTC](https://discourse.nodered.org/t/aqara-fp1-with-zigbee2mqtt/79596/8 "2023-08-06T02:38:52Z")

</div>

I just upgraded my system and now I;m in the same situation as you are .. I'm no longer to define the regions ... the sliders for X/Z do not work .. and the apply button is missing ☹

this is the interface now (WORNG!) ... no APPLY button .. and too many X/Y areas

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/a/4/a44bd765de4af8e8bff1230897ebed94c1c7d20a.png)

there is an issue in latest release (at least in 1.32.1 and 1.32.2) ☹

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [6 August 2023 06:27 UTC](https://discourse.nodered.org/t/aqara-fp1-with-zigbee2mqtt/79596/9 "2023-08-06T06:27:15Z")

</div>

> [@xx\_Nexus\_xx](#):
>
> there is an issue in latest release (at least in 1.32.1 and 1.32.2)

What is it that you upgraded?

---

<div class="post-metadata">

**Author:** ![xx\_Nexus\_xx](https://avatars.discourse-cdn.com/v4/letter/x/54ee81/32.png) [@xx\_Nexus\_xx](https://discourse.nodered.org/u/xx_Nexus_xx)\
**Post date:** [6 August 2023 10:21 UTC](https://discourse.nodered.org/t/aqara-fp1-with-zigbee2mqtt/79596/10 "2023-08-06T10:21:49Z")

</div>

I upgraded to the latest zigbe2mqtt 1.32.2 ... just wanted to let others know about the issue (raised with [zigbee2mqtt](https://github.com/Koenkk/zigbee2mqtt/issues/18534#issue-1838022074))

no issue with node-red 😉

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [6 August 2023 10:36 UTC](https://discourse.nodered.org/t/aqara-fp1-with-zigbee2mqtt/79596/11 "2023-08-06T10:36:57Z")

</div>

> [@xx\_Nexus\_xx](#):
>
> I upgraded to the latest zigbe2mqtt 1.32.2

OK, thanks. I wasn't sure what you had upgraded.

---

<div class="post-metadata">

**Author:** ![xx\_Nexus\_xx](https://avatars.discourse-cdn.com/v4/letter/x/54ee81/32.png) [@xx\_Nexus\_xx](https://discourse.nodered.org/u/xx_Nexus_xx)\
**Post date:** [7 August 2023 02:53 UTC](https://discourse.nodered.org/t/aqara-fp1-with-zigbee2mqtt/79596/12 "2023-08-07T02:53:19Z")

</div>

I have now used the manual commands for delete and create as per the [zigbee2mqtt product page](https://www.zigbee2mqtt.io/devices/RTCZCGQ11LM.html#xiaomi-rtczcgq11lm) and i was able to setup the regions properly. Just send the below commands to your device using

_zigbee2mqtt/FRIENDLY\_NAME/set_

Delete region: {"region\_delete": {"region\_id": 10}} .... value 1-10

Define region: {"region\_upsert": {"region\_id": 10, "zones": [{"x": 4, "y":4},{"x": 4, "y": 7}] }} ... be careful with formatting .. X=1...4 Y=1...7  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/c/d/cdb13af87ce463dac4fd234cc8f6e04ec8e8aaad.png)

I deleted all regions before creating new ones ... now it works again (without using UI from zigbe2mqtt .. i hope they fix the issue soon because it was much easier)

---

<div class="post-metadata">

**Author:** ![xx\_Nexus\_xx](https://avatars.discourse-cdn.com/v4/letter/x/54ee81/32.png) [@xx\_Nexus\_xx](https://discourse.nodered.org/u/xx_Nexus_xx)\
**Post date:** [25 November 2023 06:05 UTC](https://discourse.nodered.org/t/aqara-fp1-with-zigbee2mqtt/79596/13 "2023-11-25T06:05:24Z")

</div>

The FP1-Setup is still not working within Zigbee2MQTT UI. Below is my manual approach to setup the FP1 which now works fine for me.

[Init\_FP1.json](https://discourse.nodered.org/uploads/short-url/uxLa2YMmB0MO0SnUR7B5ZjGRmZY.json) (7.6 KB)  
The attached flow will :

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/b/d/bdd48757a4a62a5b22eb16e2c8d8a37e7fe5591b.png)

1. delete all 10 regions
2. define all 10 regions as shown below  
--\> the OUT-Node is going directly to my MQTT-OUT (pls change as per your settings)  
--\> i'm aware the flow can be simplified but I wanted to keep each step transparent  
--\> you can monitor the successful progress in the zigbee2mqtt UI

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/2/0/20d91214cd741ca5663174cd87d4745aaeb895c5.png)

Have fun 😉

---

<div class="post-metadata">

**Author:** ![Benniphx](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/benniphx/32/86800_2.png) [@Benniphx](https://discourse.nodered.org/u/Benniphx)\
**Post date:** [31 December 2023 15:48 UTC](https://discourse.nodered.org/t/aqara-fp1-with-zigbee2mqtt/79596/14 "2023-12-31T15:48:44Z")

</div>

First of thx for sharing  
2 questions:  
How did you build this arena board in your first message, I would like to use it to set up my groups  
And how did you setup your MQTT out because i dont see anything in the log on the zigbee2mqtt logs (i created on with localhost:1883 and my mosquito broker credentials)

 ![mqtt](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/9/5/95ebbf67474259c328489cd7b7af2d7771c2bfd3.png)

---

<div class="post-metadata">

**Author:** ![xx\_Nexus\_xx](https://avatars.discourse-cdn.com/v4/letter/x/54ee81/32.png) [@xx\_Nexus\_xx](https://discourse.nodered.org/u/xx_Nexus_xx)\
**Post date:** [31 December 2023 21:45 UTC](https://discourse.nodered.org/t/aqara-fp1-with-zigbee2mqtt/79596/15 "2023-12-31T21:45:50Z")

</div>

Hi @Benniphx ,

**1) MQTT-IN**

- I store all me mqtt data in a [THING data-structure](https://flows.nodered.org/node/node-red-contrib-things) but this is not relevant to the FP1 solution
- the entire MQTT-IN payload is just getting dumped into this THING-Node for later processing
- you can wire the MQTT input directly to the 3) Region Logic

**2) MQTT-Out**

- I'm using a centralised MQTT-Out where all the mqtt data is send out  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/c/b/cb83df84373ac2b94a71c83d0c8c4e21879b0a35.png)
- this is the normal mqtt-out node with no additional modifications  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/0/2/025d815ba2f6bc0072cbdf8524ac6d853556f667.png)

**3) Region Logic**

- this logic is analysing what is going on in what region (still 1st draft and needs optimization)  

- just ignore the Thing node, as this is just providing the entire MQTT payload as it was received from MQTT-IN node (you can take MQTT data directly here)  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/d/9/d9508fd11c03fac90e31232c50c0301c223c85d7.png)

- this logic will switch on lights based on the region information  

- you can use the OUT-node to initiate any action you want to happen (for me its Arena Dashboard light & some Zigbee lights)

**4) Light Arena**

- the FP1 sensor is having a sensor grid of 4x7 which is reflected with [status led](https://flows.nodered.org/node/node-red-contrib-ui-actions)
- the connection/wiring between 3)Region Logic to 4)Light Arena depends on how you define your regions  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/4/9/4992bce9cbb1b5e281d16e5f6799f6247201a08f.png)

**5) Zigbee Lights**

- in below sample any movement in Region 1 or 2 or 3 will switch-on my Kitchen light  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/e/b/ebb0d77a26672f9b5bb3aad470310a8dbafa35fb.png)

**6) Init the FP1-Regions**

- unfortunatelly the zigbe2mqtt UI is not reliable/easy working so I hard-coded my current Region-definitions in below flow
- This init will be required every time the FP1 was disconnected from power, and makes it quick to initialise  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/b/9/b91ff190a0775ea3730404af351f55558b4f69a8.png)
- the zigbe2mqtt UI will show you in a popup that the regions have been deleted correctly and than as well when they have been redefined again (similar message as you have in your debug node)
- sorry, I have not checkedzigbe2mqtt logs (but I dont think it will show there, just look-out for the popups)  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/d/e/de4e0db1d36c739cf6312910aa21a0e755e752e1.png)

And here is the full flow for the FP1  
[FP1.json](https://discourse.nodered.org/uploads/short-url/qb2aMIALRI93sPEiaTKusEtbaJe.json) (93.3 KB)

I hope this was helpful for you.. 😉
