dresden-elektronik / deconz-rest-plugin

deCONZ REST-API plugin to control ZigBee devices
BSD 3-Clause "New" or "Revised" License
1.9k stars 498 forks source link

Problem with old Xiaomi wired switch lumi.ctrl_ln2.aq1, lumi.ctrl_ln2 #7693

Closed Smanar closed 4 months ago

Smanar commented 5 months ago

Does the issue really belong here?

Is there already an existing issue for this?

Describe the bug

Hello it's a report from one user, alone, so need more test. He have problem to re-include his device on last deconz version. He have made several tries, deconz create all "sensors", but not the "light" entry. More then usual

Sans titre

But never the "light" sensor.

Steps to reproduce the behavior

Just remove and try to re-include the device.

Expected behavior

Have the "light" entry in database to control the device

Screenshots

No response

Environment

Haven't all information.

deCONZ Logs

No response

Additional context

For information, we have solved the issue using a DDF to force the detection.

{
  "schema": "devcap1.schema.json",
  "manufacturername": ["$MF_LUMI", "$MF_LUMI"],
  "modelid": ["lumi.ctrl_ln2.aq1",  "lumi.ctrl_ln2"],
  "vendor": "Xiaomi",
  "sleeper": false,
  "status": "Gold",
  "subdevices": [
    {
      "type": "$TYPE_ON_OFF_LIGHT",
      "restapi": "/lights",
      "uuid": [
        "$address.ext",
        "0x01"
      ],
      "items": [
        {
          "name": "attr/id"
        },
        {
          "name": "attr/lastannounced"
        },
        {
          "name": "attr/lastseen"
        },
        {
          "name": "attr/manufacturername"
        },
        {
          "name": "attr/modelid"
        },
        {
          "name": "attr/name"
        },
        {
          "name": "attr/swversion"
        },
        {
          "name": "attr/type"
        },
        {
          "name": "attr/uniqueid"
        },
        {
          "name": "state/alert"
        },
        {
          "name": "state/on"
        },
        {
          "name": "state/reachable"
        }
      ]
    },
    {
      "type": "$TYPE_ON_OFF_LIGHT",
      "restapi": "/lights",
      "uuid": [
        "$address.ext",
        "0x02"
      ],
      "items": [
        {
          "name": "attr/id"
        },
        {
          "name": "attr/lastannounced"
        },
        {
          "name": "attr/lastseen"
        },
        {
          "name": "attr/manufacturername"
        },
        {
          "name": "attr/modelid"
        },
        {
          "name": "attr/name"
        },
        {
          "name": "attr/swversion"
        },
        {
          "name": "attr/type"
        },
        {
          "name": "attr/uniqueid"
        },
        {
          "name": "state/alert"
        },
        {
          "name": "state/on"
        },
        {
          "name": "state/reachable"
        }
      ]
    },
    {
      "type": "$TYPE_POWER_SENSOR",
      "restapi": "/sensors",
      "uuid": [
        "$address.ext",
        "0x03",
        "0x000C"
      ],
      "items": [
        {
          "name": "attr/id"
        },
        {
          "name": "attr/lastannounced"
        },
        {
          "name": "attr/lastseen"
        },
        {
          "name": "attr/manufacturername"
        },
        {
          "name": "attr/modelid"
        },
        {
          "name": "attr/name"
        },
        {
          "name": "attr/swversion"
        },
        {
          "name": "attr/type"
        },
        {
          "name": "attr/uniqueid"
        },
        {
          "name": "config/on"
        },
        {
          "name": "config/reachable"
        },
        {
          "name": "config/temperature"
        },
        {
          "name": "state/lastupdated"
        },
        {
          "name": "state/power",
          "refresh.interval": 100,
          "read": {
            "at": "0x0055",
            "cl": "0x000C",
            "ep": 3,
            "fn": "zcl:attr"
          },
          "parse": {
            "at": "0x0055",
            "cl": "0x000C",
            "ep": 3,
            "eval": "Item.val = Math.round(Attr.val);"
          }
        }
      ]
    },
    {
      "type": "$TYPE_SWITCH",
      "restapi": "/sensors",
      "uuid": [
        "$address.ext",
        "0x05",
        "0x0006"
      ],
      "items": [
        {
          "name": "attr/id"
        },
        {
          "name": "attr/lastannounced"
        },
        {
          "name": "attr/lastseen"
        },
        {
          "name": "attr/manufacturername"
        },
        {
          "name": "attr/modelid"
        },
        {
          "name": "attr/name"
        },
        {
          "name": "attr/swversion"
        },
        {
          "name": "attr/type"
        },
        {
          "name": "attr/uniqueid"
        },
        {
          "name": "config/clickmode",
          "refresh.interval": 86400,
          "read": {
            "at": "0xFF22",
            "cl": "0x0000",
            "ep": 1,
            "fn": "zcl:attr",
            "mf": "0x115f"
          },
          "parse": {
            "at": "0xFF22",
            "cl": "0x0000",
            "ep": 1,
            "eval": "if (Attr.val == 0xFE) { Item.val = 'decoupled' } else if (Attr.val == 0x12) { Item.val = 'coupled' } else { Item.val = 'unknown' }",
            "fn": "zcl:attr",
            "mf": "0x115f"
          },
          "write": {
            "at": "0xFF22",
            "cl": "0x0000",
            "dt": "0x20",
            "ep": 1,
            "eval": "if (Item.val == 'decoupled') { 0xFE } else if (Item.val == 'coupled') { 0x12 } else { 'unknown' }",
            "fn": "zcl:attr",
            "mf": "0x115f"
          },
          "values": [
            ["\"decoupled\"", "Decoupled Mode"],
            ["\"coupled\"", "Coupled Mode"] 
          ],
          "default": "coupled"
        },
        {
          "name": "config/on"
        },
        {
          "name": "config/reachable"
        },
        {
          "name": "config/temperature"
        },
        {
          "name": "state/buttonevent"
        },
        {
          "name": "state/lastupdated"
        }
      ]
    }
  ]
}

I don't make a PR for this DDF, because the device is handled by legacy code, so the DDF can break something. It's not full tested, the power consumption is working, but can need a second one, but I haven't the device to finish it.

github-actions[bot] commented 5 months ago

As there has not been any response in 21 days, this issue has been automatically marked as stale. At OP: Please either close this issue or keep it active It will be closed in 7 days if no further activity occurs.

github-actions[bot] commented 4 months ago

As there has not been any response in 28 days, this issue will be closed. @ OP: If this issue is solved post what fixed it for you. If it is not solved, request to get this opened again.