WebThingsIO / zigbee-adapter

Zigbee adapter add-on for WebThings Gateway
Mozilla Public License 2.0
46 stars 29 forks source link

Xiaomi Aqara door and window sensor issues #105

Open clockbrain opened 5 years ago

clockbrain commented 5 years ago

A couple of issues here.

First I have heaps of trouble pairing these sensors. Takes several attempts for each sensor. They do connect eventually but far more difficult than the various other zigbee devices I have.

Once paired they show up as on/off switches rather than door sensors, i.e. on/off rather than open/closed state. Here is an extract from the config json file.

    "00158d0002c98a27": {
      "addr64": "00158d0002c98a27",
      "addr16": "80f9",
      "activeEndpoints": {
        "1": {
          "profileId": "0104",
          "deviceId": "5f01",
          "deviceVersion": 1,
          "inputClusters": [
            "0000",
            "0003",
            "ffff",
            "0006"
          ],
          "outputClusters": [
            "0000",
            "0004",
            "ffff"
          ],
          "classifierAttributesPopulated": true
        }
      },
      "properties": {
        "on": {
          "name": "on",
          "value": true,
          "visible": true,
          "label": "On/Off",
          "type": "boolean",
          "@type": "OnOffProperty",
          "profileId": 260,
          "endpoint": 1,
          "clusterId": 6,
          "attr": "onOff",
          "attrId": 0,
          "fireAndForget": true,
          "bindNeeded": false,
          "configReportNeeded": false,
          "initialReadNeeded": true
        }
      },
      "name": "zb-00158d0002c98a27-onOffSwitch",
      "type": "onOffSwitch",
      "@type": [
        "OnOffSwitch"
      ],
      "defaultName": "zb-00158d0002c98a27-onOffSwitch",
      "extendedTimeout": true,
      "activeEndpointsPopulated": true,
      "nodeInfoEndpointsPopulated": true,
      "modelId": "lumi.sensor_magnet.aq2",
      "appVersion": 3,
      "powerSource": 0,
      "rxOnWhenIdle": 1
    },

Also, while pairing, I noticed this decoding error in the debug log. Perhaps related to the difficulty in pairing?

2019-03-02 21:29:55.676 INFO   : zigbee: Rcvd: Explicit Rx 00158d0002c98a27 ZHA 0000 genBasic report
2019-03-02 21:29:55.677 INFO   : zigbee: Rcvd:       5:modelId 66:charStr lumi.sensor_magnet.aq2
2019-03-02 21:29:55.679 INFO   : zigbee: Rcvd:       1:appVersion 32:uint8 0x3(3)
2019-03-02 21:29:55.680 INFO   : zigbee: findNodeFromRxFrame: addr64: 00158d0002c98a27 addr16: 80f9
2019-03-02 21:29:55.753 INFO   : zigbee: Rcvd: Explicit Rx 0013a200415c2377 ZDO 8036 Mgmt Permit Join Resp (0x8036)  status: success (0)
2019-03-02 21:29:55.755 INFO   : zigbee: Rcvd:   Status:0
2019-03-02 21:29:55.757 ERROR  : zigbee: No handler for ZDO cluster: 8036
2019-03-02 21:29:55.868 INFO   : zigbee: Rcvd: Explicit Rx 00158d0002c98a27 ZHA 0000 genBasic report
2019-03-02 21:29:55.871 INFO   : zigbee: Rcvd:   65281:??? 66:charStr !�
(!!�!=
2019-03-02 21:29:55.872 INFO   : zigbee: !
2019-03-02 21:29:55.873 INFO   : zigbee: findNodeFromRxFrame: addr64: 00158d0002c98a27 addr16: 80f9

I have the complete pairing debug log if that's of any value.

dhylands commented 5 years ago

I'll take a look. The binary data on the genBasic report is normal with the Xiaomi sensors. They play fast and loose with the Zigbee spec and pretty much don't do anything according to the spec.

And yes - they are definitely more difficult to pair than most of the other sensors I have.