HomeHome AutomationGet Aqara Motion Sensor P1 no Matter what

Get Aqara Motion Sensor P1 no Matter what

Looking for the most flexible PIR?

Over time, Aqara has developed a perfectly adequate home automation ecosystem utilising the ZigBee protocol. Their sensors are well made, and reliable but also priced accordingly (read a bit more than others). Aqara’s approach to hubs is innovative, where other companies ask you to get a dumb hub, Aqara puts their ZigBee coordinators in IP Cameras or adds extra features to their hubs to make the purchase feel validated. Now they released a new Aqara Motion Sensor P1 (Amazon, AmazonUS) that changes

Changes that Matter

Aqara Motion Sensor P1

On the surface, the decision to release a similarly looking Aqara Motion Sensor P1 which uses ZigBee protocol makes little sense. The sensor they already have in their lineup is great for use in Aqara and custom ecosystems. But after reading the marketing material, I have no doubt, that you should get one now!

I won’t blame you for being on the edge right now with ZigBee devices. With Matter around the corner, the hesitation to invest in ZigBee is bigger than ever. Aqara Motion Sensor P1 removes that worry from the picture. While the new sensor integrates with the existing ZigBee ecosystem, underlying hardware paves the way for the Matter OTA update. That’s right, Aqara promises full Matter support with subsequent over the air upgrade.

It’s a brilliant move on their part, as you don’t have to wait for the protocol to mature, and make meaningful purchases that will survive the possible protocol overhaul and keep your smart home compatible and relevant.

Aqara Motion Sensor P1

Let’s put the Matter aside and talk about other changes. The extra heft of the Aqara Motion Sensor P1 isn’t only to accommodate the new IC. The sensors bring small, but impactful changes. I might start to believe that someone IS listening to my feedback about what’s important!

Aqara sensors were able to detect a volcano eruption on the other side of the planet in my home automation, so each time the company releases a new product, my expectations are high!

The slightly bigger enclosure houses now two CR2450 batteries for even longer battery life. The marketing material mentioned 5 years on a set of these, so forgive me for not challenging that. Anything over a year is a clear win in my books. It comes with a small adjustable stand to position Aqara Motion Sensor P1 in any way you want.

Just like other Aqara Motion Sensors and SwitchBot PIR, P1 is equipped with infrared-based motion sensing and luminance sensor. This 2 in one sensing brings extra automation opportunities based on motion and light triggers.

Strangely, the included triggers include:

  • motion detected
  • motion detected light levels above
  • motion detected light levels below
  • no motion detected for

which I found strange, that the device cannot react to light triggers alone. Also new (at least from the last time I checked) is the no motion present for – previously only found in the SwitchBot ecosystem. Something I appreciated a lot!

Aqara ZigBee 3.0 line up so far:

1-second rule

This is how quickly Aqara Motion Sensor P1 resets

What’s definitely new, and competition-beating is the ability to set a custom detection timeout raging from 1-200sec. You will have to change this manually, as the default detection timeout period is 30 sec. Remember, this will influence the battery life of the device in a busy environment. The advertised 5 years of battery life is calculated on a min timeout of 30 sec.

Another new option is the ability to set the sensitivity of the sensor (low/med/high) to filter out undesired triggers. The advertised detection range is 2m on low and 7m on high. All of these will be welcomed by anyone looking to automate their home based on motion triggers.

Lastly, included inside the Aqara Motion Sensor P1 lux meter isn’t capped as other sensors at 1000lux and can report brighter values for more precise control. A nice feature in theory, but in practice, you are still limited by the device triggers from the automation panel.

Aqara Motion Sensor P1 in NodeRED

Aqara Motion Sensor P1 in NodeRED
Aqara Motion Sensor P1 – Dashboard

What if you don’t want to use Aqara Motion Sensor P1 in the Aqara ecosystem? Right now, the sensor is using ZigBee 3.0 and should be compatible with custom coordinators, although until it lands properly not all features may be supported. As I use Electrolama and Sonoff ZigBee dongles I decided to poke around and see if I can make it work with ZigBee2MQTT.

Aqara Motion Sensor P1 in NodeRED
Sample NodeRed flow for Aqara Motion Sensor P1

If want to know more about adding new devices to the network, this article will cover this for you. I will focus on data received from the device.

As expected, at first the device isn’t listed among supported devices and returns:

Device '0x54xxxxxxxxx' with Zigbee model 'lumi.motion.ac02' and manufacturer name 'LUMI' is NOT supported, please follow 
https://www.zigbee2mqtt.io/advanced/support-new-devices/01_support_new_devices.html

Looking at the devices from the Xiaomi ecosystem (where Aqara devices are) the closest device that comes with a similar feature set is: lumi.motion.agl02 and while it does report what it seems to be the whole payload:

{"battery":100,
"detection_interval":30,
"illuminance":12,
"linkquality":132,
"motion_sensitivity":"medium",
"occupancy":false,
"voltage":3100}

it errors out in the log:

(Error: Read 0x54exxxxxxxx/1 genPowerCfg(["batteryVoltage"], {"sendWhen":"immediate","timeout":10000,"disableResponse":false,"disableRecovery":false,"disableDefaultResponse":true,"direction":0,"srcEndpoint":null,"reservedBits":0,"manufacturerCode":null,"transactionSequenceNumber":null,"writeUndiv":false}) failed (Data request failed with error: 'MAC transaction expired' (240))

To fix that I edited the device converted and my final device looks like this:

{
        zigbeeModel: ['lumi.motion.ac02'],
        model: 'RTCGQ12LM',
        vendor: 'Aqara',
        description: 'Aqara P1 human body movement and illuminance sensor',
        fromZigbee: [fz.RTCGQ12LM_occupancy_illuminance, fz.battery],
        toZigbee: [tz.aqara_detection_interval],
        exposes: [e.occupancy(), e.illuminance().withUnit('lx').withDescription('Measured illuminance in lux'),
            exposes.numeric('detection_interval', ea.ALL).withValueMin(2).withValueMax(65535).withUnit('s')
                .withDescription('Time interval for detecting actions'), e.temperature(), e.battery()],
        meta: {battery: {voltageToPercentage: '3V_2850_3000_log'}},
        configure: async (device, coordinatorEndpoint, logger) => {
            const endpoint = device.getEndpoint(1);            
        },
        ota: ota.zigbeeOTA,
    },

Now you can use Aqara Motion Sensor P1 in NodeRED. As the sensor supports extra options, you can set the default values by editing the configuration.yaml in your zigbee2mqtt installation.

For this sensor your configuration should look like this:

'0x54xxxxxxxxxxx':
  friendly_name: 'Aqara Motion Sensor P1'
  occupancy_timeout: 10
  motion_sensitivity: "high"

With timeout spanning from 1 to 200 and sensitivity taking the values of low/medium/high. Unfortunately, I could not make the settings stick. So it’s something that will get resolved over time.

NodeRED Test Flow
[{"id":"9860e8b3.327588","type":"group","z":"5b5ca77a.f14fb8","name":"Aqara Motion Sensor P1","style":{"stroke":"#ffC000","fill":"#ffefbf","label":true,"label-position":"n","color":"#001f60"},"nodes":["a5742c29.c46fc","8b0c7be1.19f388","af043f9d.2969b","5e12023a.c7ae6c","f18b6855.d8d5a8","db26535c.da95a","6b59a4f0.fac24c","0f20f7be625b4684","c8274723560e68a6"],"x":234,"y":39,"w":652,"h":242},{"id":"a5742c29.c46fc","type":"mqtt in","z":"5b5ca77a.f14fb8","g":"9860e8b3.327588","name":"PIR","topic":"zigbee/0x54ef44100043dbc3","qos":"0","datatype":"json","broker":"6e117ba5.8026e4","nl":false,"rap":true,"rh":0,"inputs":0,"x":310,"y":140,"wires":[["8b0c7be1.19f388","f18b6855.d8d5a8","6b59a4f0.fac24c","c8274723560e68a6"]]},{"id":"8b0c7be1.19f388","type":"function","z":"5b5ca77a.f14fb8","g":"9860e8b3.327588","name":"Get data","func":"var data = msg.payload;\n\n//Luminosity\nmsg.payload = data.illuminance;\nmsg.topic = \"illuminance\";\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":520,"y":140,"wires":[["af043f9d.2969b"]]},{"id":"af043f9d.2969b","type":"ui_chart","z":"5b5ca77a.f14fb8","g":"9860e8b3.327588","name":"","group":"a16a53a9.053db","order":5,"width":0,"height":0,"label":"Luminosity","chartType":"line","legend":"false","xformat":"HH:mm:ss","interpolate":"linear","nodata":"","dot":false,"ymin":"","ymax":"","removeOlder":1,"removeOlderPoints":"","removeOlderUnit":"86400","cutout":0,"useOneColor":false,"useUTC":false,"colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"outputs":1,"useDifferentColor":false,"x":770,"y":140,"wires":[[]]},{"id":"5e12023a.c7ae6c","type":"ui_template","z":"5b5ca77a.f14fb8","g":"9860e8b3.327588","group":"a16a53a9.053db","name":"Link and  Battery","order":2,"width":2,"height":2,"format":"\n
\n","storeOutMessages":true,"fwdInMessages":true,"resendOnRefresh":true,"templateScope":"local","className":"","x":780,"y":180,"wires":[[]]},{"id":"f18b6855.d8d5a8","type":"function","z":"5b5ca77a.f14fb8","g":"9860e8b3.327588","name":"Range Fromat","func":"var range = msg.payload.linkquality;\nvar batteryV = msg.payload.voltage / 1000;\nvar batteryP = msg.payload.battery;\n\n//strong 130+\nif(range >= 130){\n msg.icon = \"signal_wifi_3_bar\";\n msg.colour = \"fill: green\";\n}\n//good 90-129\nif(range >= 90 && range < 130){\n msg.icon = \"signal_wifi_2_bar\";\n msg.colour = \"fill: blue\";\n}\n//medium 50-89\nif(range >= 50 && range < 90){\n msg.icon = \"signal_wifi_1_bar\";\n msg.colour = \"fill: orange\";\n}\n//low below <49\nif(range < 50){\n msg.icon = \"signal_wifi_0_bar\";\n msg.colour = \"fill: red\";\n}\n\nmsg.batteryP = \"Battery: \" + batteryP + \"%\";\nmsg.batteryV = \"Battery voltage: \" + batteryV + \"V\";\n\nreturn msg;\n","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":540,"y":200,"wires":[["5e12023a.c7ae6c"]]},{"id":"db26535c.da95a","type":"ui_text","z":"5b5ca77a.f14fb8","g":"9860e8b3.327588","group":"a16a53a9.053db","order":4,"width":6,"height":1,"name":"Last event","label":"Last event: ","format":"{{msg.payload}}","layout":"row-spread","x":770,"y":80,"wires":[]},{"id":"6b59a4f0.fac24c","type":"function","z":"5b5ca77a.f14fb8","g":"9860e8b3.327588","name":"Get trigger time","func":"if(msg.payload.occupancy === true) {\n var date = new Date();\n \n msg.payload = \"Day: \" + date.getDate() +\"/\"+ date.getMonth()+ \" Time: \"+ date.getHours() +\":\"+date.getMinutes();\n return msg;\n}\n","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":540,"y":80,"wires":[["db26535c.da95a"]]},{"id":"0f20f7be625b4684","type":"ui_template","z":"5b5ca77a.f14fb8","g":"9860e8b3.327588","group":"a16a53a9.053db","name":"Motion Icon","order":1,"width":4,"height":3,"format":"\n","storeOutMessages":true,"fwdInMessages":true,"resendOnRefresh":true,"templateScope":"local","className":"","x":770,"y":240,"wires":[[]]},{"id":"c8274723560e68a6","type":"function","z":"5b5ca77a.f14fb8","g":"9860e8b3.327588","name":"Motion","func":"var value = msg.payload.occupancy;\n\n\n\n//motion\nif(value === true){\n msg.icon = \"transfer_within_a_station\";\n msg.colour = \"fill: red\";\n}\n// no motion\nelse{\n msg.icon = \"transfer_within_a_station\";\n msg.colour = \"fill: LightSlateGray\";\n}\nreturn msg;\n","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":510,"y":240,"wires":[["0f20f7be625b4684"]]},{"id":"6e117ba5.8026e4","type":"mqtt-broker","name":"MQTT","broker":"home.lan","port":"1883","clientid":"","autoConnect":true,"usetls":false,"protocolVersion":"4","keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","birthMsg":{},"closeTopic":"","closeQos":"0","closePayload":"","closeMsg":{},"willTopic":"","willQos":"0","willPayload":"","willMsg":{},"sessionExpiry":""},{"id":"a16a53a9.053db","type":"ui_group","name":"Aqara PIR sensor","tab":"66618e35.02598","order":1,"disp":true,"width":"6","collapse":false},{"id":"66618e35.02598","type":"ui_tab","name":"Aqara Sensors","icon":"dashboard","disabled":false,"hidden":false}]

Final thoughts

It’s a perfect motion sensor for anyone unsure if they are going to switch to Matter in the future. You will pay extra for Aqara Motion Sensor P1 (Amazon, AmazonUS) – priced at launch ($24.99) but it will be cheaper than getting a ZigBee sensor and Matter compatible sensor later down the line. Plus for a long time, we all have been waiting for a sensor without barbaric timeout limits. Aqara Motion Sensor P1 is the one to get, no Matter what. Let me know your thoughts in this Reddit thread.

🆓📈 – See the transparency note for details.

PayPal

Nothing says "Thank you" better than keeping my coffee jar topped up!

Patreon

Support me on Patreon and get an early access to tutorial files and videos.

image/svg+xml

Bitcoin (BTC)

Use this QR to keep me caffeinated with BTC: 1FwFqqh71mUTENcRe9q4s9AWFgoc8BA9ZU

Smart Ideas with

Automate your space in with these ecosystems and integrate it with other automation services

client-image
client-image
client-image
client-image
client-image
client-image
client-image
client-image
client-image

Learn NodeRED

NodeRED for beginners: 1. Why do you need a NodeRED server?

0
To server or not to server? That's a very silly question!

Best Automation Projects

Tuya SDK for beginners: Intro to Tuya Cloud API

0
Working with Tuya Cloud API. A guide to Cloud automation for beginners, get started with REST!

NEST your old thermostat under $5

0
Nest-ing up your older thermostat under $5

Sonoff Zigbee Bridge – review

0
Sonoff line up will soon include Sonoff Zigbee Bridge and more Zigbee sensors - here is the first look

Nora – Google Assistant in NodeRED

0
Integrate Google Assistant with NodeRED thanks to Nora - NodeRED home automation

DIY Smart Washing Machine – for about 15 bucks!

0
Learn how to add washing machine notifications to your Google Home on the cheap

Smart Home

I damaged the cheapest Smart Socket with power metering for you

0
Sonoff S60 has an exeptional price for a smart socket with a power meter - I decided to check it out and see how flashable it is

The end of Tasmota? Sonoff SwitchMan M5 Matter

0
These are one of the least expensive Matter devices to automate your lights. Will Sonoff SwitchMan M5 Matter put an end to Tasmota?

Meros TRV to the rescue?

0
I got my hands on another TRV - this time from Meross. I heard good things about the brand so I wanted to see if Meross TRV would be good to manage smart heating.

Aqara brings Thread sensors but…

0
Aqara brings new Thread sensors to their ecosystem. First sensors to support Matter this way are Aqara Motion and Light Sensor P2 and Aqara Contact Sensor P2

Multi-lights for your ceiling from Aqara

0
This is the biggest light I held in my hands so far. It's ZigBee and it comes from Aqara - meet Aqara Ceiling Light T1M