-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Add Xiaomi Aqara D1 switch QBKG26LM decoupled mode #1986
Comments
First step would be to sniff the traffic with the original xiaomi gateway to figure out what to send. https://www.zigbee2mqtt.io/how_tos/how_to_sniff_zigbee_traffic.html . Next add zigbee-herdsman-converters/converters/toZigbee.js Line 1436 in b441c7e
|
Thanks for the response. I'm using the Zigbee2mqtt add-on in Home Assistant. May I know where is the toZigbee.js file located? Thanks again. |
For the addon it's a bit more complicated. SSH into the machine, figure out the container ID with |
Hi @Koenkk , Happy New Year to you! I've captured the traffic from the QBKG26LM to Xiaomi Gateway. I pressed each button on the QBKG26LM twice, thus turning it ON->OFF starting from left to right. After that I turned on the Wireless Switch function for all 3 buttons from the Mi Home app, and pressed each button once, from left to right. May I know what do I need to modify in devices.js and toZigbee.js? Thanks a lot for your help. |
@chankalson I need a sniff off setting the decoupled mode from the Xiaomi gateway (keep the sniff as short as possible, so start sniffing right before you change the decoupled mode). Also share your network key |
@Koenkk, here's the new sniff file I've set decoupled mode for the 3 buttons. My network encryption key is 404546133c11a2bff89dbe2b74e99a57. Thanks again! Let me know if you need anything else. Appreciate all the help. |
Added. docs: https://www.zigbee2mqtt.io/devices/QBKG25LM.html#decoupled-mode (use the one of QBKG25LM). 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) |
Hi @Koenkk, the decoupled mode works (the button does not control the relay). However, there isn’t any action value/property for the switch. I tried adding the exposes for e.action in devices.js (following QBKG25LM) and the action property shows up, but when i press the button nothing is received by zigbee2mqtt. Is there anything else i need to modify? |
Did some more fixes, try again with latest dev. |
@Koenkk I'm on the latest dev commit: 4c95265, but still seems the same, nothing is transmitted when i press the decoupled button. |
Ah, 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) |
@Koenkk There's a typo of the switch model under 'xiaomi_multistate_action' in fromZigbee.js. Should be QBKG26LM, not QKBG26LM. No wonder it's still not working. 🤣 |
ah fixed now |
@Koenkk Still no actions being sent from the switch on latest dev, any idea why? |
Can you provide the debug log when clicking the bug? To enable debug logging set in advanced:
log_level: debug |
This is the debug log when decoupled mode is not enabled for the button: There is nothing logged when the decoupled button is clicked. |
|
Yes, i'm sure the button is in decoupled mode because when i click it does not turn on/off the relay. In decoupled mode, there is no In non-decoupled mode, this is the only I'm guessing the switch is not sending any actions? |
That explains a lot. Can you sniff the traffic when clicking the button in decoupled mode, do you see any messages being send directly after pressing the button? If not, can you try sniffing the same but then with the Xiaomi gateway? |
That's indeed exactly what I would expect: #1986 (comment) Did you enable the decoupled mode for each endpoint (left,center,right)? In your Xiaomi gateway sniff I see the gateway does this. |
Yes I tried enabling decoupled mode for all 3 endpoints, still the same. This is the debug log when i enable the decoupled mode: However in theory, even in non-decoupled mode, the button should also send the action when it is clicked right? But with zigbee2mqtt, the switch only sends the On/Off. |
Can you provide the log when pairing the QBKG26LM with the xiaomi gateway? Once it's paired click the button once so I can see the click message. |
Here's the sniff of pairing the switch and left button click: The button click On/Off is on Frame 70, Multistate Input on Frame 72. |
Looks it does nothing special. Can you try removing line zigbee-herdsman-converters/devices.js Line 576 in dc91a73
zigbee-herdsman-converters/devices.js Line 583 in dc91a73
|
Still doesn't work unfortunately. Also, the relay state is not updated after removing those lines. Could it be that we have to poll the switch for the Multistate Input? Could it be related to zStack version? (I'm on 1.2) |
It may be the QBKG26LM 02-24-2020 firmware issue, the actions run normally in 09-27-2019 build date version, but not in 2020, something changed in this version. configure: async (device, coordinatorEndpoint, logger) => {
await device.getEndpoint(1).write('aqaraOpple', {'mode': 1}, {manufacturerCode: 0x115f});
await reporting.bind(device.getEndpoint(1), coordinatorEndpoint, ['genOnOff']);
await reporting.bind(device.getEndpoint(2), coordinatorEndpoint, ['genOnOff']);
await reporting.bind(device.getEndpoint(3), coordinatorEndpoint, ['genOnOff']);
await reporting.onOff(device.getEndpoint(1));
await reporting.onOff(device.getEndpoint(2));
await reporting.onOff(device.getEndpoint(3));
} the default mode is {'mode': 0}, in this mode the switch wouldn't sent any message when button click. It work!!! |
Please tell me in simple terms, what should I do to make my actions work on this switch? I did QBKG26LM decoupled mode but can't see actions. |
I tried to do this last night too. This is what I did:
@sunsamzhen how do you activate your 'decoupled' mode? Looking at the steps I followed outlined above, do you think I'm missing anything? Thank you! |
Scratch that. I got it to work. I looked at my switches initialization and turns out I have a QBKG25LM. I added that same line for that device it worked as well! BRAVO! |
@Koenkk is it possible to include this update? |
@redesigndavid when adding |
@Koenkk mode 1 will make QBKG26LM behave like QBKG24LM and other old models, it report state changes whether it's decoupled mode or not,
|
@lovelylain could you make a pull request with these changes?
But does this change the published values for |
came here from here, and I can confirm that adding this line (i am using QBKG25LM) - the state changes are also reported when the switch is not in the decoupled mode. as with other people in this thread - without this line in xiaomi.js (and firmware from this post) - QBKG25LM does not report anything when in decoupled mode |
@redesigndavid @balonchiks thanks for confirming, added the fix. Changes will be available in the dev branch in a few hours from now. (https://www.zigbee2mqtt.io/how_tos/how-to-switch-to-dev-branch.html) |
First of all, Thank you @Koenkk for your work! Am I correct that I need re-flash my coordinator? Let me know if I can help somehow. |
As stated by @sunsamzhen above, I needed to add I'm not using the manufacturer code firmware given above as I'm using a raspBee II as my adapter. Also, I note that the documentation page for the QBKG26LM seems to have incorrect information regarding the setting of the decoupled mode in MQTT. Probably should note that the alternate instructions for QBKG25LM also applies to QBKG26LM . |
if you are using stick v3 from modkam.ru then yes, you need to flash it with this firmware |
@balonchiks I'm using cc2531 stick flashed with coordinator firmware. @ruifung do you mean:
or
If that makes any difference. |
@skyksandr No need to re-flash your coordinator. Koenkk only fixed for QBKG25LM, if your device is QBKG26LM, please wait or modify by yourself. |
Apparently the genAnalogInput cluster isn't present to be interviewed. Though it's sending attribute reports for it and attempting to GET the attribute just gives a no response error. Hence the ea.STATE and no tz.xiaomi_power here. Also the decoupled mode changes from Koenkk#1986 (comment) This has been tested on my local installation and power reporting works, as does decoupled mode actions. Though it will always send actions even when not decoupled.
Merged #2734 assuming this can be closed now. Changes will be available in the dev branch in a few hours from now. (https://www.zigbee2mqtt.io/how_tos/how-to-switch-to-dev-branch.html) |
* Power reporting and decoupled mode for Aqara QBKG26LM Apparently the genAnalogInput cluster isn't present to be interviewed. Though it's sending attribute reports for it and attempting to GET the attribute just gives a no response error. Hence the ea.STATE and no tz.xiaomi_power here. Also the decoupled mode changes from #1986 (comment) This has been tested on my local installation and power reporting works, as does decoupled mode actions. Though it will always send actions even when not decoupled. * Update xiaomi.js Co-authored-by: Koen Kanters <koenkanters94@gmail.com>
Just because it's somewhat related to this, #2735 should also fix the wierdness in the operation_mode states (and outright not being able to /get them). Now I can check if the switch is decoupled before doing anything for the action. |
Just want to say huge thanks @Koenkk |
@redesigndavid all credits go to @ruifung 😄 |
😄 |
@kondrikserg Please open a new issue instead of adding a comment here. This issue is closed and ancient, and completely unrelated to your issue. |
The Aqara D1 switch QBKG26LM is a 3-gang switch (with Neutral wire), however decoupled mode is not available even though the same 3-gang QBKG25LM (no neutral) has it.
ERROR: No converter available for 'operation_mode' ([object Object])
The text was updated successfully, but these errors were encountered: