forked from theengs/decoder
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SwitchBot Meter Pro (CO2) initial decoder
- Loading branch information
Showing
5 changed files
with
86 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 Meter Pro CO2 | ||
|
||
|Model Id|[W490001X](https://github.com/theengs/decoder/blob/development/src/devices/SBMP_json.h)| | ||
|-|-| | ||
|Brand|SwitchBot| | ||
|Model|Meter Pro CO2| | ||
|Short Description|Thermo-Hygrometer and CO2 Monitor| | ||
|Communication|BLE broadcast| | ||
|Frequency|2.4Ghz| | ||
|Power Source|2 AA| | ||
|Exchanged Data|temperature, humidity, carbon dioxide, 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 |
---|---|---|
|
@@ -101,6 +101,7 @@ class TheengsDecoder { | |
SBMS, | ||
SBMT, | ||
SBMT_M, | ||
SBMP, | ||
SBOT, | ||
SBOT_M, | ||
SBOT_S, | ||
|
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,68 @@ | ||
#include "common_props.h" | ||
|
||
const char* _SBMP_json = "{\"brand\":\"SwitchBot\",\"model\":\"Meter Pro CO2\",\"model_id\":\"W490001X\",\"tag\":\"0f02\",\"condition\":[\"uuid\",\"index\",0,\"fd3d\",\"&\",\"servicedata\",\"=\",6,\"index\",0,\"35\",\"&\",\"manufacturerdata\",\"=\",36,\"index\",0,\"6909\"],\"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]},\"co2\":{\"decoder\":[\"value_from_hex_data\",\"manufacturerdata\",30,4,false,false]},\"batt\":{\"decoder\":[\"value_from_hex_data\",\"servicedata\",4,2,false,false],\"post_proc\":[\"&\",127]},\"mac\":{\"decoder\":[\"mac_from_hex_data\",\"manufacturerdata\",4]}}}"; | ||
/*R""""( | ||
{ | ||
"brand":"SwitchBot", | ||
"model":"Meter Pro CO2", | ||
"model_id":"W490001X", | ||
"tag":"0f02", | ||
"condition":["uuid", "index", 0, "fd3d", "&", "servicedata", "=", 6, "index", 0, "35", "&", "manufacturerdata", "=", 36, "index", 0, "6909"], | ||
"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] | ||
}, | ||
"co2":{ | ||
"decoder":["value_from_hex_data", "manufacturerdata", 30, 4, false, false] | ||
}, | ||
"batt":{ | ||
"decoder":["value_from_hex_data", "servicedata", 4, 2, false, false], | ||
"post_proc":["&", 127] | ||
}, | ||
"mac":{ | ||
"decoder":["mac_from_hex_data", "manufacturerdata", 4] | ||
} | ||
} | ||
})"""";*/ | ||
|
||
const char* _SBMP_json_props = "{\"properties\":{\"tempc\":{\"unit\":\"°C\",\"name\":\"temperature\"},\"hum\":{\"unit\":\"%\",\"name\":\"humidity\"},\"co2\":{\"unit\":\"ppm\",\"name\":\"carbon_dioxide\"},\"batt\":{\"unit\":\"%\",\"name\":\"battery\"},\"mac\":{\"unit\":\"string\",\"name\":\"MAC address\"}}}"; | ||
/*R""""( | ||
{ | ||
"properties":{ | ||
"tempc":{ | ||
"unit":"°C", | ||
"name":"temperature" | ||
}, | ||
"hum":{ | ||
"unit":"%", | ||
"name":"humidity" | ||
}, | ||
"co2":{ | ||
"unit":"ppm", | ||
"name":"carbon_dioxide" | ||
}, | ||
"batt":{ | ||
"unit":"%", | ||
"name":"battery" | ||
}, | ||
"mac":{ | ||
"unit":"string", | ||
"name":"MAC address" | ||
} | ||
} | ||
})"""";*/ |
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