Aqara Door Window Sensor P1 Zigbee 3.0

I bought a “Aqara Door Window Sensor P1 Zigbee 3.0” and it is shown in the deCONZ graphical view, but not shown as sensor in the Phoscon app. It looks like the device described in this thread “Paring Aqara P1” but seems not being the same.

According to Aqara P1 Door & Window Sensor MCCGQ13LM Zigbee compatibility it should work … .

I’m thankful for any hint to activate this.

Hello, what is the Manufacture name and the device model ID ?

Hallo,

ich kenne mich nicht so gut aus, daher habe ich mal alle Infos reingepackt:

Danke für Deine Unterstützung.

VG.

Hello, same problem than here Light sensor ZSS-QY-LS-C / TS0222_TZ3000_8uxxzz4b unknown - #6 by Smanar
Value are “Unknow”

It seems quite similiar to MCCGQ14LM. Who can guide me to adapt this ddf ?

Take a look here Light sensor ZSS-QY-LS-C / TS0222_TZ3000_8uxxzz4b unknown - #6 by Smanar
And do same, I need the modelID+Manufacture Name.

Model Identifier: lumi.magnet.ac01
Manufacturer Name: LUMI

There is no DDF for this device.
There is one for the “lumi.magnet.agl02” but this device don’t use IAS cluster

Can try to add your device to the DDF “devices\xiaomi\xiaomi_mccgq14lm_e1_openclose_sensor.json”

  "manufacturername": ["$MF_LUMI", "$MF_LUMI"],
  "modelid": ["lumi.magnet.acn001", "lumi.magnet.ac01"],

This one almost have the same working mode (perhaps not the battery)

Edit, forget what I have say, this device have more feature, better to start on a new DDF


{
  "schema": "devcap1.schema.json",
  "manufacturername": "$MF_LUMI",
  "modelid": "lumi.magnet.ac01",
  "vendor": "Xiaomi Aqara",
  "product": "Aqara Door Window Sensor P1 Zigbee 3.0",
  "sleeper": true,
  "status": "Gold",
  "subdevices": [
    {
      "type": "$TYPE_OPEN_CLOSE_SENSOR",
      "restapi": "/sensors",
      "uuid": [
        "$address.ext",
        "0x01",
        "0x0500"
      ],
      "fingerprint": {
        "profile": "0x0104",
        "device": "0x0402",
        "endpoint": "0x01",
        "in": [
          "0x0000",
          "0x0001",
          "0x0500",
          "0xFCC0"
        ]
      },
      "items": [
        {
          "name": "attr/id"
        },
        {
          "name": "attr/lastannounced"
        },
        {
          "name": "attr/lastseen"
        },
        {
          "name": "attr/manufacturername",
          "awake": true
        },
        {
          "name": "attr/modelid",
          "awake": true
        },
        {
          "name": "attr/name"
        },
        {
          "name": "attr/swversion",
          "awake": true,
          "parse": {
            "at": "0x00f7",
            "ep": 1,
            "eval": "Item.val = '0.0.0_' + ('0000' + (Attr.val & 0xFF).toString()).slice(-4)",
            "fn": "xiaomi:special",
            "idx": "0x08",
            "mf": "0x115f"
          },
          "read": {
            "fn": "none"
          }
        },
        {
          "name": "attr/type"
        },
        {
          "name": "attr/uniqueid"
        },
        {
          "name": "config/battery",
          "awake": true,
          "parse": {
            "at": "0x00f7",
            "ep": 1,
            "fn": "xiaomi:special",
            "idx": "0x01",
            "mf": "0x115f",
            "script": "xiaomi_battery.js"
          }
        },
        {
          "name": "config/enrolled",
          "default": 1
        },
        {
          "name": "config/on"
        },
        {
          "name": "config/pending"
        },
        {
          "name": "config/reachable"
        },
        {
          "name": "state/lastupdated"
        },
        {
          "name": "state/open"
        }
      ]
    }
  ]
}

And as new feature


        {
          "name": "config/targetdistance",
          "parse": {
            "fn": "zcl:attr",
            "ep": 1,
            "cl": "0xFCC0",
            "mf": "0x115F",
            "at": "0x010C",
            "eval": "Item.val = ['10', '20', '30'][Attr.val]"
          },
          "read": {
            "fn": "none"
          },
          "write": {
            "fn": "zcl:attr",
            "ep": 1,
            "cl": "0xFCC0",
            "mf": "0x115F",
            "at": "0x010C",
            "dt": "0x20",
            "eval": "['10', '20', '30'].indexOf(Item.val)"
          },
          "default": "10"
        },

Thank you very much!! Now it is reconized as sensor an the state changes:

One small issue:


No state change here.

lol, not realy a “small issue” ^^.

Perhaps I m wrong and this device use the cluster 0x0006.
If it use the cluster 0x0006 can try to replace

        {
          "name": "state/open"
        }

by

        {
          "name": "state/open",
          "parse": {
            "at": "0x0000",
            "cl": "0x0006",
            "ep": 1,
            "eval": "Item.val = Attr.val",
            "fn": "zcl:attr"
          }
        }

But it mean all the IAS stuff can be removed

Tried this and added the lines. But now, it is not recognized as sensor anymore and the On/Off cluster no longer available.

Tried this and added the lines. But now, it is not recognized as sensor anymore

A typo in the DDF ? try

{
  "schema": "devcap1.schema.json",
  "manufacturername": "$MF_LUMI",
  "modelid": "lumi.magnet.ac01",
  "vendor": "Xiaomi Aqara",
  "product": "Aqara Door Window Sensor P1 Zigbee 3.0",
  "sleeper": true,
  "status": "Gold",
  "subdevices": [
    {
      "type": "$TYPE_OPEN_CLOSE_SENSOR",
      "restapi": "/sensors",
      "uuid": [
        "$address.ext",
        "0x01",
        "0x0500"
      ],
      "fingerprint": {
        "profile": "0x0104",
        "device": "0x0402",
        "endpoint": "0x01",
        "in": [
          "0x0000",
          "0x0001",
          "0x0500",
          "0xFCC0"
        ]
      },
      "items": [
        {
          "name": "attr/id"
        },
        {
          "name": "attr/lastannounced"
        },
        {
          "name": "attr/lastseen"
        },
        {
          "name": "attr/manufacturername",
          "awake": true
        },
        {
          "name": "attr/modelid",
          "awake": true
        },
        {
          "name": "attr/name"
        },
        {
          "name": "attr/swversion",
          "awake": true,
          "parse": {
            "at": "0x00f7",
            "ep": 1,
            "eval": "Item.val = '0.0.0_' + ('0000' + (Attr.val & 0xFF).toString()).slice(-4)",
            "fn": "xiaomi:special",
            "idx": "0x08",
            "mf": "0x115f"
          },
          "read": {
            "fn": "none"
          }
        },
        {
          "name": "attr/type"
        },
        {
          "name": "attr/uniqueid"
        },
        {
          "name": "config/battery",
          "awake": true,
          "parse": {
            "at": "0x00f7",
            "ep": 1,
            "fn": "xiaomi:special",
            "idx": "0x01",
            "mf": "0x115f",
            "script": "xiaomi_battery.js"
          }
        },
        {
          "name": "config/enrolled",
          "default": 1
        },
        {
          "name": "config/on"
        },
        {
          "name": "config/pending"
        },
        {
          "name": "config/reachable"
        },
        {
          "name": "state/lastupdated"
        },
        {
          "name": "state/open",
          "parse": {
            "at": "0x0000",
            "cl": "0x0006",
            "ep": 1,
            "eval": "Item.val = Attr.val",
            "fn": "zcl:attr"
          }
        }
      ]
    }
  ]
}

Yes Sir. There was a mistake in the ddf. Now sensor state is shown in WebUI. Thank you very much for your support !

So all is working ?
Do you want to make a Pr to submit the device ? or want I make it ?

If it’s no trouble, then you’re welcome to do the PR. After all, it was your achievement, I was just the tester and beneficiary.

Done > DDF add primary support for the Aqara Door Window Sensor P1 by Smanar · Pull Request #8284 · dresden-elektronik/deconz-rest-plugin · GitHub

Just for information, as the deive use the cluster on/off I have removed all the IAS stuff.
Can you test if the official DDF in the PR is still working pls ?

Tested. Works. Thank you very much for all !