Missing input switches for aqara T2 module

Hi deCONZ Community.
As part of a project to get my garage door to open a separate door bolt and then open the garage door, I purchased the aqara T2 dual relay.

It has two dry input switch controls and two dry output relay controls as well. I’d like the two dry inputs to be exposed to HomeKit as perhaps temporary contact sensors or stateless programmable switches.

I have it paired to deconz. And homebridge-deconz exposes the two relay controls as switches. But I don’t see the dry input switch buttons.

GET /accessories/deviceid shows this below (using ui utility from homebridge-deconz)

{
“id”: “54EF441000XXXX”,
“manufacturer”: “Aqara”,
“model”: “lumi.switch.acn047”,
“name”: “On Off switch 26”,
“resources”: [
“/lights/26”,
“/lights/27”,
“/sensors/32”,
“/sensors/33”
],
“settings”: {
“expose”: true,
“logLevel”: 2,
“serviceName”: “Switch”,
“wallSwitch”: false
},
“type”: “lights”,
“zigbee”: true
}

In talking to @ebaauw on Discord. He confirmed that “It doesn’t look like deCONZ exposes the inputs. There should be a ZHASwitch /sensors resource for these.”

Second question: Once I have these switches exposed I’d like to decouple the switch actions from the relay actions. I’d like to trigger an automation with the input switches that as part of the automation would trigger the relay on the T2 later.

How could I go about getting those two input switches exposed by deconz?

Thanks for your help!

Would end point the multistate input (basic) clusters in the 0x01 and 0x02 endpoints perhaps correspond to the input switches?

Hello, for me this mean you have 2 sensors entries created (surely ZHASwitch) and 2 light entries (one by output)
So for me all is fine, but I haven’t homebridge.

To be sure you can check direclty in the API using Phoscon/help/API information.

Hi @Smanar,
Sensor 32 and sensor 33 are related to power. Power and consumption.
The two dry contact input switches are not being exposed by deCONZ. No zhswitch resources being exposed.
Here is the relevant parts of the output of:
curl -X GET http://192.168.XX.X:8080/api/XXXXXXXX/sensors

{
“32”: {
“config”: {
“on”: true,
“reachable”: true
},
“ep”: 21,
“etag”: “d32c5add69a600545004cc6c4771498d”,
“lastannounced”: null,
“lastseen”: “2025-04-01T16:21Z”,
“manufacturername”: “Aqara”,
“modelid”: “lumi.switch.acn047”,
“name”: “Power 32”,
“state”: {
“current”: 0,
“lastupdated”: “2025-04-01T16:22:24.983”,
“power”: 0,
“voltage”: 117
},
“swversion”: “0.0.0_0027”,
“type”: “ZHAPower”,
“uniqueid”: “54:ef:44:10:XX:XX:XX:XX-XX-XXXX”
},
“33”: {
“config”: {
“on”: true,
“reachable”: true
},
“ep”: 1,
“etag”: “eb601951342312ae38bcd610375ceed5”,
“lastannounced”: null,
“lastseen”: “2025-04-01T16:21Z”,
“manufacturername”: “Aqara”,
“modelid”: “lumi.switch.acn047”,
“name”: “Consumption 33”,
“state”: {
“consumption”: 0,
“lastupdated”: “2025-04-01T16:22:09.406”
},
“swversion”: “0.0.0_0027”,
“type”: “ZHAConsumption”,
“uniqueid”: “54:ef:44:10:XX:XX:XX:XX-XX-XXXX”
}
}

Ha yes, have found the DDF deconz-rest-plugin/devices/xiaomi/xiaomi_dcm-k01_t2_dual_relay.json at master · dresden-elektronik/deconz-rest-plugin · GitHub

