Skip to content
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

Initial support for Xiaomi Aqara T1 Cube #4690

Merged
merged 3 commits into from
Apr 30, 2021

Conversation

manup
Copy link
Member

@manup manup commented Apr 2, 2021

Note: This PR requires a newer firmware, since the device only exposes required endpoints when the coordinator Node Descriptor has the Xiaomi manufacturer code set to 0x115F: deCONZ_ConBeeII_0x266b0700.bin.GCF

The PR contains a fix to query Basic Cluster attributes like manufacturer name for newer Xiaomi Zigbee 3.0 devices.
The Xiaomi Aqara T1 Cube exposes the same API and button events as the older Xiaomi Aqara Cube does.

{
   "1": {
    "config": {
        "battery": 100,
        "on": true,
        "reachable": true,
        "temperature": 2500
    },
    "ep": 2,
    "etag": "2c4057c509efa2d9e42d30a5697331d6",
    "lastseen": "2021-04-29T23:26Z",
    "manufacturername": "LUMI",
    "mode": 1,
    "modelid": "lumi.remote.cagl01",
    "name": "Mi Magic Cube",
    "state": {
        "buttonevent": 1003,
        "gesture": 3,
        "lastupdated": "2021-04-29T23:26:02.467"
    },
    "swversion": "20200327",
    "type": "ZHASwitch",
    "uniqueid": "04:cf:8c:df:3c:80:0d:1e-02-0012"
  },
  "2": {
    "config": {
        "battery": 100,
        "on": true,
        "reachable": true,
        "temperature": 2500
    },
    "ep": 3,
    "etag": "aa413cc38589fbb8c94c1b83867ea437",
    "lastseen": "2021-04-29T23:26Z",
    "manufacturername": "LUMI",
    "mode": 1,
    "modelid": "lumi.remote.cagl01",
    "name": "Mi Magic Cube",
    "state": {
        "buttonevent": -6828,
        "gesture": 8,
        "lastupdated": "2021-04-29T23:26:58.391"
    },
    "swversion": "20200327",
    "type": "ZHASwitch",
    "uniqueid": "04:cf:8c:df:3c:80:0d:1e-03-000c"
  }
}

The PR requires a newer not yet released ConBee/RaspBee firmware.
The cube only exposes required endpoints when the coordinator Node Descriptor has the Xiaomi manufacturer code set (0x115f).
@Smanar
Copy link
Collaborator

Smanar commented Apr 2, 2021

So it mean the "magic" will be in the firmware, and not in the API ?

@manup manup added this to the v2.11.2-beta milestone Apr 25, 2021
@manup
Copy link
Member Author

manup commented Apr 25, 2021

So it mean the "magic" will be in the firmware, and not in the API ?

Yes at least as initial approach I'd like to hard code the Node Descriptor response for Xiaomi in the firmware based on MAC prefix. This has the advantage that other projects like zigbee2mqtt and ZHA/zigpy which have adapters for the deCONZ serial protocol don't need to worry about this.

Later on the serial protocol will be configurable to let the firmware not send the Node Descriptor response and instead let the application like deCONZ handle this to gain more freedom.

@manup manup marked this pull request as draft April 25, 2021 12:54
The LightNode is added before modelId is known. Delete it as soon as it gets queried.
@manup manup marked this pull request as ready for review April 29, 2021 23:24
@manup manup merged commit 96fe04c into dresden-elektronik:master Apr 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants