Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DDF for Aqara Dual Relay Module T2 (DCM-K01) #7847

Merged
merged 4 commits into from
Aug 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions devices/generic/subdevices/on_off_switch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"schema": "subdevice1.schema.json",
"type": "$TYPE_ON_OFF_SWITCH",
"name": "On/Off switch",
"restapi": "/lights",
"order": 11,
"uuid": [
"$address.ext",
"0x01"
],
"items": [
"state/on",
"state/reachable"
]
}
321 changes: 321 additions & 0 deletions devices/xiaomi/xiaomi_dcm-k01_t2_dual_relay.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,321 @@
{
"schema": "devcap1.schema.json",
"manufacturername": "$MF_AQARA",
"modelid": "lumi.switch.acn047",
"vendor": "Xiaomi",
"product": "Aqara Dual Relay Module T2 (DCM-K01)",
"sleeper": false,
"status": "Gold",
"subdevices": [
{
"type": "$TYPE_ON_OFF_SWITCH",
"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",
"parse": {
"at": "0x00F7",
"ep": "0x01",
"eval": "Item.val = '0.0.0_' + ('0000' + (Attr.val & 0xFF).toString()).slice(-4)",
"fn": "xiaomi:special",
"idx": "0x0D",
"mf": "0x115F"
},
"read": {
"fn": "none"
}
},
{
"name": "attr/type"
},
{
"name": "attr/uniqueid"
},
{
"name": "state/alert",
"default": "none"
},
{
"name": "state/on",
"refresh.interval": 300
},
{
"name": "state/reachable"
}
]
},
{
"type": "$TYPE_ON_OFF_SWITCH",
"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",
"parse": {
"at": "0x00F7",
"ep": "0x01",
"eval": "Item.val = '0.0.0_' + ('0000' + (Attr.val & 0xFF).toString()).slice(-4)",
"fn": "xiaomi:special",
"idx": "0x0D",
"mf": "0x115F"
},
"read": {
"fn": "none"
}
},
{
"name": "attr/type"
},
{
"name": "attr/uniqueid"
},
{
"name": "state/alert",
"default": "none"
},
{
"name": "state/on",
"refresh.interval": 300
},
{
"name": "state/reachable"
}
]
},
{
"type": "$TYPE_POWER_SENSOR",
"restapi": "/sensors",
"uuid": [
"$address.ext",
"0x15",
"0x000c"
],
"fingerprint": {
"profile": "0x0104",
"device": "0x0051",
"endpoint": "0x15",
"in": [
"0x000C",
"0x0000"
]
},
"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": "0x01",
"eval": "Item.val = '0.0.0_' + ('0000' + (Attr.val & 0xFF).toString()).slice(-4)",
"fn": "xiaomi:special",
"idx": "0x0D",
"mf": "0x115F"
},
"read": {
"fn": "none"
}
},
{
"name": "attr/type"
},
{
"name": "attr/uniqueid"
},
{
"name": "config/on"
},
{
"name": "config/reachable"
},
{
"name": "state/current",
"parse": {
"at": "0x00F7",
"ep": "0x01",
"eval": "Item.val = Math.round(Attr.val);",
"fn": "xiaomi:special",
"idx": "0x97",
"mf": "0x115F"
},
"read": {
"fn": "none"
}
},
{
"name": "state/lastupdated"
},
{
"name": "state/power",
"refresh.interval": 300,
"read": {
"at": "0x0055",
"cl": "0x000C",
"ep": "0x15",
"fn": "zcl:attr"
},
"parse": {
"at": "0x0055",
"cl": "0x000C",
"ep": "0x15",
"eval": "Item.val = Math.round(Attr.val);"
}
},
{
"name": "state/voltage",
"parse": {
"at": "0x00F7",
"ep": "0x01",
"eval": "Item.val = Math.round(Attr.val / 10);",
"fn": "xiaomi:special",
"idx": "0x96",
"mf": "0x115F"
},
"read": {
"fn": "none"
}
}
]
},
{
"type": "$TYPE_CONSUMPTION_SENSOR",
"restapi": "/sensors",
"uuid": [
"$address.ext",
"0x01",
"0xfcc0"
],
"fingerprint": {
"profile": "0x0104",
"device": "0x0000",
"endpoint": "0x01",
"in": [
"0x0000",
"0xFCC0"
]
},
"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": "0x01",
"eval": "Item.val = '0.0.0_' + ('0000' + (Attr.val & 0xFF).toString()).slice(-4)",
"fn": "xiaomi:special",
"idx": "0x0D",
"mf": "0x115F"
},
"read": {
"fn": "none"
}
},
{
"name": "attr/type"
},
{
"name": "attr/uniqueid"
},
{
"name": "config/on"
},
{
"name": "config/reachable"
},
{
"name": "state/consumption",
"parse": {
"at": "0x00F7",
"ep": "0x01",
"eval": "Item.val = Math.round(Attr.val * 1000);",
"fn": "xiaomi:special",
"idx": "0x95",
"mf": "0x115F"
},
"read": {
"fn": "none"
}
},
{
"name": "state/lastupdated"
}
]
}
]
}