So yes this device don’t have ZHAswitch as it’s possible to use the output image, can add to the DDF


    {
      "type": "$TYPE_SWITCH",
      "restapi": "/sensors",
      "uuid": [
        "$address.ext",
        "0x01",
        "0x0012"
      ],
      "items": [
        {
          "name": "attr/id"
        },
        {
          "name": "attr/lastannounced"
        },
        {
          "name": "attr/lastseen"
        },
        {
          "name": "attr/manufacturername"
        },
        {
          "name": "attr/modelid"
        },
        {
          "name": "attr/name"
        },
        {
          "name": "attr/swversion",
          "parse": {
            "at": "0x00f7",
            "ep": 1,
            "fn": "xiaomi:special",
            "idx": "0x0d",
            "script": "xiaomi_swversion.js"
          },
          "read": {
            "fn": "none"
          }
        },
        {
          "name": "attr/type"
        },
        {
          "name": "attr/uniqueid"
        },
        {
          "name": "config/on"
        },
        {
          "name": "config/reachable"
        },
        {
          "name": "state/buttonevent"
        },
        {
          "name": "state/lastupdated"
        }
      ]
    }

IDK wich one Endpoint it will use, you have 3 Endpoints with cluster 0x000C.

But you just need to enable logs with “info” and “info_l2” and press a button, you will have an error message about a " button handler", it will be the endpoint, the cluster, the command and the value.

"[INFO] - No button handler for: %s%s, endpoint: 0x%02X, cluster: %s, command: %s, payload: %s, zclSeq: %u\n",

Quick question!
Do i add the above to the DDF and then test and look at the logs?
Or do i need to test and look at the logs first?

I found this with logs enabled:
During this test i opened the garage door using S1 input contacts.

debug.txt:1114:09:31:02:725 [INFO] - No button map for: lumi.switch.acn047, unicast to: 0x0000, endpoint: 0x01, cluster: XIAOMI (0xFCC0), command: ATTRIBUTE_REPORT (0x0A), payload: F700413F03281E05212A00092100100A2100000C200A0D231B0000001123010000006410006510009539000000009639004092449839000000009739000000009A2000, zclSeq: 59

I ran a second test using S2 input contacts. i did not see the Info for no map button. but i did see this:

debug.txt:1332:09:36:04:109 Websocket 192.168.84.151:36254 send message: {“attr”:{“ddf_hash”:null,“ddf_policy”:“latest_prefer_stable”,“lastannounced”:null,“lastseen”:“2025-04-02T16:36Z”,“manufacturername”:“Aqara”,“mode”:1,“modelid”:“lumi.switch.acn047”,“name”:“Switch 34”,“nwkaddress”:10287,“swversion”:null,“type”:“ZHASwitch”,“uniqueid”:“54:ef:44:10:00:b7:2f:fa-01-0012”},“e”:“changed”,“id”:“34”,“r”:“sensors”,“t”:“event”,“uniqueid”:“54:ef:44:10:00:b7:2f:fa-01-0012”} (ret = 395)

So yes it’s possible, there is for exemple

[1, "0x01", "XIAOMI", "ATTRIBUTE_REPORT", "1", "S_BUTTON_1", "S_BUTTON_ACTION_SHORT_RELEASED", "Single press"],

But I m realy surprised it’s don’t use the cluster 0x0012 or 0x000C.

Same result if you use the second button ?

Edit:
Sorry haven’t see your edition.

If there is no reaction on second button, we have done something bad.
And if you use the endpoint 0x02 on DDF ?

      "uuid": [
        "$address.ext",
        "0x02",
        "0x0012"
      ],

On similar device, there is no bind/report, so I don’t think this device need it too.
Perhaps with a fingerprint ?

Question: I only added one type_switch sensor block to the DDF.
Should i be adding two blocks? one for each input switch?

Deconz use only one by device.
It return a value like X00Y, X is the button number and Y the action.

For the fingerprint (and on cluster 0x02) can use

      "uuid": [
        "$address.ext",
        "0x02",
        "0x0012"
      ],
      "fingerprint": {
        "profile": "0x0104",
        "device": "0x0000",
        "endpoint": "0x02",
        "in": [
          "0x0012"
        ]
      },

