Aqara Motion Sensor - motion not working as expected

I have three Aqara Motion Sensors. One of them works perfectly (all triggers work). The other two can't always seem to trigger any motion. 99% of the time the motion stays inactive.

The weird thing is that lastCheckin and illuminance do update on any motion. At first I thought the sensor was broken, but today I got a new sensor with the same issues. It could be that they are both broken.

I'm using /veeceeoh/xiaomi-hubitat/master/devicedrivers/xiaomi-aqara-motion-sensor-hubitat.src/xiaomi-aqara-motion-sensor-hubitat.groovy as the driver.

I also paired the devices after a reset but that doesn't seem to make a difference.

Anyone who might know why this is happening?

There's a lot of information in that thread about using compatible repeaters with Xiaomi. Aqara versions in particular do have issues staying connected verus the Mijia versions. As mentioned many times in that thread, the Xiaomi Zigbee is non-compliant, so do expect to have issues if you pair them with anything but a Xiaomi Aqara or Mijia gateway, and you should feel very fortunate if you don't have any issues :wink:

2 Likes

I have around 12 of these and have a similar problem with just one of them. The rest have been fine for months now. It only triggers irregularly. It's upstairs but directly above the hub so should be fine, but it's probably meshed in via a bulb or suchlike which may be causing my issue or else it's faulty. Didn't get a chance to troubleshoot it properly yet.

I currently changed the cluster ID for motion from 0406 to 0400. It's not how it supposed to work as the ID 0400 is used for illuminance but this way the motion does get registered. The only down side is that the illuminance doesn't work anymore. In my case I don't rely on the illuminance function so it's fine.

So far it works like a charm!

Thanks j03y. I used your fix as inspiration.
I changed:

else if (cluster == "0400") 
  // Parse illuminance value report
  map = parseIlluminance(valueHex)

To:

else if (cluster == "0400") {
  //a "hack" because motion seems not to be triggered every time but illumination does. 
  sendEvent(parseMotion())
  // Parse illuminance value report
  map = parseIlluminance(valueHex)
}

This seems to have fixed it for me.

Have you tried my driver?

For the actual motion event to not arrive you must have some issues on the mesh. It could also be a processing issue, which is why I suggest you try my driver. If the issue persists with my driver (after changing to my driver and re-pairing the device without removing it from HE) there might be a reason to add an option to use Illuminance as an optional motion event trigger.

Not yet, I will though.
I haven't seen your driver mentioned in the forum threads which appeared when I googled "Hubitat Aquara Motion Sensor".

My thread has been ranked low in many searches, I did make some changes today based on how the "search engine" of this forum software work. It should improve results.
In general a 1 or 2 word search gives better and more accurate hits when looking for drivers in this forum. "Xiaomi driver" or "Aqara Driver" would work for example.

By the way, what does the driver setting "Force Recovery Mode" do (it seems to be mandatory)?

Force Recovery Mode is not mandatory, that is a command. No need to send it. It is for if you know your device has disconnected but not yet been detected as not present.

Thanks, I'm still quite new in the Hubitat world.

No worries! Welcome to the Community! You will find plenty of helpful people here!

Sorry to say but the issue remains, not always but often enough:

Illuminance is triggered but no motion. You might be right with the mesh problem, but then why is illuminance comming through?

I think I'll try with removing the break in your switch case.

Changing:

    case "0400_0000":
        logging("AQARA ILLUMINATION EVENT - description:${description} | parseMap:${msgMap}", 1)
        Integer lux = Integer.parseInt(msgMap['value'], 16)
        logging("Lux: $lux", 1)
        sendEvent(name:"illuminance", value: lux, unit: "lux", isStateChange: false)
        break
    case "0406_0000":
        logging("XIAOMI/AQARA MOTION EVENT - description:${description} | parseMap:${msgMap}", 100)
        sendMotionEvent()

        break

To:

    case "0400_0000":
        logging("AQARA ILLUMINATION EVENT - description:${description} | parseMap:${msgMap}", 1)
        Integer lux = Integer.parseInt(msgMap['value'], 16)
        logging("Lux: $lux", 1)
        sendEvent(name:"illuminance", value: lux, unit: "lux", isStateChange: false)
    case "0406_0000":
        logging("XIAOMI/AQARA MOTION EVENT - description:${description} | parseMap:${msgMap}", 100)
        sendMotionEvent()

        break

Ok, I've added it as an option in the driver, it is in the development branch here:

1 Like

That was fast.
Thanks.

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.