Aqara P1 motion sensor

So, I read a couple reports from people using zigbee2mqtt that they were having trouble pairing the P1 contact sensors to the zigbee 3.0 gateways they were using. Some Aqara lines are ostensibly zigbee 3.0, but only pair to specific Xiaomi gateways.


Yeah, same old thing. They are still are not conforming to a standard, just pretending they are.


One way to enforce "loyalty." [eek!]

1 Like

I think I remember now. I did a lot of messing around with this hub and AlexxIT's HA integrations. There were some breaking changes in new firmware that would prevent updates via the app, but you could still update via telnet. So you've been praising zigbee2mqtt for a while, and I like to screw around with stuff, and now have a mosquito server running 24/ given the choice...

Found firmware files:
1: ncp-uart-sw_mgl03_6_6_2_stock.gbl
2: ncp-uart-sw_mgl03_6_7_10_z2m.gbl
3: ncp-uart-sw_mgl03_6_7_8_z2m.gbl

Select firmware: 2
You selected: ncp-uart-sw_mgl03_6_7_10_z2m.gbl


1 Like

There are options. Don't know if I'm going to go as far as Node-Red, but there are option regardless.

Discussed @6:46


Joins to Hubitat as Device, but there's no driver that works with it. None of the existing Aqara motion sensor drivers work. No motion state appears.

Here's the fingerprint, but I doubt that's going to help anything. Someone that knows how to write drivers needs to have one of these. That person is not me.

It doesn't join to the Mijia hub. They don't have a profile for the Aqara T1 or P1 devices, but it does join to HA using the Mijia Multimode hub as the controller with Zigbee HA, but again, it doesn't have a driver so no motion entity appears.

However, it does join to the Aqara HomeKit hub (the non E1 version) that is unsupported. You just have to tell the hub you're joining a T1 motion sensor and it pairs with all the options available.

But there's a catch when using it with the unsupported hub. Tapping more settings lets you get to the unique features of the sensor and do the stuff you couldn't do with the original sensor without physical modification.

Right after pairing, it will respond to adjusting the detection interval, turning the trigger indicator on or off, and setting the sensitivity.

But after a while, it stops responding to the settings changes, and will give you a failed to configure message.

You then have to remove the devices and rejoin it so you can get that short window to make changes to its configuration. But that seems to be a viable workaround.

It takes quite a long time to appear in HomeKit, but it eventually does. No settings can be changed in HomeKit, and even if you have the sensor configured to respond at quick intervals (10 seconds for example), HomeKit will not reset to no motion detected in less time than 30 seconds. Not unexpected, and it still makes the sensor useful for capturing motion frequently to keep lights on or capture every movement possible.

Not prefect, but not horrible either. As long as it keeps working with the Aqara hub I have, I'll keep it and just trigger a Hubitat Virtual Switch via HomeKit Automations.


zigbee2mqtt just added support for the Aqara P1 sensors in the latest release - 1.25.1.


I love my z2m setup. Rock solid with all sorts of weird zigbee devices which would cause my HE to have a heart attack.


Going to have to do a backup of my HA and try again with Zigbee2MQTT. Couldn’t get it going on a VM. It would not display the Web UI no matter how many times I reinstalled it, restarted, etc. I’m fairly certain it’s just overtaxed. I’m sure the Raspberry Pi 4 will have no trouble with it, but I just built it and have it running exactly how I want, so I’m a little apprehensive about messing with the setup. Might just order another micro SD to make it safer to play with the setup.

Where and how did you setup the zigbee2mqtt?

I documented my setup on a smoke and mirrors site more than a year ago. In short, I bring my zigbee2mqtt devices into NodeRED, and then back into Hubitat using virtual devices, using either built-in drivers, or ones that I wrote.

If I was doing it over again, I would just use HA, and Home Assistant Device Bridge to bring them into Hubitat.


Can confirm this works great with Zigbee2MQTTT, and it has every control except the ability to enable/disable the LED. They either disable it by default, or maybe it gets written in non-volatile space, because I did have it disabled before using the Aqara hub and it has stayed disabled after resetting the device and joining it to the ConBee 2. That would make sense, as there's the update wait time as shown in that previously posted image, when you change the optional settings.

Temperature is supposed to work, but doesn't work for me. I got Null for some of the other Xiaomi devices, but joining them again resolved that. Didn't happen here. Maybe my ConBee firmware is out of date. It's been a while. But I just spent the time to add my devices and reconfigure RM rules to use the entities that are coming from z2m. This is working and I'm not going to update the ConBee 2 so I can maybe get some inaccurate temperature I don't even really care about, and then have to re-join everything as punishment.

[Update 5.7.2022] Lights in the garage didn’t turn on when expected. Checked z2m exposure settings and found it was back on Medium sensitivity. I’m not going to say that’s a problem right now, because it may have been me setting it to Medium accidentally. However, it has the same issue that I had with it on the Aqara HomeKit v1 hub. Had to re-join it to get it to change sensitivity level. Might be a problem with the device firmware, rather than the controllers. No firmware update available for it on either the Aqara hub or Z2m at this time.

1 Like

Hello, I'm new here. I have question about driver.
So, this driver works for me:

if I change condition at line [90]
from this
if (cluster == "0406")
to this:
if (cluster == "FCC0")

But I do not see lux messages.
And the icon on dashboard is preaty generic.
Who is writing all this drivers?
And when can I expect some stabile version ?

1 Like

There are built-in drivers only for devices on the compatibility list. Xiaomi devices are not on the compatible devices list because they don’t use standard ZHA 1.2 or zigbee 3.0.

There are plenty of community drivers for these devices written by volunteer developers from the community. However, none of them can guarantee that your specific devices will function as you expect - their function differs substantially dependent on the repeaters in your zigbee mesh, and the RF conditions at your install location.

For an optimal experience with Hubitat, I would recommend sticking with devices on the compatible devices list.

1 Like

So there are 2 new features with this sensor:

  1. 5 years of battery instead of 2 years ( not a deal-breaker for me as the batteries are replaceable)
  2. configurable detection timeout
    isn't a timeout/delay something that is already possible via HE rules or am I missing somthing here?

Nevermind :slight_smile: I already found that the P1 allows seconds timeout and the older version starts at a minute.

Just bought one from Aliexpress, just for the fun of it. Hope someone we'll be able to integrate it into HE.

1 Like

Have you got a link? I have not been able to find any there.

It goes in and out of stock.
It was in stock yesterday, I hesitated a bit and it was gone after 10 minutes. Checked again today and it was there so I bought one, but now it's out of stock again. Try to refresh the page later today or tomorrow.


Did you ever figure this out? I am using the Sonoff Zigbee 3.0 USB Dongle Plus, Z2M and Mosquito as the broker. I have it working, but when I change the settings like sensitivity or interval, they revert back to the default (meaning they never seem to save). I have seen a few posts that seem to indicate that when you change the settings when using the Aqara Hub you have to press the button on the P1 right after changing the settings in their app so that it wakes up the P1 and saves the settings. I am not using their hub as I said, however I wonder if these same steps are necessary when changing the settings via the Z2M? I have not tried it yet.

Download the Hubitat app