Problem: Zigbee Binding with Aqara Motion Sensor

Hello all,

I’m running Openhab 2.5.5-1 on a Raspberry Pi 3 with Raspbian Buster using the latest Zigbee Binding with a TI CC2531EMK USB Stick (Firmware CC2531ZNP-Pro-Secure_LinkKeyJoin.hex).

Two Aqara door sensor are working perfectly within OH.

For two Aqara Motion sensors auto detection generates a Thing and shows 4 channels:

Low Battery,

Problem: Occupancy is obviously a switch item, that – on both sensors - seems to be always ON - … no change in status if a moving human body is in the detection range.

I can see changing Illuminance values in the logs – but only a “changed from NULL to ON” for the occupancy at first connect.

Any experience or Ideas, on how to configure the AQARA Motion Sensor within the Zigbee Binding?
Thanks for your help!


I have the same problem, did you find a way to use the Aqara with Zigbee binding?

Thanks for any help.

yes, it works pretty well now.
This is my configuration:

Thing file

Thing topic AQARA_BWM_R1 “BWM Room 1” {


Type switch : motion "Detektion" [ stateTopic="zigbee2mqtt/AQARA_BWM_R1", transformationPattern="JS:getZigbeeOccupancy2Switch.js"]

Type number : brightness "Helligkeit" [ stateTopic="zigbee2mqtt/AQARA_BWM_R1", transformationPattern="JSONPATH:$.illuminance"]

Type number : voltage "Spannung" [ stateTopic="zigbee2mqtt/AQARA_BWM_R1", transformationPattern="JSONPATH:$.voltage"]

Type number : battery "Batterie" [ stateTopic="zigbee2mqtt/AQARA_BWM_R1", transformationPattern="JSONPATH:$.battery"]

Type number : linkquality "Signal" [ stateTopic="zigbee2mqtt/AQARA_BWM_R1", transformationPattern="JSONPATH:$.linkquality"]


Switch AQARA_BWM_R1 “BWM Room 1” (BWM) { channel=“mqtt:topic:mosquitto:AQARA_BWM_R1:motion” }

Number AQARA_BWM_R1_Battery “Batterie R1” { channel=“mqtt:topic:mosquitto:AQARA_BWM_R1:battery” } //

Number AQARA_BWM_R1_LUX “Helligkeit R1 [%.3f LUX]” { channel=“mqtt:topic:mosquitto:AQARA_BWM_R1:illuminance” }

Number AQARA_BWM_R1_Voltage “Spannung R1” { channel=“mqtt:topic:mosquitto:AQARA_BWM_R1:voltage” } //

Number AQARA_BWM_R1_linkquality “Signal R1” { channel=“mqtt:topic:mosquitto:AQARA_BWM_R1:linkquality” } //


rule "Room 1 light on "


    Item AQARA_BWM_R1 changed 

then if( AQARA_BWM_R1.state == ON )


        logInfo("Zwave","R1 BWM ON - Light ON")


else {shelly1_R1_relais.sendCommand(OFF)

        logInfo("Zwave","R1 BWM OFF - Light OFF")}


In order to save battery, the sensor does not measure too often. So it might take a few seconds until motion is OFF after you left a room. Changing from OFF to ON is pretty fast. It will not send regular ON updates if a constant motion/occupancy is detected.

Sorry for pasting the code as plain text - I don’t know how to do it better :wink:
I hope this helps!


Note that you seemed to have solved the issue by not using the Zigbee binding, and using zigbee2mqtt and the MQTT binding instead. Just a heads up for @aulvoy

1 Like

Same for me. With zigbee2mqtt the sensor works more or less sucessfull.

As I want to reduce the systems in between, therefore I desiced to use my zigBee network directly with the zigBee binding.

I also the see Aqara Motion Sensor sensor switch to ON, but never to OFF (only, if I touch the switch manually, i.e. by paperUI from ON to OFF).

Someone a step ahead, how to realize it - otherwise I need to switch back to zigbee2mqtt.

I have the same problem.
the motion sensor switch to On when there is a movement but never switch back to off
I found a solution by adding a rule to switch ii to off 59 seconds after it state changes from off to on
There is a delay of 60 seconds before the sensor is able to detect a second movement