From 23d142ce1fed4be344f2dd6f075415fbce682062 Mon Sep 17 00:00:00 2001 From: bluemoehre Date: Wed, 16 Oct 2024 21:17:34 +0200 Subject: [PATCH] add DDF for aqara smart plug v45 --- .../xiaomi_sp-euc01_smart_plug.v45.json | 235 ++++++++++++++++++ 1 file changed, 235 insertions(+) create mode 100644 devices/xiaomi/xiaomi_sp-euc01_smart_plug.v45.json diff --git a/devices/xiaomi/xiaomi_sp-euc01_smart_plug.v45.json b/devices/xiaomi/xiaomi_sp-euc01_smart_plug.v45.json new file mode 100644 index 0000000000..9f3d9c754b --- /dev/null +++ b/devices/xiaomi/xiaomi_sp-euc01_smart_plug.v45.json @@ -0,0 +1,235 @@ +{ + "schema": "devcap1.schema.json", + "manufacturername": "$MF_LUMI", + "modelid": "lumi.plug.maeu01", + "vendor": "Xiaomi Aqara", + "product": "Smart plug (SP-EUC01)", + "sleeper": false, + "status": "Gold", + "comment": "DDF for device firmware >= v45", + "matchexpr": "(R.endpoints.indexOf(0x15) === -1) && (R.endpoints.indexOf(0x1F) === -1);", + "subdevices": [ + { + "type": "$TYPE_SMART_PLUG", + "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": "0x0001", + "cl": "0x0000", + "ep": 0, + "eval": "Item.val = Attr.val;" + }, + "read": { + "fn": "none" + } + }, + { + "name": "attr/type" + }, + { + "name": "attr/uniqueid" + }, + { + "name": "state/on", + "refresh.interval": 900 + }, + { + "name": "state/reachable" + } + ] + }, + { + "type": "$TYPE_POWER_SENSOR", + "restapi": "/sensors", + "uuid": [ + "$address.ext", + "0x15", + "0x000c" + ], + "fingerprint": { + "profile": "0x0104", + "device": "0x0051", + "endpoint": "0x15", + "in": [ + "0x000C" + ] + }, + "items": [ + { + "name": "attr/id" + }, + { + "name": "attr/lastannounced" + }, + { + "name": "attr/lastseen" + }, + { + "name": "attr/manufacturername" + }, + { + "name": "attr/modelid" + }, + { + "name": "attr/name" + }, + { + "name": "attr/swversion", + "parse": { + "at": "0x0001", + "cl": "0x0000", + "ep": 0, + "eval": "Item.val = Attr.val;" + }, + "read": { + "fn": "none" + } + }, + { + "name": "attr/type" + }, + { + "name": "attr/uniqueid" + }, + { + "name": "config/on" + }, + { + "name": "config/reachable" + }, + { + "name": "config/temperature" + }, + { + "name": "state/lastupdated" + }, + { + "name": "state/power", + "refresh.interval": 600, + "read": { + "at": "0x050b", + "cl": "0x0b04", + "ep": 0, + "fn": "zcl:attr" + }, + "parse": { + "at": "0x050b", + "cl": "0x0b04", + "ep": 0, + "eval": "if (Attr.val != -32768 && Attr.val != 32768) { Item.val = Attr.val / 10; }" + }, + "default": 0 + } + ] + }, + { + "type": "$TYPE_CONSUMPTION_SENSOR", + "restapi": "/sensors", + "uuid": [ + "$address.ext", + "0x01", + "0x0702" + ], + "fingerprint": { + "profile": "0x0104", + "device": "0x0051", + "endpoint": "0x01", + "in": [ + "0x0000", + "0x0702" + ] + }, + "items": [ + { + "name": "attr/id" + }, + { + "name": "attr/lastannounced" + }, + { + "name": "attr/lastseen" + }, + { + "name": "attr/manufacturername" + }, + { + "name": "attr/modelid" + }, + { + "name": "attr/name" + }, + { + "name": "attr/swversion", + "parse": { + "at": "0x0001", + "cl": "0x0000", + "ep": 0, + "eval": "Item.val = Attr.val;" + }, + "read": { + "fn": "none" + } + }, + { + "name": "attr/type" + }, + { + "name": "attr/uniqueid" + }, + { + "name": "config/on" + }, + { + "name": "config/reachable" + }, + { + "name": "config/temperature" + }, + { + "name": "state/consumption", + "refresh.interval": 10800, + "read": { + "at": "0x0000", + "cl": "0x0702", + "ep": 0, + "fn": "zcl:attr" + }, + "parse": { + "at": "0x0000", + "cl": "0x0702", + "ep": 0, + "eval": "Item.val = Attr.val" + }, + "default": 0 + }, + { + "name": "state/lastupdated" + } + ] + } + ] +}