Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Xiaomi Motion Sensor RTCGQ11LM not reporting occupancy:true the second (like#1498) #2274

Closed
e-t-h opened this issue Nov 4, 2019 · 141 comments
Closed

Comments

@e-t-h
Copy link

e-t-h commented Nov 4, 2019

Bug Report

I have the same issue like described in the closed issue #1498: sensors don't report occupancy:true.
I have two RTCGQ11LM sensors, ran for a long time at an Aqara Hub, without any issues. Since I am working with zigbee2mqtt I've noticed that they shows the same behavior @zerofruchtshake desribed in issue #1498: the occupancy value is not set properly. I am currently not able to get a message with "true".

What happened

Two sensors:
Sensor 1 (friendly name Bew_unten) is hardware modified like discribed in the documentation to shorten the time the sensor ignores any movements.

Sensor 2 (friendly name Bew_oben) is not modified.
Both have the same issue.

What did you expect to happen

sensors value "occupancy" should be set to "true"

How to reproduce it (minimal and precise)

It happens every time with every sensor; sensors were resetted,

Debug Info

zigbee2mqtt version: 1.6.0,
CC253X firmware version:20190608

I've collect some debug messages with the option DEBUG=zigbee-shepherd*-option, might be that helps? Currently I am not able to sniff with a second CC253x..

sensor 1

zigbee-shepherd:msgHdlr IND <-- AF:incomingMsg +114ms
zigbee-shepherd:af dispatchIncomingMsg(): type: zclIncomingMsg, msg: {"groupid":0,"clusterid":1024,"srcaddr":33408,"srcendpoint":1,"dstendpoint":1,"wasbroadcast":0,"linkquality":34,"securityuse":0,"timestamp":8829962,"transseqnumber":0,"len":8,"data":{"0":24,"1":47,"2":10,"3":0,"4":0,"5":33,"6":18,"7":0},"zclMsg":{"frameCntl":{"frameType":0,"manufSpec":0,"direction":1,"disDefaultRsp":1},"manufCode":0,"seqNum":47,"cmdId":"report","payload":[{"attrId":0,"dataType":33,"attrData":18}]}} +92ms
zigbee2mqtt:debug 11/4/2019, 12:27:34 PM Received zigbee message of type 'attReport' with data '{"cid":"msIlluminanceMeasurement","data":{"measuredValue":18}}' of device 'lumi.sensor_motion.aq2' (0x00158d0002b48ee2) of endpoint 1
zigbee2mqtt:info 11/4/2019, 12:27:34 PM MQTT publish: topic 'zigbee2mqtt/Bew_oben', payload '{"illuminance":18,"linkquality":34,"occupancy":false,"battery":100,"voltage":3035}'
zigbee2mqtt:debug 11/4/2019, 12:27:34 PM Received zigbee message of type 'devChange' with data '{"cid":"msIlluminanceMeasurement","data":{"measuredValue":18}}' of device 'lumi.sensor_motion.aq2' (0x00158d0002b48ee2) of endpoint 1
zigbee-shepherd:msgHdlr IND <-- ZDO:srcRtgInd +31ms

sensor 2

zigbee-shepherd:msgHdlr IND <-- AF:incomingMsg +8ms
zigbee-shepherd:af dispatchIncomingMsg(): type: zclIncomingMsg, msg: {"groupid":0,"clusterid":1024,"srcaddr":40372,"srcendpoint":1,"dstendpoint":1,"wasbroadcast":0,"linkquality":31,"securityuse":0,"timestamp":8830101,"transseqnumber":0,"len":8,"data":{"0":24,"1":24,"2":10,"3":0,"4":0,"5":33,"6":44,"7":0},"zclMsg":{"frameCntl":{"frameType":0,"manufSpec":0,"direction":1,"disDefaultRsp":1},"manufCode":0,"seqNum":24,"cmdId":"report","payload":[{"attrId":0,"dataType":33,"attrData":44}]}} +9ms
zigbee2mqtt:debug 11/4/2019, 12:27:34 PM Received zigbee message of type 'attReport' with data '{"cid":"msIlluminanceMeasurement","data":{"measuredValue":44}}' of device 'lumi.sensor_motion.aq2' (0x00158d0002b42bd0) of endpoint 1
zigbee2mqtt:info 11/4/2019, 12:27:34 PM MQTT publish: topic 'zigbee2mqtt/Bew_unten', payload '{"illuminance":44,"linkquality":31,"battery":100,"voltage":3035,"occupancy":false}'
zigbee2mqtt:debug 11/4/2019, 12:27:34 PM Received zigbee message of type 'devChange' with data '{"cid":"msIlluminanceMeasurement","data":{"measuredValue":44}}' of device 'lumi.sensor_motion.aq2' (0x00158d0002b42bd0) of endpoint 1

Any ideas? What can I additionaly provide? Does this debug output help to determine what the stick have received? I assume that the data item in the incoming message stores this information? Am I able to figure out how the software translate the data into the payload (if so, where I can find it)?

data 1 {"0":24,"1":47,"2":10,"3":0,"4":0,"5":33,"6":18,"7":0}
data 2 {"0":24,"1":24,"2":10,"3":0,"4":0,"5":33,"6":44,"7":0}
payload 1 {"illuminance":18,"linkquality":34,"occupancy":false,"battery":100,"voltage":3035}'
payload 2 {"illuminance":44,"linkquality":31,"battery":100,"voltage":3035,"occupancy":false}

Sincerly..

@Koenkk
Copy link
Owner

Koenkk commented Nov 5, 2019

In the log I see that only the illuminance level is reported and no occupancy, can you check again with the xiaomi hub if they work there?

@e-t-h
Copy link
Author

e-t-h commented Nov 5, 2019

I've just did it, and it works. I get the message "Motion detected, Illumination is: xx Lux.

Today I've observed the sensors and found messages with occupancy = true. Here a corresponding log:

zigbee-shepherd:af dispatchIncomingMsg(): type: zclIncomingMsg, msg: {"groupid":0,"clusterid":1024,"srcaddr":40372,"srcendpoint":1,"dstendpoint":1,"wasbroadcast":0,"linkquality":105,"securityuse":0,"timestamp":5300358,"transseqnumber":0,"len":8,"data":{"0":24,"1":11,"2":10,"3":0,"4":0,"5":33,"6":36,"7":0},"zclMsg":{"frameCntl":{"frameType":0,"manufSpec":0,"direction":1,"disDefaultRsp":1},"manufCode":0,"seqNum":11,"cmdId":"report","payload":[{"attrId":0,"dataType":33,"attrData":36}]}} +9ms
zigbee2mqtt:debug 11/4/2019, 10:13:34 PM Received zigbee message of type 'attReport' with data '{"cid":"msIlluminanceMeasurement","data":{"measuredValue":36}}' of device 'lumi.sensor_motion.aq2' (0x00158d0002b42bd0) of endpoint 1
zigbee2mqtt:info 11/4/2019, 10:13:34 PM MQTT publish: topic 'zigbee2mqtt/Bew_unten', payload '{"illuminance":36,"linkquality":105,"battery":100,"voltage":3035,"occupancy":true}'
zigbee2mqtt:debug 11/4/2019, 10:13:34 PM Received zigbee message of type 'devChange' with data '{"cid":"msIlluminanceMeasurement","data":{"measuredValue":36}}' of device 'lumi.sensor_motion.aq2' (0x00158d0002b42bd0) of endpoint 1
zigbee-shepherd:af dispatchIncomingMsg(): type: incomingMsg, msg: {"groupid":0,"clusterid":1030,"srcaddr":40372,"srcendpoint":1,"dstendpoint":1,"wasbroadcast":0,"linkquality":105,"securityuse":0,"timestamp":5300370,"transseqnumber":0,"len":7,"data":{"type":"Buffer","data":[24,12,10,0,0,24,1]}} +22ms

Where can you see that no occupancy is reported? For me it looks quite similar..

Thx

@Koenkk
Copy link
Owner

Koenkk commented Nov 6, 2019

If occupancy is reported you will find msOccupancySensing in the log, you should find it above the log you currently posted (otherwise occupancy won't be true).

@guardiande
Copy link

I just posted #2364.

I wanted to let you know that I once again was able to get the faulty sensor to work again. I re-paired it several times and suddenly it started working again.

Normally it works for a few weeks or months and then it starts failing again. The procedure to get it cooperate again is not exactly reproducible and simply restarting zigbee2mqtt can make it fail again.

@Sepultura22
Copy link

I have the same problem

@e-t-h
Copy link
Author

e-t-h commented Nov 20, 2019

Now we are three of us ;-)
In the meanwhile I've tested both of my sensors at the Xiaomi Hub with no errors. The sensors reports the illuminance from time to time and also every event of movement correctly. Next step in my case is to update the Zigbee2MQTT software to the newest version, reconnect the sensors to it and test again (with the knowledge of what guardiande wrote).
I'll be back ;-)

@Sepultura22
Copy link

I have the latest version of zigbee2mqtt@1.7.1 and the latest firmware in CC2531 (20190608), but the problem persists.

@Koenkk
Copy link
Owner

Koenkk commented Nov 21, 2019

To further debug this issue, could you sniff the traffic while the sensor should detect occupancy when connected with zigbee2mqtt (https://www.zigbee2mqtt.io/how_tos/how_to_sniff_zigbee_traffic.html)?

@e-t-h
Copy link
Author

e-t-h commented Nov 21, 2019

I suppose I need another CC2531? I will order one and come back with the results. It's gonna take some time.

@Koenkk
Copy link
Owner

Koenkk commented Nov 21, 2019

Yes you need another one

@Sepultura22
Copy link

I will wait patiently for e-t-h to do the test, because I don't have another dongle either. :)

@e-t-h
Copy link
Author

e-t-h commented Dec 16, 2019

Hi Koenkk,
I've got my second receiver, flashed it, installed Wireshark and ZBOSS on my Windows Laptop like described in your doc. I can start the system, the green LED is flashing. But I don't see any traffic although there is something.
I am not sure which Zigbee-page I have to select, I've tried all of them. Also the hex value after the page select box...
Are there known pitfalls?

@e-t-h
Copy link
Author

e-t-h commented Dec 16, 2019

Okay, thank you for your support, surprisingly it is now working! Please ignore the posting before ;-)

@e-t-h
Copy link
Author

e-t-h commented Dec 17, 2019

Hi Koenkk,
amusingly the sensors do now what I expect they have to do.
Did you change anything in the software?
I've done what you've suggested regarding the sniffing and additionally I've updated the zigbee2mqtt to the latest version 1.8.0. After that I've begun the tests. Everything works well with the motion sensors now. They report the status "occupancy=true" and after a time with no movement the status is set to "false".

Might be you've changed something? Or: I've been running the sensors together with the XIAOMI-hub meanwhile I've been waiting for the USB stick. Is it possible that an update of the firmware of the sensor have happened in this period?
I'll observe the behavior and will report here if something different happens.

Is there anything I can read to be able to understand the data packets I receive with my brand new sniffer what you can recommend? I would appreciate any advice.

By the way, is it possible to initiate a transmit of the illumination value by sending a request from the stick?

Last but not least: Thank you for your work!

Ekkehard

@guardiande
Copy link

Hi @e-t-h,

I'm afraid that you most likely experience the same symptoms in the future again. I'm having this problem for many months now and the problem normally persists only for a week or something and then the sensor stops working again.

Sometimes it happened right after just restarting z2m and I think it also happened during normal operation. Then it takes me many re-pairing to get it work again and then it works stable for some time.

It could be that the behaviour is more likely to happen if the sensor connects via a router but I'm not sure.

Jan

@e-t-h
Copy link
Author

e-t-h commented Dec 17, 2019

Hi Jan,
I am also not very convinced that the issue simply disappeared. Thats why I've asked for hints how to work with the sniffing tool. Unfortunately I'm not experienced with Zigbee messages.
I'll observe the behavior and when it'll changes I'll come back to this post. Currently I don't see much more opportunities. I'm waiting for the reply of Koenkk also.
Did you upgrade to 1.8.0? This update is only just two days old. If not it would be helpful if you can check if it includes the solution. I had the 1.6.0 running when the issue appeared.

Ekkehard

@Koenkk
Copy link
Owner

Koenkk commented Dec 17, 2019

Xiaomi devices can drop off the network when the linkquality is low, this can be improved: https://www.zigbee2mqtt.io/how_tos/how_to_improve_network_range.html

@guardiande
Copy link

Hi @Koenkk,

The sensors don't completely drop off the network since they're still reporting luminance and battery levels every hour our so (as you already saw from analyzing the logs a few posts above).

Jan

@Koenkk
Copy link
Owner

Koenkk commented Dec 17, 2019

@guardiande that's even more interesting. When this happens, could you sniff the zigbee traffic when you expect occupancy being detected? In this way we can determine if it's an issue of zigbee2mqtt or the sensor itself. https://www.zigbee2mqtt.io/how_tos/how_to_sniff_zigbee_traffic.html

@guardiande
Copy link

@Koenkk I just got myself a second CC2530 for that but (un-)fortunately it's working now. Will have to way for the next failure :)

@e-t-h
Copy link
Author

e-t-h commented Jan 21, 2020

Hi @e-t-h,

I'm afraid that you most likely experience the same symptoms in the future again. I'm having this problem for many months now and the problem normally persists only for a week or something and then the sensor stops working again.

Sometimes it happened right after just restarting z2m and I think it also happened during normal operation. Then it takes me many re-pairing to get it work again and then it works stable for some time.

It could be that the behaviour is more likely to happen if the sensor connects via a router but I'm not sure.

Jan

Hi Jan,
you are right, one of my sensors shows this behavior again, the other one works fine. After that happens I've updated zigbee2mqtt to 1.9.0 and removed the battery from the faulty sensor - without success. I do not use repeaters, the distance is maximum 5 meters. Link quality is reported by the sensors as 73 and 55. I'll sniff it in the next few days and report it here.
See you..

@kluszczyn
Copy link

kluszczyn commented Jan 21, 2020

I'm having the same issue. Some of Aqara PIRs working fine, others not reporting occupancy change (but reporting other parameters the same time, and when movement present in front of sensor). I sniffed traffic from that sensor (and it happened that during recording it reported once occupancy). As this was my first time with wireshark, can someone please advise how (and in what format) export data for sharing here (I would like to keep security key private)? If just share privately with @Koenkk , then I can send unfiltered recordings.

@essera
Copy link

essera commented Jan 24, 2020

Hi all,
i have the same issue too with my Aquara PIR´s. The description of kluszczyn is very similar to my issue.
6 PIR are working right but 2 sends never an occupancy true. When they discovered a movement they send an occupancy 'false' instead of 'true'. i was on Software level 1.8.0 and made an update to 1.9.0 but the behavoir did´nt changed.
I did an repairing an now they are working as expected.
But some is strange. When movement is detected the PIR send an occupancy 'false' and e very little time later it send an occupancy 'true'

Event Listing:
2020-01-24 17:45:05.125 MQTT2_DEVICE MQTT2_zigbee_akz illuminance: 7
2020-01-24 17:45:05.125 MQTT2_DEVICE MQTT2_zigbee_akz occupancy: false
2020-01-24 17:45:05.125 MQTT2_DEVICE MQTT2_zigbee_akz linkquality: 0
2020-01-24 17:45:05.125 MQTT2_DEVICE MQTT2_zigbee_akz battery: 86
2020-01-24 17:45:05.125 MQTT2_DEVICE MQTT2_zigbee_akz voltage: 2975
2020-01-24 17:45:05.186 MQTT2_DEVICE MQTT2_DVES_5BAB7D on
2020-01-24 17:45:05.196 DOIF MQTT2_zigbee_akz_DOIF_1 cmd_nr: 1
2020-01-24 17:45:05.196 DOIF MQTT2_zigbee_akz_DOIF_1 cmd: 1
2020-01-24 17:45:05.196 DOIF MQTT2_zigbee_akz_DOIF_1 cmd_event: MQTT2_zigbee_akz
2020-01-24 17:45:05.196 DOIF MQTT2_zigbee_akz_DOIF_1 cmd_1
2020-01-24 17:45:05.199 MQTT2_DEVICE MQTT2_zigbee_akz battery: 86
2020-01-24 17:45:05.199 MQTT2_DEVICE MQTT2_zigbee_akz voltage: 2975
2020-01-24 17:45:05.199 MQTT2_DEVICE MQTT2_zigbee_akz illuminance: 7
2020-01-24 17:45:05.199 MQTT2_DEVICE MQTT2_zigbee_akz occupancy: true
2020-01-24 17:45:05.199 MQTT2_DEVICE MQTT2_zigbee_akz linkquality: 0

Very strange.
Any idea´s ?

@e-t-h
Copy link
Author

e-t-h commented Jan 24, 2020

Hi essera,
what does repair mean exactly?

@essera
Copy link

essera commented Jan 24, 2020

Oh sorry - repair means i did an "repairing" with any device with the this issue. now there are working. I cannot say how long it takes til the device have the same issue again. But then i will post it here.

@mprice43
Copy link

I too am having similar issues with the RTCGQ11LM. Movement is triggering messages in the Zigbee2MQTT log but message shows occupancy=false. Also shows illuminance.

zigbee2mqtt:info 2020-02-11 19:40:32: MQTT publish: topic 'zigbee2mqtt/laundry_ceiling_light', payload '{"state":"OFF","brightness":255,"color_temp":250,"linkquality":107,"color":{"x":0.383,"y":0.382}}'
zigbee2mqtt:info 2020-02-11 19:40:36: MQTT publish: topic 'zigbee2mqtt/office_motion_sensor', payload '{"illuminance":9,"linkquality":105,"occupancy":true,"battery":100,"voltage":3045,"illuminance_lux":9}'
zigbee2mqtt:info 2020-02-11 19:40:36: MQTT publish: topic 'zigbee2mqtt/office_ceiling_light', payload '{"state":"ON","brightness":255,"color_temp":250,"linkquality":105,"color":{"x":0.383,"y":0.382}}'
zigbee2mqtt:info 2020-02-11 19:40:36: MQTT publish: topic 'zigbee2mqtt/office_ceiling_light', payload '{"state":"ON","brightness":255,"color_temp":250,"linkquality":105,"color":{"x":0.383,"y":0.382}}'
zigbee2mqtt:info 2020-02-11 19:40:36: MQTT publish: topic 'zigbee2mqtt/office_ceiling_light', payload '{"state":"ON","brightness":255,"color_temp":250,"linkquality":105,"color":{"x":0.383,"y":0.382}}'
zigbee2mqtt:info 2020-02-11 19:40:36: MQTT publish: topic 'zigbee2mqtt/office_ceiling_light', payload '{"state":"ON","brightness":255,"color_temp":250,"linkquality":105,"color":{"x":0.383,"y":0.382}}'
zigbee2mqtt:info 2020-02-11 19:40:36: MQTT publish: topic 'zigbee2mqtt/office_ceiling_light', payload '{"state":"ON","brightness":255,"color_temp":250,"linkquality":105,"color":{"x":0.383,"y":0.382}}'
zigbee2mqtt:info 2020-02-11 19:40:36: MQTT publish: topic 'zigbee2mqtt/office_ceiling_light', payload '{"state":"ON","brightness":255,"color_temp":250,"linkquality":105,"color":{"x":0.383,"y":0.382}}'
zigbee2mqtt:info 2020-02-11 19:40:36: MQTT publish: topic 'zigbee2mqtt/office_ceiling_light', payload '{"state":"ON","brightness":255,"color_temp":250,"linkquality":105,"color":{"x":0.383,"y":0.382}}'
zigbee2mqtt:info 2020-02-11 19:40:36: MQTT publish: topic 'zigbee2mqtt/office_ceiling_light', payload '{"state":"ON","brightness":255,"color_temp":250,"linkquality":105,"color":{"x":0.383,"y":0.382}}'
zigbee2mqtt:info 2020-02-11 19:40:36: MQTT publish: topic 'zigbee2mqtt/office_ceiling_light', payload '{"state":"ON","brightness":255,"color_temp":250,"linkquality":105,"color":{"x":0.383,"y":0.382}}'
zigbee2mqtt:info 2020-02-11 19:40:36: MQTT publish: topic 'zigbee2mqtt/office_ceiling_light', payload '{"state":"ON","brightness":255,"color_temp":250,"linkquality":105,"color":{"x":0.383,"y":0.382}}'
zigbee2mqtt:info 2020-02-11 19:40:36: MQTT publish: topic 'zigbee2mqtt/office_ceiling_light', payload '{"state":"ON","brightness":255,"color_temp":250,"linkquality":107,"color":{"x":0.383,"y":0.382}}'
zigbee2mqtt:info 2020-02-11 19:40:36: MQTT publish: topic 'zigbee2mqtt/office_ceiling_light', payload '{"state":"ON","brightness":255,"color_temp":250,"linkquality":107,"color":{"x":0.383,"y":0.382}}'
zigbee2mqtt:info 2020-02-11 19:40:36: MQTT publish: topic 'zigbee2mqtt/office_ceiling_light', payload '{"state":"ON","brightness":255,"color_temp":250,"linkquality":107,"color":{"x":0.383,"y":0.382}}'
zigbee2mqtt:info 2020-02-11 19:40:36: MQTT publish: topic 'zigbee2mqtt/office_ceiling_light', payload '{"state":"ON","brightness":255,"color_temp":250,"linkquality":107,"color":{"x":0.383,"y":0.382}}'
zigbee2mqtt:info 2020-02-11 19:40:36: MQTT publish: topic 'zigbee2mqtt/office_ceiling_light', payload '{"state":"ON","brightness":255,"color_temp":250,"linkquality":105,"color":{"x":0.383,"y":0.382}}'
zigbee2mqtt:info 2020-02-11 19:40:36: MQTT publish: topic 'zigbee2mqtt/office_ceiling_light', payload '{"state":"ON","brightness":255,"color_temp":250,"linkquality":105,"color":{"x":0.383,"y":0.382}}'
zigbee2mqtt:info 2020-02-11 19:40:36: MQTT publish: topic 'zigbee2mqtt/office_ceiling_light', payload '{"state":"ON","brightness":255,"color_temp":250,"linkquality":105,"color":{"x":0.383,"y":0.382}}'
zigbee2mqtt:info 2020-02-11 19:40:36: MQTT publish: topic 'zigbee2mqtt/office_ceiling_light', payload '{"state":"ON","brightness":255,"color_temp":250,"linkquality":107,"color":{"x":0.383,"y":0.382}}'
zigbee2mqtt:info 2020-02-11 19:40:39: MQTT publish: topic 'zigbee2mqtt/lounge_rm_lamps_pwr_plug', payload '{"state":"OFF","power":0,"voltage":null,"consumption":84.48,"temperature":31,"linkquality":105}'
zigbee2mqtt:info 2020-02-11 19:41:36: MQTT publish: topic 'zigbee2mqtt/office_motion_sensor', payload '{"illuminance":9,"linkquality":105,"occupancy":false,"battery":100,"voltage":3045,"illuminance_lux":9}'
zigbee2mqtt:info 2020-02-11 19:41:37: MQTT publish: topic 'zigbee2mqtt/office_ceiling_light', payload '{"state":"ON","brightness":255,"color_temp":250,"linkquality":105,"color":{"x":0.383,"y":0.382}}'
zigbee2mqtt:info 2020-02-11 19:43:06: MQTT publish: topic 'zigbee2mqtt/office_ceiling_light', payload '{"state":"OFF","brightness":255,"color_temp":250,"linkquality":105,"color":{"x":0.383,"y":0.382}}'
zigbee2mqtt:info 2020-02-11 19:43:06: MQTT publish: topic 'zigbee2mqtt/office_ceiling_light', payload '{"state":"OFF","brightness":255,"color_temp":250,"linkquality":105,"color":{"x":0.383,"y":0.382}}'
zigbee2mqtt:info 2020-02-11 19:43:07: MQTT publish: topic 'zigbee2mqtt/office_ceiling_light', payload '{"state":"OFF","brightness":255,"color_temp":250,"linkquality":105,"color":{"x":0.383,"y":0.382}}'
zigbee2mqtt:info 2020-02-11 19:43:07: MQTT publish: topic 'zigbee2mqtt/office_ceiling_light', payload '{"state":"OFF","brightness":255,"color_temp":250,"linkquality":105,"color":{"x":0.383,"y":0.382}}'
zigbee2mqtt:info 2020-02-11 19:43:10: MQTT publish: topic 'zigbee2mqtt/office_motion_sensor', payload '{"illuminance":0,"linkquality":105,"occupancy":false,"battery":100,"voltage":3045,"illuminance_lux":0}'
zigbee2mqtt:info 2020-02-11 19:44:28: MQTT publish: topic 'zigbee2mqtt/office_motion_sensor', payload '{"illuminance":0,"linkquality":102,"occupancy":false,"battery":100,"voltage":3045,"illuminance_lux":0}'

The first time the sensor is triggering correctly and reporting occupancy = true.
1 minute later is then reports occupancy = false which is expected as the timeout is set to 60 seconds in devices.yaml. The 3rd and 4th message contain occupance=false despite obviously detecting
my movement. The sensor / or the zigbee2mqtt interpretation of the message seems to be haphazard, reporting false more times than true to a detection of motion.
Has anyone done a network trace (sniff) yet or do I need to buy and second C2531 board to do this?

@phplego
Copy link

phplego commented Feb 15, 2020

I have the same issue for ~1 year. Somtimes RTCGQ11LM sensors stop to send occupancy: true and instead of that send occupancy: false. Repairing fixes the issue for some time (days or even weeks).

I tried to narrow the scope by doing these experiments:

  • Change the disstance to the sensor. It does not have affect. No meter is it close to router as 50 cm or 10 meters.
  • Change the version of zigbee2mqtt to 1.6.0, 1.8.0 and 1.9.0. Same issue appears on any of them in some time.
  • Change the sensors, bought new ones. It did not help.

Very often the issue disappears just by itself, without repairing. So reproduce the issue isn't an easy task.

Thanks

@hdo
Copy link

hdo commented Feb 17, 2020

I noticed the same behaviour with one of my PIR sensors (5 in total).
However additional to the missing occupancy message i'm also missing the correct illuminance value. I always got illuminance 0 (this happens with 3 of my sensors):

zigbee2mqtt:info 2020-02-17 06:09:21: MQTT publish: topic 'zigbee2mqtt/0x00158d0001e50d78', payload '{"battery":100,"voltage":3175,"illuminance":0,"linkquality":18,"occupancy":false,"illuminance_lux":0}' zigbee2mqtt:info 2020-02-17 06:10:56: MQTT publish: topic 'zigbee2mqtt/0x00158d0001e50d78', payload '{"battery":100,"voltage":3175,"illuminance":0,"linkquality":12,"occupancy":false,"illuminance_lux":0}' zigbee2mqtt:info 2020-02-17 06:12:14: MQTT publish: topic 'zigbee2mqtt/0x00158d0001e50d78', payload '{"battery":100,"voltage":3175,"illuminance":0,"linkquality":0,"occupancy":false,"illuminance_lux":0}' zigbee2mqtt:info 2020-02-17 06:13:42: MQTT publish: topic 'zigbee2mqtt/0x00158d0001e50d78', payload '{"battery":100,"voltage":3175,"illuminance":0,"linkquality":0,"occupancy":false,"illuminance_lux":0}' zigbee2mqtt:info 2020-02-17 06:15:19: MQTT publish: topic 'zigbee2mqtt/0x00158d0001e50d78', payload '{"battery":100,"voltage":3175,"illuminance":0,"linkquality":0,"occupancy":false,"illuminance_lux":0}' zigbee2mqtt:info 2020-02-17 06:19:08: MQTT publish: topic 'zigbee2mqtt/0x00158d0001e50d78', payload '{"battery":100,"voltage":3175,"illuminance":0,"linkquality":6,"occupancy":false,"illuminance_lux":0}' zigbee2mqtt:info 2020-02-17 06:24:37: MQTT publish: topic 'zigbee2mqtt/0x00158d0001e50d78', payload '{"battery":100,"voltage":3175,"illuminance":0,"linkquality":0,"occupancy":false,"illuminance_lux":0}' zigbee2mqtt:info 2020-02-17 06:26:00: MQTT publish: topic 'zigbee2mqtt/0x00158d0001e50d78', payload '{"battery":100,"voltage":3175,"illuminance":0,"linkquality":0,"occupancy":false,"illuminance_lux":0}' zigbee2mqtt:info 2020-02-17 06:27:00: MQTT publish: topic 'zigbee2mqtt/0x00158d0001e50d78', payload '{"battery":100,"voltage":3175,"illuminance":0,"linkquality":15,"occupancy":false,"illuminance_lux":0}' zigbee2mqtt:info 2020-02-17 06:30:30: MQTT publish: topic 'zigbee2mqtt/0x00158d0001e50d78', payload '{"battery":100,"voltage":3175,"illuminance":0,"linkquality":0,"occupancy":false,"illuminance_lux":0}' zigbee2mqtt:info 2020-02-17 06:37:45: MQTT publish: topic 'zigbee2mqtt/0x00158d0001e50d78', payload '{"battery":100,"voltage":3175,"illuminance":0,"linkquality":0,"occupancy":false,"illuminance_lux":0}' zigbee2mqtt:info 2020-02-17 06:38:47: MQTT publish: topic 'zigbee2mqtt/0x00158d0001e50d78', payload '{"battery":100,"voltage":3175,"illuminance":0,"linkquality":15,"occupancy":false,"illuminance_lux":0}' zigbee2mqtt:info 2020-02-17 06:39:59: MQTT publish: topic 'zigbee2mqtt/0x00158d0001e50d78', payload '{"battery":100,"voltage":3175,"illuminance":0,"linkquality":15,"occupancy":false,"illuminance_lux":0}' zigbee2mqtt:info 2020-02-17 06:42:08: MQTT publish: topic 'zigbee2mqtt/0x00158d0001e50d78', payload '{"battery":100,"voltage":3175,"illuminance":0,"linkquality":0,"occupancy":false,"illuminance_lux":0}' zigbee2mqtt:info 2020-02-17 06:44:10: MQTT publish: topic 'zigbee2mqtt/0x00158d0001e50d78', payload '{"battery":100,"voltage":3175,"illuminance":0,"linkquality":42,"occupancy":false,"illuminance_lux":0}' zigbee2mqtt:info 2020-02-17 06:45:15: MQTT publish: topic 'zigbee2mqtt/0x00158d0001e50d78', payload '{"battery":100,"voltage":3175,"illuminance":0,"linkquality":0,"occupancy":false,"illuminance_lux":0}' zigbee2mqtt:info 2020-02-17 06:47:28: MQTT publish: topic 'zigbee2mqtt/0x00158d0001e50d78', payload '{"battery":100,"voltage":3175,"illuminance":0,"linkquality":72,"occupancy":false,"illuminance_lux":0}' zigbee2mqtt:info 2020-02-17 06:48:35: MQTT publish: topic 'zigbee2mqtt/0x00158d0001e50d78', payload '{"battery":100,"voltage":3175,"illuminance":0,"linkquality":72,"occupancy":false,"illuminance_lux":0}' zigbee2mqtt:info 2020-02-17 06:49:36: MQTT publish: topic 'zigbee2mqtt/0x00158d0001e50d78', payload '{"battery":100,"voltage":3175,"illuminance":0,"linkquality":0,"occupancy":false,"illuminance_lux":0}' zigbee2mqtt:info 2020-02-17 06:52:42: MQTT publish: topic 'zigbee2mqtt/0x00158d0001e50d78', payload '{"battery":100,"voltage":3175,"illuminance":0,"linkquality":72,"occupancy":false,"illuminance_lux":0}' zigbee2mqtt:info 2020-02-17 07:15:51: MQTT publish: topic 'zigbee2mqtt/0x00158d0001e50d78', payload '{"battery":100,"voltage":3175,"illuminance":0,"linkquality":78,"occupancy":false,"illuminance_lux":0}' zigbee2mqtt:info 2020-02-17 07:19:50: MQTT publish: topic 'zigbee2mqtt/0x00158d0001e50d78', payload '{"battery":100,"voltage":3175,"illuminance":0,"linkquality":9,"occupancy":false,"illuminance_lux":0}' zigbee2mqtt:info 2020-02-17 07:21:52: MQTT publish: topic 'zigbee2mqtt/0x00158d0001e50d78', payload '{"battery":100,"voltage":3175,"illuminance":0,"linkquality":18,"occupancy":false,"illuminance_lux":0}' zigbee2mqtt:info 2020-02-17 07:25:57: MQTT publish: topic 'zigbee2mqtt/0x00158d0001e50d78', payload '{"battery":100,"voltage":3175,"illuminance":0,"linkquality":3,"occupancy":false,"illuminance_lux":0}' zigbee2mqtt:info 2020-02-17 07:28:22: MQTT publish: topic 'zigbee2mqtt/0x00158d0001e50d78', payload '{"battery":100,"voltage":3175,"illuminance":0,"linkquality":12,"occupancy":false,"illuminance_lux":0}' zigbee2mqtt:info 2020-02-17 07:30:07: MQTT publish: topic 'zigbee2mqtt/0x00158d0001e50d78', payload '{"battery":100,"voltage":3175,"illuminance":0,"linkquality":21,"occupancy":false,"illuminance_lux":0}' zigbee2mqtt:info 2020-02-17 07:33:14: MQTT publish: topic 'zigbee2mqtt/0x00158d0001e50d78', payload '{"battery":100,"voltage":3175,"illuminance":0,"linkquality":0,"occupancy":false,"illuminance_lux":0}' zigbee2mqtt:info 2020-02-17 07:34:40: MQTT publish: topic 'zigbee2mqtt/0x00158d0001e50d78', payload '{"battery":100,"voltage":3175,"illuminance":0,"linkquality":0,"occupancy":false,"illuminance_lux":0}' zigbee2mqtt:info 2020-02-17 07:36:17: MQTT publish: topic 'zigbee2mqtt/0x00158d0001e50d78', payload '{"battery":100,"voltage":3175,"illuminance":0,"linkquality":0,"occupancy":false,"illuminance_lux":0}' zigbee2mqtt:info 2020-02-17 07:39:19: MQTT publish: topic 'zigbee2mqtt/0x00158d0001e50d78', payload '{"battery":100,"voltage":3175,"illuminance":0,"linkquality":0,"occupancy":false,"illuminance_lux":0}' zigbee2mqtt:info 2020-02-17 07:41:31: MQTT publish: topic 'zigbee2mqtt/0x00158d0001e50d78', payload '{"battery":100,"voltage":3175,"illuminance":0,"linkquality":51,"occupancy":false,"illuminance_lux":0}' zigbee2mqtt:info 2020-02-17 07:44:26: MQTT publish: topic 'zigbee2mqtt/0x00158d0001e50d78', payload '{"battery":100,"voltage":3175,"illuminance":0,"linkquality":6,"occupancy":false,"illuminance_lux":0}' zigbee2mqtt:info 2020-02-17 07:45:26: MQTT publish: topic 'zigbee2mqtt/0x00158d0001e50d78', payload '{"battery":100,"voltage":3175,"illuminance":0,"linkquality":0,"occupancy":false,"illuminance_lux":0}' zigbee2mqtt:info 2020-02-17 07:46:43: MQTT publish: topic 'zigbee2mqtt/0x00158d0001e50d78', payload '{"battery":100,"voltage":3175,"illuminance":0,"linkquality":9,"occupancy":false,"illuminance_lux":0}' zigbee2mqtt:info 2020-02-17 07:49:52: MQTT publish: topic 'zigbee2mqtt/0x00158d0001e50d78', payload '{"battery":100,"voltage":3175,"illuminance":0,"linkquality":0,"occupancy":false,"illuminance_lux":0}' zigbee2mqtt:info 2020-02-17 07:51:36: MQTT publish: topic 'zigbee2mqtt/0x00158d0001e50d78', payload '{"battery":100,"voltage":3175,"illuminance":0,"linkquality":3,"occupancy":false,"illuminance_lux":0}' zigbee2mqtt:info 2020-02-17 07:52:38: MQTT publish: topic 'zigbee2mqtt/0x00158d0001e50d78', payload '{"battery":100,"voltage":3175,"illuminance":0,"linkquality":0,"occupancy":false,"illuminance_lux":0}' zigbee2mqtt:info 2020-02-17 07:56:33: MQTT publish: topic 'zigbee2mqtt/0x00158d0001e50d78', payload '{"battery":100,"voltage":3175,"illuminance":0,"linkquality":6,"occupancy":false,"illuminance_lux":0}' zigbee2mqtt:info 2020-02-17 07:58:26: MQTT publish: topic 'zigbee2mqtt/0x00158d0001e50d78', payload '{"battery":100,"voltage":3175,"illuminance":0,"linkquality":0,"occupancy":false,"illuminance_lux":0}' zigbee2mqtt:info 2020-02-17 08:15:01: MQTT publish: topic 'zigbee2mqtt/0x00158d0001e50d78', payload '{"battery":100,"voltage":3175,"illuminance":0,"linkquality":9,"occupancy":false,"illuminance_lux":0}' zigbee2mqtt:info 2020-02-17 08:15:01: MQTT publish: topic 'zigbee2mqtt/0x00158d0001e50d78', payload '{"battery":100,"voltage":3175,"illuminance":3,"linkquality":9,"occupancy":false,"illuminance_lux":3}' zigbee2mqtt:info 2020-02-17 08:16:46: MQTT publish: topic 'zigbee2mqtt/0x00158d0001e50d78', payload '{"battery":100,"voltage":3175,"illuminance":0,"linkquality":12,"occupancy":false,"illuminance_lux":0}'

@essera
Copy link

essera commented Feb 17, 2020

Hi all,

i promised in my last post to give you an update if the issue happens again - it happens again :-(

It happend to my test PIR on my desk and one in my cellar.

Meanwhile i tried the same Things to get the PIR back to work.

  1. PIR is not working so i tried
  • Reinstalling the Batterie - doesn´t work
  • install a new Batterie - doesn´t work
  • Rebooting zigbee2mqtt - doesn´t work
  • updating from earlier Version of zigbee2mqtt - doesn´t work
  • RePairing the PIR works for a while -

One PIR stops working only one time - after ReParing , he is working since 5 weeks.
One PIR works after rePairing only a few day´s , after a while he started working with no action from my side.
In the time he was not working he Shows occupany: false and illuminance 0 (same as hdo postet).

i was on Holiday for a week and in that time all PIR´s worked OK, now.

@Koenkk
do you have any idea´s what we can do to solve the issue or help you to fix it ?

@freakshock88
Copy link
Contributor

I bit the bullet and used an old CC2531 device as a second coordinator, running in a second zigbee2mqtt docker instance. I put only my Aqara motion sensors in the second zigbee network. Now indeed the device updates are not failing anymore :)

@milaq
Copy link

milaq commented Sep 14, 2020

Having the same issue with the Xiaomi RTCGQ11LM devices.
As soon as the traffic gets routed through another device to the coordinator, the state does not get reported.

(Re)pairing close to the coordinator fixes the issue for 2-3 days until the network gets rearranged.
@Koenkk is there a way we can somehow prevent network rearrangement as a workaround until a proper fix is found?

@Koenkk
Copy link
Owner

Koenkk commented Sep 14, 2020

@milaq unfortunately not, we have no control over what parents will be used by the devices. Note that we cannot fix this issue from Zigbee2MQTT, it's an issue in the firmware of the routers.

@wzbfyb
Copy link

wzbfyb commented Sep 14, 2020 via email

@Koenkk
Copy link
Owner

Koenkk commented Sep 14, 2020

Reading this issue, lot of people experience it with OSRAM devices.

@mr2c12
Copy link

mr2c12 commented Sep 14, 2020 via email

@milaq
Copy link

milaq commented Sep 14, 2020

@milaq unfortunately not, we have no control over what parents will be used by the devices. Note that we cannot fix this issue from Zigbee2MQTT, it's an issue in the firmware of the routers.

Thanks for the swift response!
Well, that's unfortunate. Guess the workaround would be new hardware then; I'll test the Xiaomi smart plugs and report back here in this thread.

Maybe this could be worth a wiki update?
At least for the AB3257001NJ I can confirm the issue (https://www.zigbee2mqtt.io/devices/AB3257001NJ.html).

Do we know which routers are affected? With my Innr bulbs it works fine for example.

At least routing via my "Osram Smart +" plugs (AB3257001NJ) didnt't work; no occupancy updates.
Further up there were a few users with Innr plugs with the same issue.

I ordered these Xiaomi plugs (https://www.amazon.de/dp/B083F91ZX3/) and will test them in the exact same constellation as parent for the RTCGQ11LM.

@mr2c12
Copy link

mr2c12 commented Sep 14, 2020 via email

@wzbfyb
Copy link

wzbfyb commented Sep 14, 2020 via email

@milaq
Copy link

milaq commented Sep 17, 2020

I ordered these Xiaomi plugs (https://www.amazon.de/dp/B083F91ZX3/) and will test them in the exact same constellation as parent for the RTCGQ11LM.

Today the Xiaomi plugs arrived.
I tested them in the exact same constellation as with the Osram plugs before and they are indeed able to route all attributes correctly, including occupancy.

They cost ~7€ more than the Osram plugs but the build quality is way better and they also pass power as well as circuit temperature measurements. The relay is also quieter when switching.

To sum things up: After short testing, the 'Xiaomi Mi Smart Plugs' (ZNCZ04LM) plugs are the better and fully working alternative to the Osram Smart+ plugs.

@Koenkk
Copy link
Owner

Koenkk commented Sep 25, 2020

Since this issue cannot be solved from Zigbee2MQTT I will close this. I've updated the docs: https://www.zigbee2mqtt.io/devices/RTCGQ11LM.html#troubleshooting-no-occupancy-only-illuminance-is-published

@Koenkk Koenkk closed this as completed Sep 25, 2020
@dirkve
Copy link

dirkve commented Sep 25, 2020 via email

@Koenkk
Copy link
Owner

Koenkk commented Dec 17, 2020

@AlexxIT found a possible fix for this issue. It seems that the illuminance is only send through the msIlluminanceMeasurement cluster on occupancy (and every hour through the genBasic cluster). Now occupancy: true will be send when illuminance is send through the msIlluminanceMeasurement cluster.

Changes will be available in the latest dev branch in a few hours (https://www.zigbee2mqtt.io/how_tos/how-to-switch-to-dev-branch.html)

@freakshock88
Copy link
Contributor

This is great news! Did anyone do some testing yet on the dev branch?
Would love to go back to a single zigbee network instead of separate ones again :)
Will try to test when I have time.

@mr2c12
Copy link

mr2c12 commented Dec 19, 2020 via email

@AlexxIT
Copy link

AlexxIT commented Dec 19, 2020

You need to know, this fix helps if only one message from sensor missed. Motion or illumination. It won't help if both messages will be missed for some reason.

@freakshock88
Copy link
Contributor

I have tested the new dev branch for about a week now, and this issue seems totally solved :) Super happy. Thanks to @AlexxIT !

@bongiozzo
Copy link

@AlexxIT found a possible fix for this issue. It seems that the illuminance is only send through the msIlluminanceMeasurement cluster on occupancy (and every hour through the genBasic cluster). Now occupancy: true will be send when illuminance is send through the msIlluminanceMeasurement cluster.

Changes will be available in the latest dev branch in a few hours (https://www.zigbee2mqtt.io/how_tos/how-to-switch-to-dev-branch.html)

Thank you!
When do you plan to move this fix to master branch? )

@Koenkk
Copy link
Owner

Koenkk commented Jan 1, 2021

@bongiozzo today (zigbee2mqtt 1.17.0)

@karolzlot
Copy link

Do I understand correctly, that this information can be safely removed from documentation for all previously affected devices?

Caveats #
Does not pass every attribute when acting as the routing parent for some end devices. E.g. occupancy is gobbled when routing Xiaomi RTCGQ11LM traffic resulting in motion updates not getting propagated to the network.

See also #2274.

Koenkk added a commit to Koenkk/zigbee2mqtt.io that referenced this issue May 31, 2021
@Koenkk
Copy link
Owner

Koenkk commented May 31, 2021

@qqgg231 this device does still not route all messages correctly, however for the no occupancy for the Xiaomi RTCGQ11LM a workaround has been found. Updates the docs accordingly (will be updated tomorrow)

@Nephiel
Copy link

Nephiel commented Sep 6, 2022

If I understand this right, just by having these on a Zigbee network, you run the risk of missing some messages that may be routed through them.

If so, would it be possible to work around this issue by disabling routing on these specific devices? Making them work only as end devices and not routers?

This way, they could still be used as smart plugs, while other (well-behaved) routers in the network do the routing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests