Aqara relay t2 switch type / DDF modification

Dear all,

Could you please be so kind and help me with deconz aqara relay t2 settings?
How can I change switch type from on/off to rocker type. I have this relay connected to my garage door. In the Aqara application there were few options, like: on/off, dry, wet contact, rocker type, pulse mode.

Is there any way to set this up in deconz by update of DDF or in the Phoscon app?

I am running raspberry pi, conbee2 and latest deconz version.

Thank you in advance!

Hello, you have the “lumi.switch.acn047” ?
If yes, this option is missing on the DDF deconz-rest-plugin/devices/xiaomi/xiaomi_dcm-k01_t2_dual_relay.json at master · dresden-elektronik/deconz-rest-plugin · GitHub

Untested but from another DDF can try to add


        {
          "name": "config/clickmode",
          "refresh.interval": 300,
          "read": {
            "at": "0x000a",
            "cl": "0xfcc0",
            "ep": 1,
            "fn": "zcl:attr",
            "mf": "0x115f"
          },
          "parse": {
            "at": "0x000a",
            "cl": "0xfcc0",
            "ep": 1,
            "eval": "if (Attr.val == 1) { Item.val = 'rocker' } else if (Attr.val == 2) { Item.val = 'momentary' } else { Item.val = 'unknown' }",
            "fn": "zcl:attr",
            "mf": "0x115f"
          },
          "write": {
            "at": "0x000a",
            "cl": "0xfcc0",
            "dt": "0x20",
            "ep": 1,
            "eval": "if (Item.val == 'rocker') { 1 } else if (Item.val == 'momentary') { 2 } else { 'unknown' }",
            "fn": "zcl:attr",
            "mf": "0x115f"
          },
          "values": [
            ["\"momentary\"", "Momentary mode"],
            ["\"rocker\"", "Rocker mode"] 
          ],
          "default": "rocker"
        },

on the $TYPE_SWITCH

Hello
I haven’t been able to force the interlock on the T2; is there a solution? Thanks in advance.

If you don’t know how work DDF, the easier way is using the GUI, you can found the setting in the cluster 0xFCC0, attribute 0x000a

Thanks for your reply. Unfortunately, I don’t have a graphical interface. Is there a way to do it via API or some other method? Or how can I modify the DDF file?

Depend of OS.
You just need to edit the file with a text editor Aqara relay t2 switch type / DDF modification - #2 by Smanar so on normal OS it’s fast.
Then restart deconz, you will have a new setting to test called “config/clickmode”.

You can check if it have worked using Phoscon/help/API Information/sensors

Some third app make it visible else can use command line like.

curl -H 'Content-Type: application/json' -X PUT -d '{"clickmode": "rocker"}' http://IP/PORT/api/KEY/sensors/16/config

IP and PORT are the same used than for Phoscon, KEY is an API key.

I do have the clickmode rocker parameter, but what I want is interlock, so that when I activate one relay the other immediately cuts power. I’m using Debian and Jeedom.

Ha sorry,
So this one is attribute 0x02d0 (type 0x10) still on same cluster.

        {
          "name": "config/displayflipped",
          "refresh.interval": 3660,
          "read": {
            "at": "0x02d0 ",
            "cl": "0xFCC0",
            "ep": 1,
            "fn": "zcl:attr",
            "mf": "0x115F"
          },
          "parse": {
            "at": "0x02d0 ",
            "cl": "0xFCC0",
            "ep": 1,
            "eval": "Item.val = Attr.val;",
            "fn": "zcl:attr",
            "mf": "0x115F"
          },
          "write": {
            "at": "0x02d0 ",
            "cl": "0xFCC0",
            "dt": "0x10",
            "ep": 1,
            "eval": "Item.val",
            "fn": "zcl:attr",
            "mf": "0x115F"
          },
          "default": false
        },

But need to fnd a better field than “config/displayflipped” …

Thank you so much for your time.
Should I add it to the DDF?

And should I set it to “default enable”?
To avoid a major short circuit, I want to lock it on interlock.

Thank you so much!!!

I replaced the clickmode part in the DDF file with your code, and it works perfectly. Thanks again :slight_smile:

I m seing, I have make a typo, there is 1 more space in the attribute.
Have created a PR here Add support for Interlock by Smanar · Pull Request #8396 · dresden-elektronik/deconz-rest-plugin · GitHub

1 Like