-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initial decoder
- Loading branch information
Showing
5 changed files
with
58 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# SwitchBot Outdoor Meter | ||
|
||
|Model Id|[W340001X)](https://github.com/theengs/decoder/blob/development/src/devices/SBOT_json.h)| | ||
|-|-| | ||
|Brand|SwitchBot| | ||
|Model|Outdoor Meter| | ||
|Short Description|Indoor/Outdoor Thermometer and Hygrometer| | ||
|Communication|BLE broadcast| | ||
|Frequency|2.4Ghz| | ||
|Power source|2 AAA| | ||
|Exchanged data|temperature, humidity, 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 |
---|---|---|
|
@@ -90,6 +90,7 @@ class TheengsDecoder { | |
SBCU, | ||
SBMS, | ||
SBMT, | ||
SBOT, | ||
SBS1, | ||
SHT4X, | ||
SCD4X, | ||
|
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,37 @@ | ||
#include "common_props.h" | ||
|
||
const char* _SBOT_json = "{\"brand\":\"SwitchBot\",\"model\":\"Outdoor Meter\",\"model_id\":\"W340001X\",\"tag\":\"0102\",\"condition\":[\"servicedata\",\"=\",6,\"index\",0,\"77\",\"&\",\"uuid\",\"index\",0,\"fd3d\",\"&\",\"manufacturerdata\",\"=\",28],\"properties\":{\".cal\":{\"decoder\":[\"value_from_hex_data\",\"manufacturerdata\",21,1,false,false],\"post_proc\":[\"/\",10]},\"tempc\":{\"condition\":[\"manufacturerdata\",22,\"bit\",3,0],\"decoder\":[\"value_from_hex_data\",\"manufacturerdata\",22,2,true,false],\"post_proc\":[\"+\",\".cal\",\"*\",-1]},\"_tempc\":{\"condition\":[\"manufacturerdata\",22,\"bit\",3,1],\"decoder\":[\"value_from_hex_data\",\"manufacturerdata\",22,2,true,false],\"post_proc\":[\"+\",\".cal\",\"-\",128]},\"hum\":{\"decoder\":[\"value_from_hex_data\",\"manufacturerdata\",24,2,false,false],\"post_proc\":[\"&\",127]},\"batt\":{\"decoder\":[\"value_from_hex_data\",\"servicedata\",4,2,false,false],\"post_proc\":[\"&\",127]}}}"; | ||
/*R""""( | ||
{ | ||
"brand":"SwitchBot", | ||
"model":"Outdoor Meter", | ||
"model_id":"W340001X", | ||
"tag":"0102", | ||
"condition":["servicedata", "=", 6, "index", 0, "77", "&", "uuid", "index", 0, "fd3d", "&", "manufacturerdata", "=", 28], | ||
"properties":{ | ||
".cal":{ | ||
"decoder":["value_from_hex_data", "manufacturerdata", 21, 1, false, false], | ||
"post_proc":["/", 10] | ||
}, | ||
"tempc":{ | ||
"condition":["manufacturerdata", 22, "bit", 3, 0], | ||
"decoder":["value_from_hex_data", "manufacturerdata", 22, 2, true, false], | ||
"post_proc":["+", ".cal", "*", -1] | ||
}, | ||
"_tempc":{ | ||
"condition":["manufacturerdata", 22, "bit", 3, 1], | ||
"decoder":["value_from_hex_data", "manufacturerdata", 22, 2, true, false], | ||
"post_proc":["+", ".cal", "-", 128] | ||
}, | ||
"hum":{ | ||
"decoder":["value_from_hex_data", "manufacturerdata", 24, 2, false, false], | ||
"post_proc":["&", 127] | ||
}, | ||
"batt":{ | ||
"decoder":["value_from_hex_data", "servicedata", 4, 2, false, false], | ||
"post_proc":["&", 127] | ||
} | ||
} | ||
})"""";*/ | ||
|
||
const char* _SBOT_json_props = _common_BTH_props; |
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