Aqara Motion Sensor zigbee2mqtt

Tags: #<Tag:0x00007fe7400a22e0> #<Tag:0x00007fe7400a21a0> #<Tag:0x00007fe7400a1f98>

Hi All,

i would need your help regarding the aqara motion sensor with zigbee2mqtt.
Occupancy is flapping between ON and OFF without any motion detection.
The only thing i found in the www is the issue with “no occupancy false” + weak signal.
Thank you for your support.

Here is my thing configuration

Thing topic MotionSensor "MotionSensor" {
        Channels:
			
			Type switch : occupancy "occupancy" [
			stateTopic = "zigbee2mqtt/MotionSensor", 
			transformationPattern="JSONPATH:$.occupancy",
			on="true", off="false"]

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

            Type number : Motion_linkquality "linkquality" [ 
				stateTopic= "zigbee2mqtt/MotionSensor",
				transformationPattern="JSONPATH:$.linkquality"

Item configuration:

/MotionSensor
    Switch occupancy "MotionSensor [MAP(MotionSensor.map):%s]" <motion>   {channel="mqtt:topic:mybroker:MotionSensor:occupancy" }
    Number illuminance "illuminance [%d lumen]"  {channel="mqtt:topic:mybroker:MotionSensor:illuminance"}
    Number Motion_linkquality "linkquality [%d]"  {channel="mqtt:topic:mybroker:MotionSensor:Motion_linkquality"}`


OH Log

020-11-18 20:48:36.270 [vent.ItemStateChangedEvent] - occupancy changed from OFF to ON

2020-11-18 20:49:18.058 [vent.ItemStateChangedEvent] - occupancy changed from ON to OFF

2020-11-18 20:49:35.826 [vent.ItemStateChangedEvent] - occupancy changed from OFF to ON

2020-11-18 20:49:49.912 [vent.ItemStateChangedEvent] - occupancy changed from ON to OFF

2020-11-18 20:49:51.612 [vent.ItemStateChangedEvent] - occupancy changed from OFF to ON

2020-11-18 20:51:06.005 [vent.ItemStateChangedEvent] - occupancy changed from ON to OFF

2020-11-18 20:51:09.117 [vent.ItemStateChangedEvent] - occupancy changed from OFF to ON

2020-11-18 20:51:29.421 [vent.ItemStateChangedEvent] - occupancy changed from ON to OFF

2020-11-18 20:51:29.520 [vent.ItemStateChangedEvent] - occupancy changed from OFF to ON

2020-11-18 20:52:18.639 [vent.ItemStateChangedEvent] - occupancy changed from ON to OFF

2020-11-18 20:52:21.187 [vent.ItemStateChangedEvent] - occupancy changed from OFF to ON

2020-11-18 20:52:49.264 [vent.ItemStateChangedEvent] - occupancy changed from ON to OFF

2020-11-18 20:52:50.670 [vent.ItemStateChangedEvent] - occupancy changed from OFF to ON``

So does it have a week signal? What value does your Motion_linkquality Item have?

Sounds like this is a hardware issue.

info  2020-11-18 21:03:15: MQTT publish: topic 'zigbee2mqtt/MotionSensor', payload '{"occupancy":true,"linkquality":178,"temperature":22.57,"illuminance":20141,"illuminance_lux":102,"update_available":true}'

linkquality":178 is shown, which is already crazy because the sensor is far away from the stick…

FYI - i have removed the device from the network + rebooted the zigbee2mqtt.
Rejoined and everything is working fine.