There was an updated firmware. Just updated.
But i also realize my testing was faulty. I was testing the output switches. Not the input. Very dumb of me. I should not have been multitasking.
I’ll retest the latest DDF using the ddf that pointed to 0X01 and the fingerprint.
@Smanar
Ok new test with updated firmware and correct testing procedure.
Child lock settings work, with 0x0200 set to 0 the s1 and s2 switches are decoupled from the relays.
This is the addition i made to the original DDF and was used for testing S1 and S2 input switches.
{
"type": "$TYPE_SWITCH",
"restapi": "/sensors",
"uuid": [
"$address.ext",
"0x01",
"0x0012"
],
"fingerprint": {
"profile": "0x0104",
"device": "0x0000",
"endpoint": "0x01",
"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"
}
]
}
Here is my testing of S1 input switch:
debug.txt:1345:17:27:41:000 Websocket 192.168.84.125:62567 send message: {"attr":{"ddf_hash":null,"ddf_policy":"latest_prefer_stable","lastannounced":null,"lastseen":"2025-04-03T00:27Z","manufacturername":"Aqara","mode":1,"modelid":"**lumi.switch.acn047**","name":"Switch 34","nwkaddress":28619,"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)
debug.txt:1346:17:27:41:000 Websocket 192.168.84.151:37958 send message: {"attr":{"ddf_hash":null,"ddf_policy":"latest_prefer_stable","lastannounced":null,"lastseen":"2025-04-03T00:27Z","manufacturername":"Aqara","mode":1,"modelid":"**lumi.switch.acn047**","name":"Switch 34","nwkaddress":28619,"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)
debug.txt:1368:17:27:45:715 [INFO] - No button map for: **lumi.switch.acn047**, unicast to: 0x0000, endpoint: 0x01, cluster: MULTISTATE_INPUT (0x0012), command: ATTRIBUTE_REPORT (0x0A), payload: 5500210100, zclSeq: 32
debug.txt:1410:17:27:48:511 [INFO] - No button map for: **lumi.switch.acn047**, unicast to: 0x0000, endpoint: 0x01, cluster: MULTISTATE_INPUT (0x0012), command: ATTRIBUTE_REPORT (0x0A), payload: 5500210100, zclSeq: 34
debug.txt:1427:17:27:51:306 [INFO] - No button map for: **lumi.switch.acn047**, unicast to: 0x0000, endpoint: 0x01, cluster: MULTISTATE_INPUT (0x0012), command: ATTRIBUTE_REPORT (0x0A), payload: 5500210100, zclSeq: 36
debug.txt:1468:17:27:55:297 [INFO] - No button map for: **lumi.switch.acn047**, unicast to: 0x0000, endpoint: 0x01, cluster: MULTISTATE_INPUT (0x0012), command: ATTRIBUTE_REPORT (0x0A), payload: 5500210100, zclSeq: 38
debug.txt:1506:17:27:57:297 [INFO] - No button map for: **lumi.switch.acn047**, unicast to: 0x0000, endpoint: 0x01, cluster: MULTISTATE_INPUT (0x0012), command: ATTRIBUTE_REPORT (0x0A), payload: 5500210100, zclSeq: 40
debug.txt:1623:17:28:01:299 [INFO] - No button map for: **lumi.switch.acn047**, unicast to: 0x0000, endpoint: 0x01, cluster: MULTISTATE_INPUT (0x0012), command: ATTRIBUTE_REPORT (0x0A), payload: 5500210100, zclSeq: 42
Here is my testing of S2 input switch
debug.txt:1125:17:32:30:151 [INFO] - No button map for: lumi.switch.acn047, unicast to: 0x0000, endpoint: 0x01, cluster: XIAOMI (0xFCC0), command: ATTRIBUTE_REPORT (0x0A), payload: F2FF4119AA7513840E3C0741000F0C23010500100A2308000C640B2003, zclSeq: 43
debug.txt:1130:17:32:30:178 [INFO] - No button map for: lumi.switch.acn047, unicast to: 0x0000, endpoint: 0x01, cluster: XIAOMI (0xFCC0), command: ATTRIBUTE_REPORT (0x0A), payload: F2FF4119AA7513840F3B0741000F0C23010500100A2308000C640B2003, zclSeq: 44
debug.txt:1158:17:32:30:285 [INFO] - No button map for: lumi.switch.acn047, unicast to: 0x0000, endpoint: 0x01, cluster: XIAOMI (0xFCC0), command: ATTRIBUTE_REPORT (0x0A), payload: F2FF4119AA751384103A0741000F0C23010500100A2308000C640B2003, zclSeq: 45
debug.txt:1179:17:32:30:435 [INFO] - No button map for: lumi.switch.acn047, unicast to: 0x0000, endpoint: 0x01, cluster: XIAOMI (0xFCC0), command: ATTRIBUTE_REPORT (0x0A), payload: F2FF4119AA75138411390741000F0C23010500100A2308000C640B2003, zclSeq: 46
debug.txt:1300:17:32:38:752 [INFO] - No button map for: lumi.switch.acn047, unicast to: 0x0000, endpoint: 0x01, cluster: XIAOMI (0xFCC0), command: ATTRIBUTE_REPORT (0x0A), payload: F2FF4119AA75138423270741000F0C23010600100A2308000C640B2003, zclSeq: 64
debug.txt:1432:17:32:47:706 [INFO] - No button map for: lumi.switch.acn047, unicast to: 0x0000, endpoint: 0x02, cluster: MULTISTATE_INPUT (0x0012), command: ATTRIBUTE_REPORT (0x0A), payload: 5500210100, zclSeq: 66
debug.txt:1473:17:32:50:117 [INFO] - No button map for: lumi.switch.acn047, unicast to: 0x0000, endpoint: 0x02, cluster: MULTISTATE_INPUT (0x0012), command: ATTRIBUTE_REPORT (0x0A), payload: 5500210100, zclSeq: 68
debug.txt:1478:17:32:50:160 [INFO] - No button map for: lumi.switch.acn047, unicast to: 0x0000, endpoint: 0x01, cluster: XIAOMI (0xFCC0), command: ATTRIBUTE_REPORT (0x0A), payload: F2FF412FAA752984241007410025012300000000022100000323000000000423000000000523000000000A2308000C640B2003, zclSeq: 69
debug.txt:1491:17:32:51:312 [INFO] - No button map for: lumi.switch.acn047, unicast to: 0x0000, endpoint: 0x02, cluster: MULTISTATE_INPUT (0x0012), command: ATTRIBUTE_REPORT (0x0A), payload: 5500210100, zclSeq: 71
debug.txt:1552:17:32:54:117 [INFO] - No button map for: lumi.switch.acn047, unicast to: 0x0000, endpoint: 0x02, cluster: MULTISTATE_INPUT (0x0012), command: ATTRIBUTE_REPORT (0x0A), payload: 5500210100, zclSeq: 73
debug.txt:1602:17:32:56:912 [INFO] - No button map for: lumi.switch.acn047, unicast to: 0x0000, endpoint: 0x02, cluster: MULTISTATE_INPUT (0x0012), command: ATTRIBUTE_REPORT (0x0A), payload: 5500210100, zclSeq: 75
debug.txt:1615:17:32:58:113 [INFO] - No button map for: lumi.switch.acn047, unicast to: 0x0000, endpoint: 0x02, cluster: MULTISTATE_INPUT (0x0012), command: ATTRIBUTE_REPORT (0x0A), payload: 5500210100, zclSeq: 77
debug.txt:1651:17:33:00:108 [INFO] - No button map for: lumi.switch.acn047, unicast to: 0x0000, endpoint: 0x02, cluster: MULTISTATE_INPUT (0x0012), command: ATTRIBUTE_REPORT (0x0A), payload: 5500210100, zclSeq: 79
debug.txt:1708:17:33:12:811 [INFO] - No button map for: lumi.switch.acn047, unicast to: 0x0000, endpoint: 0x01, cluster: XIAOMI (0xFCC0), command: ATTRIBUTE_REPORT (0x0A), payload: F2FF4119AA75138425250741000F0C23010500100A2308000C640B2003, zclSeq: 80
So I think we will use
debug.txt:1427:17:27:51:306 [INFO] - No button map for: **lumi.switch.acn047**, unicast to: 0x0000, endpoint: 0x01, cluster: MULTISTATE_INPUT (0x0012), command: ATTRIBUTE_REPORT (0x0A), payload: 5500210100, zclSeq: 36
debug.txt:1473:17:32:50:117 [INFO] - No button map for: lumi.switch.acn047, unicast to: 0x0000, endpoint: 0x02, cluster: MULTISTATE_INPUT (0x0012), command: ATTRIBUTE_REPORT (0x0A), payload: 5500210100, zclSeq: 68
Now the complicated stuff.
You need to edit the file button_maps.json in /usr/share/deCONZ/devices/
and add this part where you want
"xiaomiT2Module" {
"vendor": "Xiaomi",
"doc": "Xiaomi Aqara T2 Module",
"modelids": ["lumi.switch.acn047"],
"map": [
[1, "0x01", "MULTISTATE_INPUT", "ATTRIBUTE_REPORT", "1", "S_BUTTON_1", "S_BUTTON_ACTION_SHORT_RELEASED", "B1"],
[1, "0x02", "MULTISTATE_INPUT", "ATTRIBUTE_REPORT", "1", "S_BUTTON_2", "S_BUTTON_ACTION_SHORT_RELEASED", "B2"],
]
},
I think it will be fine payload: 5500210100
so the attribute is 0055, the datatype 21 and the value 01 for both (the code take only 1 byte)
But Now I have a problem to add a command “config/clickmode” (to enable the decoupled mode) as you need 2 requests, and whith DDF we can do only one.
Perhaps we can put them in the “light” device, so you will have 1 request by endpoint, but not sure this field will be visible on the “light” sensor (there is no “config” field on “light” entry in deconz)
I made the change to the button_maps.json file.
I think you missed a : after the “xiaomiT2Module”.
I’m having trouble pairing the T2 module now though.
Should i keep my DDF as is or do i need to make changes to the DDF? remove the fingerprint section?
When i try and pair the t2 module now, it shows up in deconz and phoscon. But then loses connection when i try and read the lumi specific cluster. I’ve tried pairng three times and each time I see 2 lights show up in phoscon and 1 switch show up in phoscon. but when i go into deconz-gui and try to do anything like read the values in a cluster the device goes off line.
Apologies.
I think i was just having general aqara paring issues. Now resolved.
I did some of the tricks, like manually pressing the button on the switch while paring to get the module paired correctly with deCONZ.
So i have it paired with the updated button_maps.json file and my DDF edits.
In homekit there is one additional “Button” visible as well as two switches that control the relays. But only one button is showing up not two. Perhaps this has to be handled by homebridge-deconz now that the button/sensor is being exposed?
The button has configurable actions for it:
- single press
- double press
- long press
Should there be two of these “buttons” showing up?
I’ve confirmed that S1 and S2 input buttons require Child lock to be set to 0 for the switches to register events. When set to 0 i can see the button in phoscon show the button press action in the UI. It has to be set to 0 for the button to register being pressed.
This is what homebridge-deconz is seeing
{
“id”: “54EF441000B72FFA”,
“manufacturer”: “Aqara”,
“model”: “lumi.switch.acn047”,
“name”: “On Off switch 28”,
“resources”: [
“/lights/28”,
“/lights/29”,
“/sensors/47”,
“/sensors/48”,
“/sensors/49”
],
“settings”: {
“expose”: true,
“logLevel”: 2,
“serviceName”: “Switch”,
“wallSwitch”: false
},
“type”: “lights”,
“zigbee”: true
}
Here is the output of curl -X GET http://192.168.XX.X:8080/api/XXXXXXXX/sensors
{
“47”: {
“capabilities”: {
“sleeper”: false
},
“config”: {
“on”: true,
“reachable”: true
},
“ddf_hash”: null,
“ddf_policy”: “latest_prefer_stable”,
“ep”: 21,
“etag”: “05b39e2c9ad70dfa266ecdbcf5c41550”,
“lastannounced”: null,
“lastseen”: “2025-04-03T18:57Z”,
“manufacturername”: “Aqara”,
“modelid”: “lumi.switch.acn047”,
“name”: “Power 47”,
“nwkaddress”: 35317,
“state”: {
“current”: 0,
“lastupdated”: “2025-04-03T18:55:01.587”,
“power”: 0,
“voltage”: 0
},
“swversion”: null,
“type”: “ZHAPower”,
“uniqueid”: “54:ef:44:10:00:b7:2f:fa-15-000c”
},
“48”: {
“capabilities”: {
“sleeper”: false
},
“config”: {
“on”: true,
“reachable”: true
},
“ddf_hash”: null,
“ddf_policy”: “latest_prefer_stable”,
“ep”: 1,
“etag”: “05b39e2c9ad70dfa266ecdbcf5c41550”,
“lastannounced”: null,
“lastseen”: “2025-04-03T18:57Z”,
“manufacturername”: “Aqara”,
“modelid”: “lumi.switch.acn047”,
“name”: “Consumption 48”,
“nwkaddress”: 35317,
“state”: {
“consumption”: 0,
“lastupdated”: “none”
},
“swversion”: null,
“type”: “ZHAConsumption”,
“uniqueid”: “54:ef:44:10:00:b7:2f:fa-01-fcc0”
},
“49”: {
“capabilities”: {
“sleeper”: false
},
“config”: {
“on”: true,
“reachable”: true
},
“ddf_hash”: null,
“ddf_policy”: “latest_prefer_stable”,
“ep”: 1,
“etag”: “34abd485377de1a0e9c2fe3527608e2c”,
“lastannounced”: null,
“lastseen”: “2025-04-03T18:57Z”,
“manufacturername”: “Aqara”,
“mode”: 1,
“modelid”: “lumi.switch.acn047”,
“name”: “Switch 49”,
“nwkaddress”: 35317,
“state”: {
“buttonevent”: null,
“lastupdated”: “none”
},
“swversion”: null,
“type”: “ZHASwitch”,
“uniqueid”: “54:ef:44:10:00:b7:2f:fa-01-0012”
}
}
@Smanar
I also tested changing “switch mode” to enable “momentary” switch mode.
I’ve confirmed that it works. When i set 0x000a (switch mode) for endpoint 0x01 under the “lumi specific” cluster to a value of 2, the button registers only on release of the button press. When set to a value of 1 it registers both the press down and the release.
I read here your post on how to change that setting for the t2. I made the change manually in the deconz-gui. I did not change the DDF so not sure if the example you gave in the thread below would work for the t2 as i changed the value in 0x01.
Where have you see this device support single press, double press, long press ?
“buttonevent”: null,
There is a problem, this field need to be updated when you press a button, and the last value is stored.
You can use Phoscon/help/API information/sensors/49 to see the value.
Or in the events if you don’t have to much devices.
All button events, for all buttons will be visible here.
But if the value is not updated it mean I have made a mistake in the buttonmap file, you still have the same error message about the “button map” ?
and yes the previous code will work for you device too, but not possible to put it in the ZHAswitch entry, because you need to have them on 2 endpoints, and this entry work only for one.
Can try to put in “light” entry, but not sure it will be visible on all third app (as “config” is not standard on “light” device)
This is in HomeKit where I see it. Probably homebridge-deconz exposing this. Once the new ddf is part of deCONZ I’ll hopefully be able to work with @ebaauw to expose both buttons to HomeKit and then I can trigger events off of them.
This might be because I may have reset the device? re-paired it when I pulled that information.
Since yesterday I reset and repaired it. it’s now sensor 57. Button event and last updated are being updated. See below.
{
"capabilities": {
"sleeper": false
},
"config": {
"on": true,
"reachable": true
},
"ddf_hash": null,
"ddf_policy": "latest_prefer_stable",
"ep": 1,
"etag": "dec8aa8307892d492805628416fa564f",
"lastannounced": null,
"lastseen": "2025-04-04T16:25Z",
"manufacturername": "Aqara",
"mode": 1,
"modelid": "lumi.switch.acn047",
"name": "Switch 57",
"nwkaddress": 40368,
"state": {
"buttonevent": 1002,
"lastupdated": "2025-04-04T16:24:02.520"
},
"swversion": null,
"type": "ZHASwitch",
"uniqueid": "54:ef:44:10:00:b7:2f:fa-01-0012"
}
The switchmode value seems to only be in 0x01 under 0x000a. When I change the single value in deconz-gui it impacts both S1 and S2 input switches for me and makes them behave as momentary switches.
The childlock setting is available for each button. One in 0x01 and the other in 0x02. That decouples each “button”.
This mean button 1 released, if it work you will have 2002 if you press the second one.
The switchmode value seems to only be in 0x01 under 0x000a. When I change the single value in deconz-gui it impacts both S1 and S2 input switches for me and makes them behave as momentary switches.
The childlock setting is available for each button. One in 0x01 and the other in 0x02. That decouples each “button”.
So can put the config/switchmode in the ZHASwitch but not possible to put config/clickmode in this entry.
Button 2 is working and reporting presses as well.
{
"capabilities": {
"sleeper": false
},
"config": {
"on": true,
"reachable": true
},
"ddf_hash": null,
"ddf_policy": "latest_prefer_stable",
"ep": 1,
"etag": "564e35cdf382a64d3f164e0e0a66bf44",
"lastannounced": null,
"lastseen": "2025-04-06T21:08Z",
"manufacturername": "Aqara",
"mode": 1,
"modelid": "lumi.switch.acn047",
"name": "Switch 57",
"nwkaddress": 40368,
"state": {
"buttonevent": 2002,
"lastupdated": "2025-04-06T21:09:17.627"
},
"swversion": null,
"type": "ZHASwitch",
"uniqueid": "54:ef:44:10:00:b7:2f:fa-01-0012"
}
@Smanar
Thanks for all the help.
Do you think we have enough to update the next deconz version with the DDF changes outlined?
Add:
- type_switch sensor section to DDF
- config/switchmode, 0x000a in cluster 0xfcc0
- Add the button_maps.json changes
Sure the only problem for me is the “decoupled mode”. For the rest all is fine for me.
You want to make the PR or want I make it ?
We can make the PR as it, if an user want to use the decoupled mode, it will use the GUI.
All the rest is working.
I’m not too well versed with Github and the process for these PR’s.
If you could submit them I think it will all go much smoother.
Thank you @Smanar !
Done DDF, improve Aqara relay t2 switch by Smanar · Pull Request #8163 · dresden-elektronik/deconz-rest-plugin · GitHub
It’s on draft status, if all is ok for you , I will remove this state tommorow.
Thanks.
I did notice that in the ddf update you made it is pointing to 0x20 end point for the switchmode change.
Is that correct? I manually made the change to 0x10, cl 0xfcc0, at 0x000a. I didn’t see the option in 0x20. But I might not fully underhand the syntax and what “dt” represents. So it could be right.
Your change below:
“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’ }”,
On my end. Button presses for both s1 and s2 have been working fine. No issues. I see visual cue of them working in phoscon UI as well. The switch icon in phoscon shows two switches and I can see switch 1 and switch 2 show presses occurring in the phoscon UI.
I need to now work with Homebridge-deCONZ to have him whitelist stateless switches for the two new button actions. That way I can use them in HomeKit.
DT is the datatype, for the attribute 0x000a it’ a “Unsigned 8-bit integer” so 0x20.
I remove the draft status.