-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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 Wall Switch (QBKG12LM) clicks skipped #3592
Comments
Could you provide the herdsman debug log of this? To enable herdsman debug logging, see https://www.zigbee2mqtt.io/information/debug.html#zigbee-herdsman-debug-logging |
Single click, I hope copied everything:
Here is the other switch I have and its working correctly. It is also working as a router but probably not for any other wall switch:
The map is not complete but it might help. The |
Thanks for the good logging. Issues should be fixed in latest dev branch. |
Cheers! Thank you :) |
Hi! Details of my setup: Here is my full debug log
And the wireshark sniffing (You can download the complete capture file here)
|
@XavierTolza is controlling them from zigbee2mqtt still possible? (e.g. turning on/off?). |
I forgot to mention I am using home assistant as interface. Controlling from home assistant does not work.
The wireshark screenshot: It took about 10sec before the last error message, during which zigbee-herdsman was sending/receiving packets several times. Looks like a problem with address resolution? But it used to work in the past, I tried with two other wall sockets, I had the same result. |
In case it might help, here is my configuration from [
{
"ieeeAddr": "0x00124b001938a033",
"type": "Coordinator",
"networkAddress": 0,
"friendly_name": "Coordinator",
"softwareBuildID": "zStack12",
"dateCode": "20190608",
"lastSeen": 1594572814540
},
{
"ieeeAddr": "0x00158d00015e86a1",
"type": "EndDevice",
"networkAddress": 18084,
"model": "RTCGQ01LM",
"vendor": "Xiaomi",
"description": "MiJia human body movement sensor",
"friendly_name": "Capteur mouvement",
"manufacturerID": 4151,
"manufacturerName": "LUMI",
"powerSource": "Battery",
"modelID": "lumi.sensor_motion",
"lastSeen": 1593971569593
},
{
"ieeeAddr": "0x00158d0001233ef6",
"type": "Router",
"networkAddress": 25282,
"model": "ZNCZ02LM",
"vendor": "Xiaomi",
"description": "Mi power plug ZigBee",
"friendly_name": "Prise 1",
"manufacturerID": 4447,
"manufacturerName": "LUMI",
"powerSource": "Mains (single phase)",
"modelID": "lumi.plug",
"hardwareVersion": 18,
"dateCode": "04-20-2018",
"lastSeen": 1594536652931
},
{
"ieeeAddr": "0x00158d00013e7f7d",
"type": "Router",
"networkAddress": 49277,
"model": "ZNCZ02LM",
"vendor": "Xiaomi",
"description": "Mi power plug ZigBee",
"friendly_name": "Prise 2",
"manufacturerID": 4447,
"manufacturerName": "LUMI",
"powerSource": "Mains (single phase)",
"modelID": "lumi.plug",
"hardwareVersion": 18,
"dateCode": "04-20-2018",
"lastSeen": 1593533632038
},
{
"ieeeAddr": "0x00158d00021333c2",
"type": "EndDevice",
"networkAddress": 48546,
"model": "WXKG02LM",
"vendor": "Xiaomi",
"description": "Aqara double key wireless wall switch",
"friendly_name": "Interrupteur 1",
"manufacturerID": 4151,
"manufacturerName": "LUMI",
"powerSource": "Battery",
"modelID": "lumi.sensor_86sw2",
"lastSeen": 1593801364207
},
{
"ieeeAddr": "0x00158d00023a86a2",
"type": "EndDevice",
"networkAddress": 8081,
"model": "WXKG02LM",
"vendor": "Xiaomi",
"description": "Aqara double key wireless wall switch",
"friendly_name": "Interrupteur 2",
"manufacturerID": 4151,
"manufacturerName": "LUMI",
"powerSource": "Battery",
"modelID": "lumi.sensor_86sw2",
"hardwareVersion": 20,
"softwareBuildID": "3000-0001",
"dateCode": "20170411",
"lastSeen": 1593533310941
},
{
"ieeeAddr": "0x00158d00013e4c4d",
"type": "Router",
"networkAddress": 4896,
"model": "ZNCZ02LM",
"vendor": "Xiaomi",
"description": "Mi power plug ZigBee",
"friendly_name": "Prise noire",
"manufacturerID": 4447,
"manufacturerName": "LUMI",
"powerSource": "Mains (single phase)",
"modelID": "lumi.plug",
"hardwareVersion": 18,
"softwareBuildID": "3000-0001",
"dateCode": "04-20-2018",
"lastSeen": 1594501926264
},
{
"ieeeAddr": "0x00158d0001a5e1f0",
"type": "EndDevice",
"networkAddress": 35600,
"model": "MCCGQ01LM",
"vendor": "Xiaomi",
"description": "MiJia door & window contact sensor",
"friendly_name": "Capteur porte 1",
"manufacturerID": 4151,
"manufacturerName": "LUMI",
"powerSource": "Battery",
"modelID": "lumi.sensor_magnet",
"lastSeen": 1593461072712
},
{
"ieeeAddr": "0x00158d00014d6072",
"type": "EndDevice",
"networkAddress": 19303,
"model": "MCCGQ01LM",
"vendor": "Xiaomi",
"description": "MiJia door & window contact sensor",
"friendly_name": "Capteur porte 2",
"manufacturerID": 4151,
"manufacturerName": "LUMI",
"powerSource": "Battery",
"modelID": "lumi.sensor_magnet",
"lastSeen": 1594134401881
}
] |
|
Yes! I saw some issues about that and I tried it with a 30cm cable (see setup picture behind). Should I try a longer cable? |
That should be enough, does it work when having the device close to the coordinator? |
Unfortunately not. I tried with the button 1m await, still the same error.
I don't think it's an RF issue since it worked perfectly for a few days and
went off after a reboot.
|
I finally had some time to spend on it and I think I understood the problem! /**
* Don't handle re-transmitted Xiaomi messages.
* https://github.com/Koenkk/zigbee2mqtt/issues/1238
*
* Some Xiaomi router devices re-transmit messages from Xiaomi end devices.
* The source address of these message is set to the one of the Xiaomi router.
* Therefore it looks like if the message came from the Xiaomi router, while in
* fact it came from the end device.
* Handling these message would result in false state updates.
* The group ID attribute of these message defines the source address of the end device.
* As the same message is also received directly from the end device, it makes no sense
* to handle these messages.
*/
const hasGroupID = data.hasOwnProperty('groupID') && !!data.groupID;
if (utils.isXiaomiDevice(data.device) && utils.isRouter(data.device) && hasGroupID) {
logger.debug('Skipping re-transmitted Xiaomi message');
return false;
} Which was created during this issue. Shouldn't xiaomi routing process be fullly implemented to support their routers? There might be a way to de-duplicate messages as the Xiaomi Aqara gateway does not suffer from duplicated messages. |
The question is how to de-duplicate, they way they forward this is really hack and not zigbee compliant in any way. We could do something with a timeout but it's a solution I do not prefer. |
I saw some comment in the code about "debouncing". Isn't that appropriate? |
I'm wondering if the Xiaomi bridge does the filtering based on wether it already received that transactionID. Can you provide the log when changing the code you mentioned in #3592 (comment) to if (utils.isXiaomiDevice(data.device)) {
console.log(`XIAOMI MESSAGE, RECEIVED FROM: '${resolvedEntity.name}' (${data.device.type}), GROUPID: '${data.groupID}', transaction: '${data.meta.zclTransactionSequenceNumber}'`);
}
const hasGroupID = data.hasOwnProperty('groupID') && !!data.groupID;
if (utils.isXiaomiDevice(data.device) && data.device.type === 'Router' && hasGroupID) {
logger.debug('Skipping re-transmitted Xiaomi message');
return false;
} |
I had some trouble doing so because I added some devices and everything suddenly worked again. After a while, the bug is back.
|
@XavierTolza can you try replacing the entire content of |
Seems better! :)
But when I try to switch it from home assistant, I get an error:
|
|
After a week of testing, it looks like everything is working fine! |
@XavierTolza great, implemented the fix. 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) |
i foind that we are still missing messages from xiaomi ends (in this case from contact_seat_t and rocker_hood_k) thru xiaomi routers - aqara sockets. can this fix be implemented to them as well(QBCZ11LM)? Also there was kind of test done and looks like this two guys (QBKG11LM QBKG12LM) acting same way and Aqara relay too. So kind of general xiomi repeaters issue. |
@to4ko the fix I implemented is not device specific and should work for all. Can you provide the debug logging of your problem? |
this is what i get - Mi motion sensor connected via Aqara Socket. There was a movement (i entered the storage my storage room)
|
@to4ko looks to be the same as #4459 , we need to figure out what in the |
What happened
I have tried tu use Conbee II as coordinator and had to repair few devices. After this one of my wall switches (QBKG12LM - working as a router) did not report clicks (they are working in decoupled mode). Here are logs after clicking left button twice, right button twice and both buttons once:
What did you expect to happen
To get MQTT messages about clicks.
How to reproduce it (minimal and precise)
Click "broken" switch and watch logs.
Debug Info
Zigbee2mqtt version: 1.13.1
Adapter hardware: ConBee II (is it related?)
Adapter firmware version: ---
The text was updated successfully, but these errors were encountered: