Add DDFs for Xiaomi Cube MFKZQ01LM, T1 MFKZQ11LM and T1 Pro MFKZQ12LM#5838
Add DDFs for Xiaomi Cube MFKZQ01LM, T1 MFKZQ11LM and T1 Pro MFKZQ12LM#5838SwoopX merged 7 commits intodresden-elektronik:masterfrom
Conversation
|
Is this tested, the C++ code isn't removed? |
|
Ups, indeed, was too keen on the description. This has been tested with the legacy code removed. However, as I recall, I was hesitant to remove the code since could only test the 1st gen device. |
|
Hello @SwoopX , |
|
Hello @SwoopX , I tried the solution, you provided. |
|
I'd really love to get this in and the legacy code removed, seems to need some more debugging? |
|
When you have a DDF used thrice and just change the model ID and apart from that they also share the very same C++ code, I tend to believe it's not an issue with the DDF if one works flawlessly with it 🙂 |
|
@SwoopX , @manup : The only small issue, I found is: I'm not sure, which solution is the best:
Besides this small difference, the implementation is working. |
|
The old Xiaomi cube does indeed have different values compared to the Aqara Cube and the Aqara T1 cube. You should see the same behaviour without this PR as well. I did point it out but breaking it would break existing setups using e.g. rules, so it was never changed. Changing it now would also break my app which currently handles it correctly for all cubes. |
|
The difference in the cube t1 pro is, that this cube has labelled sides. Otherwise everyone who is using the t1 pro cube has to write an own remapping. |
|
Thanks, I did not know about the labelled sides. Still, changing this would break existing setups and my app, so making this breaking change would need to be done carefully. Also need to think what to do about the 2nd gen cube which does not have labelled sides but reports different values in the API compared with the 1st gen cube. |
|
I just realised there are four different cubes and not three, which I did not know. You are talking about the T1 Pro which is different from the T1. Should be like this (if I didn't mess it up): |
|
Related issue comment about the original Xiaomi Mi cube: #138 (comment) |
|
Oh, I didn't know about four cubes. My tests were done with these two cubes:
|
|
Tested only the DDF for the Cube T1 Pro and it works for me, but only in Action mode. The T1 Pro has two modes, Action and Scene. The DDF seems to cover only the Action mode, and it seems that the "side selection" gesture of Scene has a bitmask of 0x0400. The following code should address this, but the question is if this should be a separate gesture or also mapped to flip/3. The 'previous side' seems not to be provided for 0x0400. Regarding the different side mapping for Magic Cube and T1 Pro, could the model ID be provided to xiaomi_cube_gestures.js, then the different sideMap mapping could be resolved by using the respective array. |
|
@rhapsodicDE Thanks for sharing this. Wasn't aware I could get a hold of that device real quick; ordered some which should arrive tomorrow 🙂 Always beneficial to have a device here to discover all the secrets. |
|
@fhinder Now got the device here as well. Thanks for already finding out the required changes on the script, which I can confirm. Currently pending feedback on the preferred approach. Additionally, the device has 2 modes of operation, scene mode seems to be default and therefore lacking the gestures (or most of them?). @rhapsodicDE The cube is sending something even simpler on zigbee level for the scenes. Not too sure yet how to get that covered in a convenient way. Eventually, we'll skip the scene support for the initial device support. |
|
@SwoopX : Based on the manual, the modes scene/normal can be switched via the Xiaomi App and the corresponding gateway. Since I don't have a Xiaomi gateway, I'm not able to test this. Would be great, if the switch of the mode could be triggered via conbee. But maybe a new feature request. One additional difference, I figured out: the gesture "drop" is not available, or my cube has a defect. Can you verify if your cube has the gesture drop? |
|
@fhinder Luckily, I was able to find out the mode switch without setting up my Xiaomi gateway. I added the mode switch now, as the mode differences were larger than initially thought. Everything should now be included. The new cube indeed doesn't have the drop gesture. You just need to have a look at the Aqara device page or in the manual. |
|
It's a biggy PR but I'd really like to have it in. @SwoopX please merge when you think it's ready. |
The new Aqara Cube T1 & Pro T1 has a model id "lumi.remote.cagl01/cagl02" Recently added in deconz-rest-plugin dresden-elektronik/deconz-rest-plugin#5838

Adds the DDFs for the following cubes:
MFKZQ01LM - "lumi.sensor_cube" (Mi logo)
MFKZQ01LM - "lumi.sensor_cube.aqgl01" (Aqara logo)
MFKZQ11LM - "lumi.remote.cagl01" (Aqara T1)
MFKZQ12LM - "lumi.remote.cagl02" (Aqara T1 Pro)
and removes the respective legacy code.