zigbee2mqtt icon indicating copy to clipboard operation
zigbee2mqtt copied to clipboard

Large delay (minutes) xiaomi door sensors (MCCGQ11LM)

Open jeroenvdpoll opened this issue 5 years ago • 12 comments

Background

Hello,

  • I use several xiaomi sensors in combination with zigbee2mqt (and home assistant) for over a year with no issues.
  • Suddenly (cannot find a reason, like an update or something) my door sensors (total 4) respond really slow (around 5 minutes respond time).
  • All other (xiaomi) zigbee2mqtt devices do work normally (motion sensors, buttons, smoke sensors).
  • After around 5 minutes the states do change.
  • Rebooting system, rejoining devices, joining a fresh out of the box door sensor all didn't help
  • Looks related to only the door sensors

I really have no clue where to look or what to do. Rejoining the door sensors didn't do anything.

Can anybody help?

Regards, Jeroen

What happened

When I open or close a door I cannot see any state change in:

  1. MQTT
  2. Zigbee2mqtt web dashboard
  3. Home Assistant

After around 3 - 6 minutes the states do change

What did you expect to happen

See state changes immediately instead of minutes

How to reproduce it (minimal and precise)

See above.

Debug info

Zigbee2MQTT version: 1.18.1-1 Adapter hardware: CC2652R Adapter firmware version: unsure

jeroenvdpoll avatar Oct 09 '21 11:10 jeroenvdpoll

Sounds like https://github.com/Koenkk/zigbee2mqtt/issues/8663

Koenkk avatar Oct 09 '21 13:10 Koenkk

Sounds like #8663

Hi Koen, I did check the kernel: I have kernel 5.4.0-87-generic so that shouldn't be affected. Also doesn't explain why it is only happening to the doorsensors and the issue popped up without any updated on the underlying (ubuntu) OS.

Any other idea's what to check?

jeroenvdpoll avatar Oct 09 '21 14:10 jeroenvdpoll

5.4.0-87 is affected:

Ubuntu Focal: 5.4.0-85 and greater (not fixed yet as of 5.4.0-89)

Koenkk avatar Oct 09 '21 15:10 Koenkk

Is it just a matter of waiting for this to be fixed in the kernel, or can I do something about it myself?

Soildk avatar Oct 10 '21 19:10 Soildk

You can switch to a different CH341 driver: https://github.com/Koenkk/zigbee2mqtt/issues/8663#issuecomment-929584953 (which is what I did in my production setup)

Koenkk avatar Oct 10 '21 19:10 Koenkk

Thanks.. I tried to follow the guide on https://github.com/daverobertson63/CH341SER, but I'm failing on several steps with my Ubuntu server. I'm a complete Linux noob, so I don't have any idea what to do.

Soildk avatar Oct 10 '21 19:10 Soildk

Sounds like #8663

Hi Koen, I did check the kernel: I have kernel 5.4.0-87-generic so that shouldn't be affected. Also doesn't explain why it is only happening to the doorsensors and the issue popped up without any updated on the underlying (ubuntu) OS.

Any other idea's what to check?

I am in the same boat as you @jeroenvdpoll I am running Ubuntu 20.04.3 LTS with the kernel 5.4.0-88-generic. All my xiaomi devices are slow in responding to z2m.

I tried updating the CH431 driver per @Koenkk's recommendation but it is not straightforward. I also tried to update my kernel to version which is not affected but I cannot as there is no clear guidance on how to do it.

Its really frustrating as I am thinking of reinstalling everything from scratch.

bachoo786 avatar Oct 15 '21 11:10 bachoo786

I will close this, it's not something that is caused by z2m and the issue + workaround has already been covered in https://github.com/Koenkk/zigbee2mqtt/issues/8663 . @daverobertson63 could you maybe make some tutorial on how to use your drivers?

Koenkk avatar Oct 15 '21 14:10 Koenkk

@Koenkk So I did an update tutorial on the README on my driver version - I dont know if I can do much more - Google is our friend in most cases :)

https://github.com/daverobertson63/CH341SER#installation--tutorial

daverobertson63 avatar Oct 16 '21 10:10 daverobertson63

My issue is solved. Just by migrating to hassos.

Thanks! @daverobertson63: I'm not sure that we had the same issue. Only my Xiaomi doorsensors were affected. Other Xiaomi stuff did perform normal.

A solution for you can be to migrate to HASSOS. This migration is in fact quite easy. Theoretically it can be done in 30 minutes or even faster (now I can). But my first attempt took around 3 hours (dowloading live cd ubuntu, undust a spare computer, burn SSD, build in to target server, startup, restore backup, understand that you need the same ip adress, etc..)

If you want to still use your underlying own os, than you can migrate to hassos on a spare computer, reinstall the other one and migrate back.

Good luck.

jeroenvdpoll avatar Oct 16 '21 11:10 jeroenvdpoll

@jeroenvdpoll - I need to use remote RPIs with just zigbee2mqtt driving the sensors and updating a cloudmqtt service - so my set up is just to use the native system - I also need some other things on it - and hassos - which is very good - makes it more complicated to do that - but your suggestion is totally sound and gets the job done for sure. Thanks for highlighting it.

daverobertson63 avatar Oct 16 '21 11:10 daverobertson63

@daverobertson63. I realize that my comment was directed to @bachoo786 and not you. Mistake from my side.

jeroenvdpoll avatar Oct 16 '21 11:10 jeroenvdpoll