diff --git a/docs/devices/JHT_F525.md b/docs/devices/JAALEE.md similarity index 63% rename from docs/devices/JHT_F525.md rename to docs/devices/JAALEE.md index da81f03d..aeeee2ee 100644 --- a/docs/devices/JHT_F525.md +++ b/docs/devices/JAALEE.md @@ -1,6 +1,6 @@ -# Jaalee TH sensor F525 +# Jaalee TH sensor F525/F51C -|Model Id|[F525](https://github.com/theengs/decoder/blob/development/src/devices/JHT_F525_json.h)| +|Model Id|[JAALEE](https://github.com/theengs/decoder/blob/development/src/devices/JAALEE_json.h)| |-|-| |Brand|Jaalee| |Model|TH sensor| diff --git a/src/decoder.h b/src/decoder.h index f57e4700..8f2532cd 100644 --- a/src/decoder.h +++ b/src/decoder.h @@ -133,7 +133,7 @@ class TheengsDecoder { TAGIT, TILE, TILEN, - JHT_F525, + JAALEE, APPLEWATCH, APPLEDEVICE, IBEACON, diff --git a/src/devices.h b/src/devices.h index 4ea3f889..82bb0aa3 100644 --- a/src/devices.h +++ b/src/devices.h @@ -93,7 +93,7 @@ #include "devices/BWBSDOO_json.h" #include "devices/BM2_json.h" #include "devices/BM6_json.h" -#include "devices/JHT_F525_json.h" +#include "devices/JAALEE_json.h" #include "devices/APPLEWATCH_json.h" #include "devices/APPLEDEVICE_json.h" #include "devices/iBeacon_json.h" @@ -199,7 +199,7 @@ const char* _devices[][2] = { {_tracker_json_tagit, _tracker_json_props}, {_tracker_json_tile, _tracker_json_props}, {_tracker_json_tilename, _tracker_json_props}, - {_JHT_F525_json, _JHT_F525_json_props}, + {_JAALEE_json, _JAALEE_json_props}, {_APPLEWATCH_json, _APPLEWATCH_json_props}, {_APPLEDEVICE_json, _APPLEDEVICE_json_props}, {_ibeacon_json, _ibeacon_json_props}, diff --git a/src/devices/JAALEE_json.h b/src/devices/JAALEE_json.h new file mode 100644 index 00000000..0bd7bd8b --- /dev/null +++ b/src/devices/JAALEE_json.h @@ -0,0 +1,26 @@ +#include "common_props.h" + +const char* _JAALEE_json = "{\"brand\":\"Jaalee\",\"model\":\"TH sensor\",\"model_id\":\"F525/F51C\",\"tag\":\"0102\",\"condition\":[\"uuid\",\"contain\",\"f525\",\"|\",\"uuid\",\"contain\",\"f51c\",\"&\",\"manufacturerdata\",\"=\",52],\"properties\":{\"tempc\":{\"decoder\":[\"value_from_hex_data\",\"manufacturerdata\",40,4,false],\"post_proc\":[\"*\",175,\"/\",65535,\"-\",45]},\"hum\":{\"decoder\":[\"value_from_hex_data\",\"manufacturerdata\",44,4,false,false],\"post_proc\":[\"*\",100,\"/\",65535]},\"batt\":{\"decoder\":[\"value_from_hex_data\",\"manufacturerdata\",50,2,false,false]}}}"; +/* R""""( +{ + "brand":"Jaalee", + "model":"TH sensor", + "model_id":"F525/F51C", + "tag":"0102", + "condition":["uuid", "contain", "f525", "|", "uuid", "contain", "f51c" , "&", "manufacturerdata", "=", 52], + "properties":{ + "tempc":{ + "decoder":["value_from_hex_data", "manufacturerdata", 40, 4, false], + "post_proc":["*", 175, "/", 65535, "-", 45] + }, + "hum":{ + "decoder":["value_from_hex_data", "manufacturerdata", 44, 4, false, false], + "post_proc":["*", 100, "/", 65535] + }, + "batt":{ + "decoder":["value_from_hex_data", "manufacturerdata", 50, 2, false, false] + } + } +})"""";*/ + +const char* _JAALEE_json_props = _common_BTH_props; diff --git a/src/devices/JHT_F525_json.h b/src/devices/JHT_F525_json.h deleted file mode 100644 index 70d50f84..00000000 --- a/src/devices/JHT_F525_json.h +++ /dev/null @@ -1,26 +0,0 @@ -#include "common_props.h" - -const char* _JHT_F525_json = "{\"brand\":\"Jaalee\",\"model\":\"TH sensor\",\"model_id\":\"F525\",\"tag\":\"0102\",\"condition\":[\"manufacturerdata\",\"=\",52,\"&\",\"uuid\",\"contain\",\"f525\"],\"properties\":{\"tempc\":{\"decoder\":[\"value_from_hex_data\",\"manufacturerdata\",40,4,false],\"post_proc\":[\"*\",175,\"/\",65535,\"-\",45]},\"hum\":{\"decoder\":[\"value_from_hex_data\",\"manufacturerdata\",44,4,false,false],\"post_proc\":[\"*\",100,\"/\",65535]},\"batt\":{\"decoder\":[\"value_from_hex_data\",\"manufacturerdata\",50,2,false,false]}}}"; -/* R""""( -{ - "brand":"Jaalee", - "model":"TH sensor", - "model_id":"F525", - "tag":"0102", - "condition":["manufacturerdata", "=", 52, "&", "uuid", "contain", "f525"], - "properties":{ - "tempc":{ - "decoder":["value_from_hex_data", "manufacturerdata", 40, 4, false], - "post_proc":["*", 175, "/", 65535, "-", 45] - }, - "hum":{ - "decoder":["value_from_hex_data", "manufacturerdata", 44, 4, false, false], - "post_proc":["*", 100, "/", 65535] - }, - "batt":{ - "decoder":["value_from_hex_data", "manufacturerdata", 50, 2, false, false] - } - } -})"""";*/ - -const char* _JHT_F525_json_props = _common_BTH_props; diff --git a/tests/BLE/test_ble.cpp b/tests/BLE/test_ble.cpp index b4c40f9a..2287b83e 100644 --- a/tests/BLE/test_ble.cpp +++ b/tests/BLE/test_ble.cpp @@ -297,8 +297,8 @@ const char* expected_uuid[] = { "{\"brand\":\"ClearGrass/Qingping\",\"model\":\"Round TH\",\"model_id\":\"CGG1\",\"type\":\"THB\",\"tempc\":23.5,\"tempf\":74.3,\"hum\":28.3,\"batt\":100,\"mac\":\"YY:YY:YY:YY:YY:YY\"}", "{\"brand\":\"ClearGrass/Qingping\",\"model\":\"Round TH\",\"model_id\":\"CGG1\",\"type\":\"THB\",\"tempc\":24.4,\"tempf\":75.92,\"hum\":31.5,\"batt\":100,\"mac\":\"XX:XX:XX:XX:XX:XX\"}", "{\"brand\":\"ClearGrass/Qingping\",\"model\":\"Alarm Clock\",\"model_id\":\"CGC1/CGD1\",\"type\":\"THB\",\"tempc\":21,\"tempf\":69.8,\"hum\":51,\"batt\":100,\"mac\":\"FF:EE:DD:CC:BB:AA\"}", - "{\"brand\":\"Jaalee\",\"model\":\"TH sensor\",\"model_id\":\"F525\",\"type\":\"THB\",\"acts\":true,\"tempc\":26.07347219,\"tempf\":78.93224994,\"hum\":34.27481498,\"batt\":100}", - "{\"brand\":\"Jaalee\",\"model\":\"TH sensor\",\"model_id\":\"F525\",\"type\":\"THB\",\"acts\":true,\"tempc\":34.38353552,\"tempf\":93.89036393,\"hum\":34.80582895,\"batt\":100}", + "{\"brand\":\"Jaalee\",\"model\":\"TH sensor\",\"model_id\":\"F525/F51C\",\"type\":\"THB\",\"acts\":true,\"tempc\":26.07347219,\"tempf\":78.93224994,\"hum\":34.27481498,\"batt\":100}", + "{\"brand\":\"Jaalee\",\"model\":\"TH sensor\",\"model_id\":\"F525/F51C\",\"type\":\"THB\",\"acts\":true,\"tempc\":34.38353552,\"tempf\":93.89036393,\"hum\":34.80582895,\"batt\":100}", "{\"brand\":\"SwitchBot\",\"model\":\"Curtain (2/3)\",\"model_id\":\"W070160X\",\"type\":\"WCVR\",\"acts\":true,\"moving\":false,\"position\":100,\"calibrated\":true,\"lightlevel\":1,\"batt\":17}", "{\"brand\":\"BlueCharm\",\"model\":\"Beacon 08/04P/021\",\"model_id\":\"KSensor\",\"type\":\"ACEL\",\"track\":true,\"tempc\":24,\"tempf\":75.2,\"accx\":33,\"accy\":-3,\"accz\":-1006,\"volt\":3.091}", "{\"brand\":\"BlueCharm\",\"model\":\"Beacon 08/04P/021\",\"model_id\":\"KSensor\",\"type\":\"ACEL\",\"track\":true,\"tempc\":-10.75,\"tempf\":12.65,\"accx\":-107,\"accy\":-407,\"accz\":-896,\"volt\":3.085}", @@ -339,6 +339,7 @@ const char* expected_uuid[] = { "{\"brand\":\"Xiaomi\",\"model\":\"MiLamp\",\"model_id\":\"MUE4094RT\",\"type\":\"CTMO\",\"cont\":true,\"motion\":true,\"darkness\":29}", "{\"brand\":\"Xiaomi\",\"model\":\"MiLamp\",\"model_id\":\"MUE4094RT\",\"type\":\"CTMO\",\"cont\":true,\"motion\":true,\"darkness\":2}", "{\"brand\":\"Xiaomi\",\"model\":\"MiLamp\",\"model_id\":\"MUE4094RT\",\"type\":\"CTMO\",\"cont\":true,\"mac\":\"AA:BB:CC:DD:EE:FF\"}", + "{\"brand\":\"Jaalee\",\"model\":\"TH sensor\",\"model_id\":\"F525/F51C\",\"type\":\"THB\",\"acts\":true,\"tempc\":24.39116503,\"tempf\":75.90409705,\"hum\":23.86816205,\"batt\":100}", }; const char* expected_mac_mfg[] = { @@ -928,6 +929,7 @@ const char* test_uuid[][4] = { {"MiLamp", "0xfe95", "servicedata", "4030dd031d0300010100"}, {"MiLamp", "0xfe95", "servicedata", "4030dd030203000101"}, {"MiLamp", "0xfe95", "servicedata", "3030dd0301ffeeddccbbaa0d"}, + {"Jaalee", "0xf51c", "manufacturerdata", "4c000215ebefd08370a247c89837e7b5634df52565823d1acc64"}, }; TheengsDecoder::BLE_ID_NUM test_uuid_id_num[]{ @@ -1014,8 +1016,8 @@ TheengsDecoder::BLE_ID_NUM test_uuid_id_num[]{ TheengsDecoder::BLE_ID_NUM::CGG1_STOCK, TheengsDecoder::BLE_ID_NUM::CGG1_STOCK, TheengsDecoder::BLE_ID_NUM::CGD1, - TheengsDecoder::BLE_ID_NUM::JHT_F525, - TheengsDecoder::BLE_ID_NUM::JHT_F525, + TheengsDecoder::BLE_ID_NUM::JAALEE, + TheengsDecoder::BLE_ID_NUM::JAALEE, TheengsDecoder::BLE_ID_NUM::SBCU, TheengsDecoder::BLE_ID_NUM::BC08, TheengsDecoder::BLE_ID_NUM::BC08, @@ -1056,6 +1058,7 @@ TheengsDecoder::BLE_ID_NUM test_uuid_id_num[]{ TheengsDecoder::BLE_ID_NUM::MUE4094RT, TheengsDecoder::BLE_ID_NUM::MUE4094RT, TheengsDecoder::BLE_ID_NUM::MUE4094RT, + TheengsDecoder::BLE_ID_NUM::JAALEE, }; // MAC manufacturer data test input [test name] [mac] [data]