Xiaomi Wall switches are turning off randomly (QBKG03LM)
I have quite a big network with a CC2530 coordinator, 4 routers (both CC2530 and CC2531), 17 QBKG03LM switches, 11 contact sensors (both MCCGQ01LM and MCCGQ11LM) and 11 temperature sensors (both WSDCGQ01LM and WSDCGQ11LM).
Some of my QBKG03LM wall switches are turning off randomly any time and turning off randomly when pairing a new device.
Do you have any idea what goes wrong? I'm really interested in the random turn offs but curious about the reason of turn offs by pairing new devices.
Thanks
Could you provide the log when this automatically turning off happens?
related to #808 ? i'm still not running v1 or dev, can't reproduce
0x00158d0001660cb2 (the right one because it was turned on but I'm sure both are turning off) got turned off without any interaction. log.txt
I'm on master and running not the latest but the previous version (released in august) of Z-Stack on my coordinator and on my routers as well.
I too have the same problem with my QBKG03LM wall switch which I only installed two days ago. It seems to turn off after being on for a little while as seen in the logs below: On:
Jan 08 18:07:56 zigbeepi npm[21192]: zigbee2mqtt:info 2019-1-8 18:07:56 MQTT publish: topic 'zigbee2mqtt/xiaomi_wallswitch_study', payload '{"state_left":"OFF","linkquality":49,"state_right":"OFF"}'
Off: Jan 08 18:31:40 zigbeepi npm[21192]: zigbee2mqtt:info 2019-1-8 18:31:40 MQTT publish: topic 'zigbee2mqtt/xiaomi_wallswitch_study', payload '{"state_left":"OFF","linkquality":36,"state_right":"OFF"}' Jan 08 18:31:40 zigbeepi npm[21192]: zigbee2mqtt:info 2019-1-8 18:31:40 MQTT publish: topic 'zigbee2mqtt/xiaomi_wallswitch_study', payload '{"state_left":"OFF","linkquality":34,"state_right":"OFF"}'
I'm running the following versions:
Jan 08 18:46:26 zigbeepi npm[23097]: > [email protected] start /opt/zigbee2mqtt
Jan 08 18:46:26 zigbeepi npm[23097]: > node index.js
Jan 08 18:46:27 zigbeepi npm[23097]: zigbee2mqtt:info 2019-1-8 18:46:27 Logging to directory: '/opt/zigbee2mqtt/data/log/2019-01-08.18-46-27'
Jan 08 18:46:28 zigbeepi npm[23097]: zigbee2mqtt:info 2019-1-8 18:46:28 Starting zigbee2mqtt version 1.0.1 (commit #9380bbc)
Jan 08 18:46:28 zigbeepi npm[23097]: zigbee2mqtt:info 2019-1-8 18:46:28 Starting zigbee-shepherd
Jan 08 18:46:29 zigbeepi npm[23097]: zigbee2mqtt:info 2019-1-8 18:46:29 zigbee-shepherd started
Jan 08 18:46:29 zigbeepi npm[23097]: zigbee2mqtt:info 2019-1-8 18:46:29 Coordinator firmware version: '20181024'
I've enabled debug to capture the logs when it next auto turns off.
@Koenkk - here are my debug logs, hope they help:
Zigbee2mqtt debug: https://hastebin.com/oqozoniduk.sql
zigbee-shepherd logs: https://hastebin.com/nimaribuji.sql
Thanks.
Interesting update - I left zigbee2mqtt disabled to see if the light still turned off, and it did!
So, it's turning off without any interaction from zigbee2mqtt - does it need some sort of keep alive msg?
I do have a Xiaomi Gateway so I'm willing to pair it with that for a while to see if the same thing occurs?
I had my QBKG03LMs paired with Xiaomi Gateway for months but I haven't experienced this random turn offs ever. Having keep alive messages is a good idea, but won't answer the fact that unexpected turn offs can happen when pairing a new sensor (based on my experiences)... Note on the pairing turn offs: it is usually happens with a QBKG03LM close to the new sensor - I think in this case the new sensor trys to connect to a router/coordinator which is having a connection to the crazy wall switch.
@jarrah31 Could you please detail your mesh network? What kind of devices do you have?
Sure:
15 x MCCGQ11LM - Xiaomi Aqara door & window contact sensor (EndDevice) 2 x WXKG11LM - Xiaomi Aqara wireless switch (EndDevice) 1 x RTCGQ01LM - Xiaomi MiJia human body movement sensor (EndDevice) 1 x WSDCGQ11LM - Xiaomi Aqara temperature, humidity and pressure sensor (EndDevice) 1 x WXKG01LM - Xiaomi MiJia wireless switch (EndDevice) 1 x WSDCGQ11LM - Xiaomi Aqara temperature, humidity and pressure sensor (EndDevice) 1 x QBKG03LM - Xiaomi Aqara double key wired wall switch (Router) 1 x CC2530.ROUTER - Custom devices (DiY) CC2530 router (Router)
I probably have an equal number of devices connected via the Xiaomi Gateway as well.
I've the same issue, but I thought it was because I've several CC routers... subscribing to this topic.
Can the issue be caused by something like a hotspotting effect on a particular router? I mean most of the devices are connecting to the same router because the linq quality is the best there meanwhile there are free "slots" on other routers with lower link quality - so the busy router just dropping an active connection for the newcomer (and the wall switch is turning of when connection dropped)
@Koenkk what do you think about the hotspotting effect (I'm not sure it is the best word but described above)?
After how much time does this occur? I have a QBKG04LM (which I do not use) which I can use to debug this issue.
It's tricky. My experience is: they work well for a while until one of the wall switch starting to turn of by pairing a new sensor (exactly at the time when pairing happens). After it has started the random turnoffs, it can happen any time - I was unable to identify any pattern.
In my experience, its random, as @pkedvessy said.
I've several zigbee2mqtt (one per floor in a house, all independent), each one with their own devices paired. I've a Xiaomi wall switch (No neutral) dual gang in my Living room, and when I turn it on, sometimes after a few minutes, sometimes after a couple of hours, the light go off and I need to turn it on again (and it works from HomeAssistant).
The nearest zigbee2mqtt is quite near (around 3meters), but I saw that, even though I only have it paired with that one, there are traces in the logs for the ID of the switch on others zigbee2mqtt that are far away from the switch. I tried to remove them using MQTT, but it still apperars from time to time, and the issue is still present.
This doesn't happen if I use the Xiaomi GW instead of Zigbee2MQTT.
I'll pair it again to my zigbee2mqtt and provide logs to the thread.
Regards
Mine powers off after an hour or so, sometimes earlier or later.
@Koenkk, not sure if these logs from earlier help?
Zigbee2mqtt debug: https://hastebin.com/oqozoniduk.sql
zigbee-shepherd logs: https://hastebin.com/nimaribuji.sql
@jarrah31 as far as I can see, the logs contain no interesting information.
Perhaps sniffing the zigbee traffic while this happens could help us (https://github.com/Koenkk/zigbee2mqtt/blob/dev/docs/how_tos/how_to_sniff_zigbee_traffic.md)
I was hoping to try the sniffing software out this weekend as I have a spare CC2531 and the means to flash it, but the link to download the firmware goes to a page with nothing there:
http://www.ti.com/tool/PACKET-SNIFFER
Update: I managed to find the link by using Google cache, so here is the direct download link in case it helps others:
http://www.ti.com/general/docs/lit/getliterature.tsp?baseLiteratureNumber=swrc045&fileType=zip
I had everything set up with Wireshark and was successfully sniffing the Zigbee packets, but my wall switch kept dropping off the network. I tried repairing a couple of times without much luck, but then I realised that with 27 devices and 3 unknowns, I had hit the network limit.
I've now hit another problem where I can't add an extra router (even after removing some devices), so until I can get this issue solved I won't be able to debug the wall switch. I'll be back to help hopefully! :)
Based on my experiences, QBKG03LM can rejoin to the network after removing it from the bridge by MQTT commands. More interesting that it can rejoin as well when the bridge itself is reflashed... Maybe it is caused by it is acting as a router (but it is not routing any traffic). I'm not sure but I think that it is the reason on you can't free up slots to pair the sniffer (as the wall switch is rejoining and consuming again the freed slot).
Can you have a try on disabling the permit join option and then removing your wall switch? After the removal the switch's status led should flash in red when it turned on... I have a feeling on after this procedure you would be able to join new devices.
I ended up re-pairing all my devices as I couldn't free up the CC2531's memory, so I'm now back to sniffing out Zigbee packets! Right, two problems with this. First is the random nature of the switch offs - I'm having to leave Wireshark running and wait in the room to make a note of the moment it switches off, which isn't always possible. Secondly, Wireshark on my Pi can't cope with being left running. It will randomly stop collecting packets after either 4000 or 20000 have been monitored which I think is related to a known memory drain issue. I have to manually shut down Wireshark and launch from the command line again, so I'm bound to miss the crucial moment! I'll get there eventually. :)