Aqara FP1 with Zigbee2mqtt

Hi, I just received my aqara FP1 sensor and it works really well with zigbe2mqtt
chrome_j9HXwogHyP

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

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 ?

1 Like

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.

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

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:

{
    "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 :thinking:

1 Like

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

  1. Click the "+" icon in region_upsert
  2. Select the region number you want to define
  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
  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 :wink: .. 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
  • 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
1 Like

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?

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

Maybe the firmware of my zigbee adapter is too old according to Xiaomi RTCZCGQ11LM control via MQTT | Zigbee2MQTT.

CC1352/CC2652: 20211114

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.

1 Like

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

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 :frowning:

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

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

What is it that you upgraded?

I upgraded to the latest zigbe2mqtt 1.32.2 ... just wanted to let others know about the issue (raised with zigbee2mqtt)

no issue with node-red :wink:

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

I have now used the manual commands for delete and create as per the zigbee2mqtt product page 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

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)

1 Like

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 (7.6 KB)
The attached flow will :

  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

Have fun :wink:

2 Likes

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)

Hi @Benniphx ,

1) MQTT-IN

  • I store all me mqtt data in a THING data-structure 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
  • this is the normal mqtt-out node with no additional modifications

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

  • 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
  • the connection/wiring between 3)Region Logic to 4)Light Arena depends on how you define your regions

5) Zigbee Lights

  • in below sample any movement in Region 1 or 2 or 3 will switch-on my Kitchen light

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
  • 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)

And here is the full flow for the FP1
FP1.json (93.3 KB)

I hope this was helpful for you.. :wink:

1 Like