Skip to content

Commit

Permalink
Jaalee F525 fix
Browse files Browse the repository at this point in the history
Jaalee F525 calculation fix for temperature and humidity
  • Loading branch information
DigiH committed Jan 10, 2024
1 parent 2754689 commit 72fbf0f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/devices/JHT_F525_json.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#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.72,\"/\",65536,\"-\",46.85]},\"hum\":{\"decoder\":[\"value_from_hex_data\",\"manufacturerdata\",44,4,false,false],\"post_proc\":[\"*\",125.0,\"/\",65536,\"-\",6]},\"batt\":{\"decoder\":[\"value_from_hex_data\",\"manufacturerdata\",50,2,false,false]}}}";
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",
Expand All @@ -11,11 +11,11 @@ const char* _JHT_F525_json = "{\"brand\":\"Jaalee\",\"model\":\"TH sensor\",\"mo
"properties":{
"tempc":{
"decoder":["value_from_hex_data", "manufacturerdata", 40, 4, false],
"post_proc":["*", 175.72, "/", 65536, "-", 46.85]
"post_proc":["*", 175, "/", 65535, "-", 45]
},
"hum":{
"decoder":["value_from_hex_data", "manufacturerdata", 44, 4, false, false],
"post_proc":["*", 125.0, "/", 65536, "-", 6]
"post_proc":["*", 100, "/", 65535]
},
"batt":{
"decoder":["value_from_hex_data", "manufacturerdata", 50, 2, false, false]
Expand Down
5 changes: 4 additions & 1 deletion tests/BLE/test_ble.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,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\":24.5147998,\"tempf\":76.12663965,\"hum\":36.84286499,\"batt\":100}",
"{\"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\":\"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}",
Expand Down Expand Up @@ -886,6 +887,7 @@ const char* test_uuid[][4] = {
{"Qingping round sensor", "0xfdcd", "servicedata", "8816xxxxxxxxxxxx0104f4003b01020164"},
{"Qingping alarm clock", "0xfdcd", "servicedata", "081eaabbccddeeff0104d200fe01020164"},
{"Jaalee", "0xf525", "manufacturerdata", "4c000215ebefd08370a247c89837e7b5634df52567f857becb64"},
{"Jaalee", "0xf525", "manufacturerdata", "4c000215ebefd08370a247c89837e7b5634df5257420591acb64"},
{"Switchbot_Curtain 2", "0xfd3d", "servicedata", "63c011641104"},
{"BlueCharm BC08", "0xfeaa", "servicedata", "21010b0c1318000021fffdfc12"},
{"BlueCharm BC08", "0xfeaa", "servicedata", "21010b0c0df540ff95fe69fc80"},
Expand Down Expand Up @@ -1010,6 +1012,7 @@ TheengsDecoder::BLE_ID_NUM test_uuid_id_num[]{
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::SBCU,
TheengsDecoder::BLE_ID_NUM::BC08,
TheengsDecoder::BLE_ID_NUM::BC08,
Expand Down

0 comments on commit 72fbf0f

Please sign in to comment.