Koenkk / zigbee2mqtt

Zigbee 🐝 to MQTT bridge 🌉, get rid of your proprietary Zigbee bridges 🔨
https://www.zigbee2mqtt.io
GNU General Public License v3.0
11.96k stars 1.67k forks source link

[New device support]: Aqara P1 Motion Sensor (MS-S02) #11990

Closed backlink-market closed 2 years ago

backlink-market commented 2 years ago

Link

https://www.aqara.com/en/product/motion-sensor-p1

Database entry

{"id":24,"type":"EndDevice","ieeeAddr":"0x54ef44100043e1a1","nwkAddr":380,"manufId":4447,"manufName":"LUMI","powerSource":"Battery","modelId":"lumi.motion.ac02","epList":[1],"endpoints":{"1":{"profId":260,"epId":1,"devId":263,"inClusterList":[0,1,3,64704],"outClusterList":[3,25,64704],"clusters":{"genBasic":{"attributes":{"appVersion":5,"modelId":"lumi.motion.ac02","manufacturerName":"LUMI","powerSource":3,"zclVersion":3,"hwVersion":1,"dateCode":"Dec 7 2021","swBuildId":"0.0.0_0005"}},"aqaraOpple":{"attributes":{"252":0}}},"binds":[],"configuredReportings":[],"meta":{}}},"appVersion":5,"hwVersion":1,"dateCode":"Dec 7 2021","swBuildId":"0.0.0_0005","zclVersion":3,"interviewCompleted":true,"meta":{},"lastSeen":1648630655174,"defaultSendRequestWhen":"immediate"}

Comments

The new Aqara P1 Motion Sensor (MS-S02) is nearly the same as the Aqara RTCGQ11LM but with two Batteries and a possibilty to change the timeout and constant LUX updates.

bzeiss commented 2 years ago

@Otnow Great!

About the sensitivity, I'm not sure. It behaves really odd. I have tried multiple timeout settings and occupancy timeouts along with different sensitivity values. I think low is still worse than high. No matter what configuration, the maximum detection distance is like 2m for me (with all my four P1 motion sensors).

backlink-market commented 2 years ago

I can confirm. Most P1 sensor does only have a detection distance of 2m or below.....don't know why

Otnow commented 2 years ago

It seems that the matter is not in the sensitivity settings, but this option can be definitely excluded only by testing the sensor with the native Aqara hub.

Does anyone from the owners of the sensor have such an opportunity?


Also on the official website of the manufacturer there is such a comparison table:

Motion-Sensor P1

As far as I understand, the old model RTCGQ11LM is compared with RTCGQ14LM.

This is the detection area for the RTCGQ11LM from the user manual (by the way, the maximum distance is 7 m, not 4 m as noted in the comparison table above):

RTCGQ11LM

And this is the detection area for RTCGQ14LM from the user manual:

RTCGQ14LM

Looking at the detection areas, it is completely incomprehensible why the RTCGQ14LM has problems with this.

As one of the reasons, some kind of manufacturing defect is possible, for example, with a lens.

By the way, is there an inconspicuous protective film on the lens that can interfere with the normal operation of the sensor?

backlink-market commented 2 years ago

Does low or high mean full distance of 7m? can't really see a difference when changing

bzeiss commented 2 years ago

My P1 motion sensors don't have a protective film. I think I have also placed them pretty well according to the instructions. What I have noticed, having tested them for a few days now, is that one single of my P1 sensors seems to overperform all the time (i.e. it triggers at a distance of maybe 4-5 meters) even on low sensitivity while the others don't. Unfortunately, I don't have the Aqara hub to test them with. I hope that someone else here is able to help with this.

Otnow commented 2 years ago

Does low or high mean full distance of 7m? can't really see a difference when changing

Theoretically yes, but apparently there is some other reason for the problem.


@bzeiss, thanks for the info. Strange problem. Let's wait for feedback from other owners.

TheJulianJES commented 2 years ago

Using ZHA here with a slightly modified version of this WIP quirk. I can confirm that the detection range is only around 2 meters on Medium (2). Setting it to High (3) seems to increase the range a bit (sometimes?).

spn91 commented 2 years ago

It seems that this a problem with the retail version of the P1 motion sensor. I didn't notice it, because I have only one in use and this one doesn't need to detect motion farther away than 2 meters. This problem is already discussed in the Aqara Beta Test Channel and reported from users which are using the aqara zigbee gateway.

backlink-market commented 2 years ago

Is it fixable via software update? Or do we need to send the sensor back to aqara?

spn91 commented 2 years ago

We don't know it yet. On the retail version is a newer firmware installed, then on the beta version of the sensor. Maybe this is the reason.

bzeiss commented 2 years ago

@spn91 Is that beta test channel you are referring to something public? As I have four of the p1 sensors, I'm really interested in a solution.

TheJulianJES commented 2 years ago

@bzeiss I think spn91 was talking about the pre-release firmware installed on sensors that were for testing. Z2M has a fix for getting P1 sensors completely working that should be releasing with the next Z2M release (I think it should be tomorrow).

spn91 commented 2 years ago

@bzeiss no, it isn’t. There’s is also no solution for this problem at the moment, so access to this channel wouldn’t help. It has already been escalated to aqara, but no answer from them yet.

spn91 commented 2 years ago

@TheJulianJES this sounds interesting. Do you know how this problem has been fixed?

TheJulianJES commented 2 years ago

See https://github.com/Koenkk/zigbee-herdsman-converters/pull/4099 for the initial device support and https://github.com/Koenkk/zigbee-herdsman-converters/pull/4299 for the high illuminance fix.

Basically, the sensor only sends high illuminance values when in complete darkness. Z2M just parses those high values as illuminance=0 for now.

bzeiss commented 2 years ago

@TheJulianJES This is very cool, looking very forward to test this.

spn91 commented 2 years ago

Hmm I think I can’t follow you. The device was already supported for a longer time now and the other fix is for the problem with illumination and not the detection range 🤔

TheJulianJES commented 2 years ago

@spn91 Sorry, the problem I was talking about was with the high illuminance and not the detection range. That will probably really need a firmware upgrade (if it's not a hardware issue)

backlink-market commented 2 years ago

@spn91 Sorry, the problem I was talking about was with the high illuminance and not the detection range. That will probably really need a firmware upgrade (if it's not a hardware issue)

Is there anything new regarding the detection range problem?

bzeiss commented 2 years ago

So I have fetched an Aqara Hub E1 (which seems to be the cheapest Aqara hub) to check whether there is a firmware update that fixes things. There is indeed an update available:

current version: 0.0.0_0005 Latest version: version 0.0.0_00006

"Optimize illumination reporting".

I'm updating two of my sensors now and repair them with Zigbee2MQTT to find out whether the reporting has improved.

By the way: in case anyone wants to try this too, it has taken quite a while for me to get to this point.

1) Pairing the Aqara Hub E1 with Aqara home: being in Europe I could safely ignore most comments on the Internet that suggested switching modes from Xiaomi Home to Aqara home, resetting everything by pressing the button 10 times etc. Two things were most relevant to me: switching to a 2.4ghz wifi network and actually understanding how the Aqara Home App on Android works. The screen where I was expecting the pairing to happen wasn't even the pairing screen, but a screen before that. A very tiny checkbox (that I didn't identify as something that had to be checked) had to be checked in order to proceed to the actual pairing screen.

2) I thought one firmware update for the hub was enough and after that started the pairing process with the P1. This pairing process failed all the time. It tuned out I had to do like 4 or 5 firmware updates to the Aqara Hub E1 before I had the latest version which could actually pair the motion sensor P1.

I'll report back to this thread as soon as I have a result with the new firmware version. The firmware update of the sensors seems to take a long time.

spn91 commented 2 years ago

I don’t think that a firmware update which fixes this problem is already available. I just got the info this week (after a long time), from an aqara representative, that they began to work on it.

But your work was not for nothing, because may you can provide us with the firmware if it is available in the near future ;)

bzeiss commented 2 years ago

Sure, I'll definately help in grabbing the file if someone gives me pointers how to do that (Wireshark?).

Otnow commented 2 years ago

Created a PR to add OTA firmware.

Sure, I'll definately help in grabbing the file if someone gives me pointers how to do that (Wireshark?).

The OTA firmware file can be obtained in the following way: https://www.zigbee2mqtt.io/advanced/more/tuya_xiaomi_ota_url.html

Otnow commented 2 years ago

Created a PR to add OTA firmware.

The PR has been merged, so now it is possible to update the sensor firmware using z2m.

Judging by the update log (Optimize illumination reporting), it seems to me that this firmware (_0.0.00006) should fix the problem of reporting high illuminance values in the dark (#12596).

backlink-market commented 2 years ago

Is there anything new regarding the detection range problem?