Thanks. So i will add this to the original DDF.
I’ll add and test shortly.

    {
      "type": "$TYPE_SWITCH",
      "restapi": "/sensors",
      "uuid": [
        "$address.ext",
        "0x01",
        "0x0012"
      ],
      "items": [
        {
          "name": "attr/id"
        },
        {
          "name": "attr/lastannounced"
        },
        {
          "name": "attr/lastseen"
        },
        {
          "name": "attr/manufacturername"
        },
        {
          "name": "attr/modelid"
        },
        {
          "name": "attr/name"
        },
        {
          "name": "attr/swversion",
          "parse": {
            "at": "0x00f7",
            "ep": 1,
            "fn": "xiaomi:special",
            "idx": "0x0d",
            "script": "xiaomi_swversion.js"
          },
          "read": {
            "fn": "none"
          }
        },
        {
          "name": "attr/type"
        },
        {
          "name": "attr/uniqueid"
        },
        {
          "name": "config/on"
        },
        {
          "name": "config/reachable"
        },
        {
          "name": "state/buttonevent"
        },
        {
          "name": "state/lastupdated"
        }
      ]
    },
    {
      "type": "$TYPE_SWITCH",
      "restapi": "/sensors",
      "uuid": [
        "$address.ext",
        "0x02",
        "0x0012"
      ],
      "fingerprint": {
        "profile": "0x0104",
        "device": "0x0000",
        "endpoint": "0x02",
        "in": [
          "0x0012"
        ]
      },
      "items": [
        {
          "name": "attr/id"
        },
        {
          "name": "attr/lastannounced"
        },
        {
          "name": "attr/lastseen"
        },
        {
          "name": "attr/manufacturername"
        },
        {
          "name": "attr/modelid"
        },
        {
          "name": "attr/name"
        },
        {
          "name": "attr/swversion",
          "parse": {
            "at": "0x00f7",
            "ep": 1,
            "fn": "xiaomi:special",
            "idx": "0x0d",
            "script": "xiaomi_swversion.js"
          },
          "read": {
            "fn": "none"
          }
        },
        {
          "name": "attr/type"
        },
        {
          "name": "attr/uniqueid"
        },
        {
          "name": "config/on"
        },
        {
          "name": "config/reachable"
        },
        {
          "name": "state/buttonevent"
        },
        {
          "name": "state/lastupdated"
        }
      ]
    }

Nope, there is only one "type": "$TYPE_SWITCH", by device
And it will work for all endpoint, no need to use one for 0x01 ad one for 0x02.

It need to work for 0x01, not on your test ^^, it’s for that I purpose to use 0x02, but it need to be same.

ok got it.
Have only one block now with the changes and the fingerprint.
Will test now.

ok. With the updated DDF, When i tested S2 input contact action i found this in the logs

debug.txt:1112:10:05:14:664 [INFO] - No button map for: lumi.switch.acn047, unicast to: 0x0000, endpoint: 0x01, cluster: XIAOMI (0xFCC0), command: ATTRIBUTE_REPORT (0x0A), payload: F700413F03281F05212A00092100100A2100000C200A0D231B0000001123010000006410006510009539000000009639004092449839000000009739000000009A2000, zclSeq: 63

However i did not see any relevant info in the logs when i tested S1 button press.

It’s interesting to note that there are two sections for
“type” “$TYPE_ON_OFF_SWITCH” in the DDF.
That’s why i would have assumed there would need to be two input ZHA Switch sections as well.

Yeah there is one “light” entry by output, but only one for “sensor” for switch input by device, all input are cumuled on the same value.

So if I resume, If you use the endpoint 0x01 you have only the S1 working and if you use the endpoint 0x02, only S2 is working ?
But all on the same endpoint on logs ?

unicast to: 0x0000, endpoint: 0x01, cluster: XIAOMI (0xFCC0), command: ATTRIBUTE_REPORT (0x0A)

Perhaps it work only if input are decoupled from the output ? It’s possible to do that using the GUI ? On endpoint 0x01 and 0x02, attribute 0x0200

That appears to be correct.
I tested your first DDF addition and S1 worked.
I tested your changes and then only S2 worked.

Ok i will test decoupling! That was going to be my next question once figuring this all out.
After setting decoupling on. Should i test with my current ddf? the one you edited with the fingerprint section?

I just enabled deconz gui.
Note that The T2 module node was not present for some reason. I had to re-pair it. Not sure if that is normal.
I repaired it and updated 0x0200 (labeled “child lock” under lumi specific cluster) and set value to 0 for both end points. They were both set to 1 and are now set to 0.
I don’t think this decoupled the input from the relay switches though as when i press the input buttons the garage door would actually open. Test results below.
In phoscon i see a single switch show up for the T2 module under switches.

