-
Notifications
You must be signed in to change notification settings - Fork 508
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'swoopx/fp1'
- Loading branch information
Showing
7 changed files
with
317 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"schema": "resourceitem1.schema.json", | ||
"id": "state/presenceevent", | ||
"datatype": "String", | ||
"access": "R", | ||
"public": true, | ||
"description": "Describes what current activity is associated with the current presence state" | ||
} |
208 changes: 208 additions & 0 deletions
208
devices/xiaomi/xiaomi_rtczcgq11lm_fp1_presence_sensor.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,208 @@ | ||
{ | ||
"schema": "devcap1.schema.json", | ||
"manufacturername": "aqara", | ||
"modelid": "lumi.motion.ac01", | ||
"vendor": "Xiaomi", | ||
"product": "Aqara FP1 presence sensor RTCZCGQ11LM", | ||
"sleeper": false, | ||
"status": "Gold", | ||
"subdevices": [ | ||
{ | ||
"type": "$TYPE_PRESENCE_SENSOR", | ||
"restapi": "/sensors", | ||
"uuid": [ | ||
"$address.ext", | ||
"0x01", | ||
"0x0406" | ||
], | ||
"items": [ | ||
{ | ||
"name": "attr/id" | ||
}, | ||
{ | ||
"name": "attr/lastannounced" | ||
}, | ||
{ | ||
"name": "attr/lastseen" | ||
}, | ||
{ | ||
"name": "attr/manufacturername" | ||
}, | ||
{ | ||
"name": "attr/modelid" | ||
}, | ||
{ | ||
"name": "attr/name" | ||
}, | ||
{ | ||
"name": "attr/swversion", | ||
"read": { | ||
"at": "0x0006", | ||
"cl": "0x0000", | ||
"ep": 1, | ||
"fn": "zcl" | ||
}, | ||
"parse": { | ||
"at": "0x0006", | ||
"cl": "0x0000", | ||
"ep": 1, | ||
"eval": "Item.val = Attr.val", | ||
"fn": "zcl" | ||
} | ||
}, | ||
{ | ||
"name": "attr/type" | ||
}, | ||
{ | ||
"name": "attr/uniqueid" | ||
}, | ||
{ | ||
"name": "config/triggerdistance", | ||
"refresh.interval": 300, | ||
"parse": { | ||
"at": "0x0146", | ||
"cl": "0xfcc0", | ||
"ep": 1, | ||
"eval": "if (Attr.val == 0) { Item.val = 'far' } else if (Attr.val == 1) { Item.val = 'medium' } else if (Attr.val == 2) { Item.val = 'near' } else { Item.val = 'unknown' }", | ||
"fn": "zcl" | ||
}, | ||
"read": { | ||
"at": "0x0146", | ||
"cl": "0xfcc0", | ||
"ep": 1, | ||
"fn": "zcl" | ||
}, | ||
"write": { | ||
"at": "0x0146", | ||
"cl": "0xfcc0", | ||
"dt": "0x20", | ||
"ep": 1, | ||
"eval": "if (Item.val == 'far') { 0 } else if (Item.val == 'medium') { 1 } else if (Item.val == 'near') { 2 }", | ||
"fn": "zcl" | ||
}, | ||
"values": [ | ||
["\"far\"", "Someone approaching is detected on high distance"], | ||
["\"medium\"", "Someone approaching is detected on medium distance"], | ||
["\"near\"", "Someone approaching is detected on low distance"] | ||
], | ||
"default": "far" | ||
}, | ||
{ | ||
"name": "config/devicemode", | ||
"refresh.interval": 300, | ||
"parse": { | ||
"at": "0x0144", | ||
"cl": "0xfcc0", | ||
"ep": 1, | ||
"eval": "if (Attr.val == 0) { Item.val = 'undirected' } else if (Attr.val == 1) { Item.val = 'leftright' } else { Item.val = 'unknown' }", | ||
"fn": "zcl" | ||
}, | ||
"read": { | ||
"at": "0x0144", | ||
"cl": "0xfcc0", | ||
"ep": 1, | ||
"fn": "zcl" | ||
}, | ||
"write": { | ||
"at": "0x0144", | ||
"cl": "0xfcc0", | ||
"dt": "0x20", | ||
"ep": 1, | ||
"eval": "if (Item.val == 'undirected') { 0 } else if (Item.val == 'leftright') { 1 }", | ||
"fn": "zcl" | ||
}, | ||
"values": [ | ||
["\"undirected\"", "Undirected"], | ||
["\"leftright\"", "Left and right"] | ||
], | ||
"default": "undirected" | ||
}, | ||
{ | ||
"name": "config/on" | ||
}, | ||
{ | ||
"name": "config/reachable" | ||
}, | ||
{ | ||
"name": "config/resetpresence", | ||
"parse": { | ||
"at": "0xff07", | ||
"ep": 1, | ||
"eval": "Item.val = false", | ||
"fn": "xiaomi:special", | ||
"idx": "0x03" | ||
}, | ||
"write": { | ||
"at": "0x0157", | ||
"cl": "0xfcc0", | ||
"dt": "0x20", | ||
"ep": 1, | ||
"eval": "Item.val", | ||
"fn": "zcl" | ||
} | ||
}, | ||
{ | ||
"name": "config/sensitivity", | ||
"refresh.interval": 300, | ||
"parse": { | ||
"at": "0x010C", | ||
"cl": "0xfcc0", | ||
"ep": 1, | ||
"eval": "Item.val = Attr.val", | ||
"fn": "zcl" | ||
}, | ||
"read": { | ||
"at": "0x010C", | ||
"cl": "0xfcc0", | ||
"ep": 1, | ||
"fn": "zcl" | ||
}, | ||
"write": { | ||
"at": "0x010C", | ||
"cl": "0xfcc0", | ||
"dt": "0x20", | ||
"ep": 1, | ||
"eval": "Item.val", | ||
"fn": "zcl" | ||
}, | ||
"values": [ | ||
[1, "Low"], | ||
[2, "Medium"], | ||
[3, "High"] | ||
], | ||
"default": 3 | ||
}, | ||
{ | ||
"name": "state/lastupdated" | ||
}, | ||
{ | ||
"name": "state/presence", | ||
"read": { | ||
"fn": "none" | ||
}, | ||
"parse": { | ||
"at": "0x0143", | ||
"cl": "0xfcc0", | ||
"ep": 1, | ||
"eval": "(Attr.val != 0 && Attr.val != 1 && Attr.val != 3 && Attr.val != 5) ? Item.val = true : Item.val = false", | ||
"fn": "zcl" | ||
} | ||
}, | ||
{ | ||
"name": "state/presenceevent", | ||
"read": { | ||
"fn": "none" | ||
}, | ||
"parse": { | ||
"at": "0x0143", | ||
"cl": "0xfcc0", | ||
"ep": 1, | ||
"script": "xiaomi_rtczcgq11lm_presenceevent.js", | ||
"fn": "zcl" | ||
}, | ||
"default": "leave" | ||
} | ||
] | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
switch (Attr.val) { | ||
case 0: | ||
Item.val = "enter"; | ||
break; | ||
case 1: | ||
Item.val = "leave"; | ||
break; | ||
case 2: | ||
Item.val = "enterleft"; | ||
break; | ||
case 3: | ||
Item.val = "rightleave"; | ||
break; | ||
case 4: | ||
Item.val = "enterright"; | ||
break; | ||
case 5: | ||
Item.val = "leftleave"; | ||
break; | ||
case 6: | ||
Item.val = "approaching"; | ||
break; | ||
case 7: | ||
Item.val = "absenting"; | ||
break; | ||
case 8: | ||
Item.val = "8"; | ||
break; | ||
case 9: | ||
Item.val = "9"; | ||
break; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters