-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
89 additions
and
0 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
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,12 @@ | ||
# SwitchBot Contact Sensor | ||
|
||
|Model Id|[W120150X](https://github.com/theengs/decoder/blob/development/src/devices/SBCS_json.h)| | ||
|-|-| | ||
|Brand|SwitchBot| | ||
|Model|Contact Sensor| | ||
|Short Description|Contact sensor| | ||
|Communication|BLE broadcast| | ||
|Frequency|2.4Ghz| | ||
|Power source|2 AAA| | ||
|Exchanged data|contact, movement, light level, scope tested, battery| | ||
|Encrypted|No| |
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 |
---|---|---|
|
@@ -80,6 +80,7 @@ class TheengsDecoder { | |
IBT_2X, | ||
RUUVITAG_RAWV1, | ||
RUUVITAG_RAWV2, | ||
SBCS, | ||
SBCU, | ||
SBMS, | ||
SBMT, | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
const char* _SBCS_json = "{\"brand\":\"SwitchBot\",\"model\":\"Contact Sensor\",\"model_id\":\"W120150X\",\"condition\":[\"servicedata\",\"=\",18,\"index\",0,\"64\",\"&\",\"uuid\",\"index\",0,\"0d00\"],\"properties\":{\"contact\":{\"condition\":[\"servicedata\",7,\"bit\",2,0],\"decoder\":[\"bit_static_value\",\"servicedata\",7,1,\"closed\",\"open\"]},\"_contact\":{\"condition\":[\"servicedata\",7,\"bit\",2,1],\"decoder\":[\"static_value\",\"timeout not closed\"]},\"movement\":{\"decoder\":[\"bit_static_value\",\"servicedata\",2,2,false,true]},\"lightlevel\":{\"decoder\":[\"bit_static_value\",\"servicedata\",7,0,\"dark\",\"bright\"]},\"scopetested\":{\"condition\":[\"servicedata\",2,\"bit\",3,0],\"decoder\":[\"static_value\",false]},\"batt\":{\"condition\":[\"servicedata\",4,\"bit\",3,0],\"decoder\":[\"value_from_hex_data\",\"servicedata\",4,2,false,false]},\"_batt\":{\"condition\":[\"servicedata\",4,\"bit\",3,1],\"decoder\":[\"value_from_hex_data\",\"servicedata\",4,2,false,false],\"post_proc\":[\"-\",128]}}}"; | ||
/*R""""( | ||
{ | ||
"brand":"SwitchBot", | ||
"model":"Contact Sensor", | ||
"model_id":"W120150X", | ||
"condition":["servicedata", "=", 18, "index", 0, "64", "&", "uuid", "index", 0, "0d00"], | ||
"properties":{ | ||
"contact":{ | ||
"condition":["servicedata", 7, "bit", 2, 0], | ||
"decoder":["bit_static_value", "servicedata", 7, 1, "closed", "open"] | ||
}, | ||
"_contact":{ | ||
"condition":["servicedata", 7, "bit", 2, 1], | ||
"decoder":["static_value", "timeout not closed"] | ||
}, | ||
"movement":{ | ||
"decoder":["bit_static_value", "servicedata", 2, 2, false, true] | ||
}, | ||
"lightlevel":{ | ||
"decoder":["bit_static_value", "servicedata", 7, 0, "dark", "bright"] | ||
}, | ||
"scopetested":{ | ||
"condition":["servicedata", 2, "bit", 3, 0], | ||
"decoder":["static_value", false] | ||
}, | ||
"batt":{ | ||
"condition":["servicedata", 4, "bit", 3, 0], | ||
"decoder":["value_from_hex_data", "servicedata", 4, 2, false, false] | ||
}, | ||
"_batt":{ | ||
"condition":["servicedata", 4, "bit", 3, 1], | ||
"decoder":["value_from_hex_data", "servicedata", 4, 2, false, false], | ||
"post_proc":["-", 128] | ||
} | ||
} | ||
})"""";*/ | ||
|
||
const char* _SBCS_json_props = "{\"properties\":{\"contact\":{\"unit\":\"string\",\"name\":\"contact\"},\"movement\":{\"unit\":\"status\",\"name\":\"movement\"},\"lightlevel\":{\"unit\":\"string\",\"name\":\"light level\"},\"scopetested\":{\"unit\":\"status\",\"name\":\"scope tested\"},\"batt\":{\"unit\":\"%\",\"name\":\"battery\"}}}"; | ||
/*R""""( | ||
{ | ||
"properties":{ | ||
"contact":{ | ||
"unit":"string", | ||
"name":"contact" | ||
}, | ||
"movement":{ | ||
"unit":"status", | ||
"name":"movement" | ||
}, | ||
"lightlevel":{ | ||
"unit":"string", | ||
"name":"light level" | ||
}, | ||
"scopetested":{ | ||
"unit":"status", | ||
"name":"scope tested" | ||
}, | ||
"batt":{ | ||
"unit":"%", | ||
"name":"battery" | ||
} | ||
} | ||
})"""";*/ |
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