Tested S1 button press. These are the relevant log outputs: I don’t see the button map log record.

debug.txt:1686:10:50:36:093 Websocket 192.168.84.151:56536 send message: {"attr":{"ddf_hash":null,"ddf_policy":"latest_prefer_stable","lastannounced":null,"lastseen":"2025-04-02T17:50Z","manufacturername":"Aqara","mode":1,"modelid":"**lumi.switch.acn047**","name":"Switch 37","nwkaddress":57070,"swversion":null,"type":"ZHASwitch","uniqueid":"54:ef:44:10:00:b7:2f:fa-02-0012"},"e":"changed","id":"37","r":"sensors","t":"event","uniqueid":"54:ef:44:10:00:b7:2f:fa-02-0012"} (ret = 395)

debug.txt:1687:10:50:36:093 Websocket 192.168.84.125:56050 send message: {"attr":{"ddf_hash":null,"ddf_policy":"latest_prefer_stable","lastannounced":null,"lastseen":"2025-04-02T17:50Z","manufacturername":"Aqara","mode":1,"modelid":"**lumi.switch.acn047**","name":"Switch 37","nwkaddress":57070,"swversion":null,"type":"ZHASwitch","uniqueid":"54:ef:44:10:00:b7:2f:fa-02-0012"},"e":"changed","id":"37","r":"sensors","t":"event","uniqueid":"54:ef:44:10:00:b7:2f:fa-02-0012"} (ret = 395)

When testing S2 button press i get this: I do see the no button map log record.

debug.txt:1309:10:56:23:612 [INFO] - No button map for: **lumi.switch.acn047**, unicast to: 0x0000, endpoint: 0x01, cluster: XIAOMI (0xFCC0), command: ATTRIBUTE_REPORT (0x0A), payload: F700413F03281D05212C00092100100A2100000C200A0D231B000000112301000000641000651000953900000000963900E093449839000000009739000000009A2000, zclSeq: 30

debug.txt:1316:10:56:23:615 Websocket 192.168.84.151:48996 send message: {"attr":{"ddf_hash":null,"ddf_policy":"latest_prefer_stable","lastannounced":null,"lastseen":"2025-04-02T17:56Z","manufacturername":"Aqara","mode":1,"modelid":"**lumi.switch.acn047**","name":"Switch 37","nwkaddress":57070,"swversion":null,"type":"ZHASwitch","uniqueid":"54:ef:44:10:00:b7:2f:fa-02-0012"},"e":"changed","id":"37","r":"sensors","t":"event","uniqueid":"54:ef:44:10:00:b7:2f:fa-02-0012"} (ret = 395)

debug.txt:1317:10:56:23:615 Websocket 192.168.84.125:56242 send message: {"attr":{"ddf_hash":null,"ddf_policy":"latest_prefer_stable","lastannounced":null,"lastseen":"2025-04-02T17:56Z","manufacturername":"Aqara","mode":1,"modelid":"**lumi.switch.acn047**","name":"Switch 37","nwkaddress":57070,"swversion":null,"type":"ZHASwitch","uniqueid":"54:ef:44:10:00:b7:2f:fa-02-0012"},"e":"changed","id":"37","r":"sensors","t":"event","uniqueid":"54:ef:44:10:00:b7:2f:fa-02-0012"} (ret = 395)

Yeah DDF need to work with or without decoupled mode, it only impact result.

And yes it’s that for value, 0 for decoupled, 1 for controled.

But on other device it’s attribute 0xFF22 on cluster 0x0000 that is used

          <attribute id="0xFF22" name="Xiaomi Disconnect 1" type="u8" showas="hex" access="rw" required="o" mfcode="0x115f">
            <description>Set to 0x12 (0xFE) to connect (disconnect) the left button to (from) the relay.</description>
          </attribute>

(This setting is available in the GUI)

Just to see if the settings work when using the native Aqara e1 hub, i’m going to connect it via the E1 hub.
I’ll also see if there is updated firmware.