Skip to content

Commit ef36e85

Browse files
authored
Govee H5179 new shorter braodcast name and manufacturerdata (#670)
1 parent 134cd7e commit ef36e85

4 files changed

Lines changed: 42 additions & 0 deletions

File tree

src/decoder.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ class TheengsDecoder {
9292
H5102,
9393
H5106,
9494
H5179,
95+
H5179_N,
9596
HHCCJCY10,
9697
MUE4094RT,
9798
NODONNIU,

src/devices.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,7 @@ const char* _devices[][2] = {
188188
{_H5102_json, _H5102_json_props},
189189
{_H5106_json, _H5106_json_props},
190190
{_H5179_json, _H5179_json_props},
191+
{_H5179_json_N, _H5179_json_props},
191192
{_HHCCJCY10_json, _HHCCJCY10_json_props},
192193
{_MUE4094RT_json, _MUE4094RT_json_props},
193194
{_NODONNIU_json, _NODONNIU_json_props},

src/devices/H5179_json.h

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,35 @@ const char* _H5179_json = "{\"brand\":\"Govee\",\"model\":\"Thermo-Hygrometer\",
2323
}
2424
})"""";*/
2525

26+
const char* _H5179_json_N = "{\"brand\":\"Govee\",\"model\":\"Thermo-Hygrometer\",\"model_id\":\"H5179_N\",\"tag\":\"0103\",\"condition\":[\"name\",\"index\",0,\"GV5179\",\"&\",\"manufacturerdata\",\">=\",16,\"index\",0,\"0100\"],\"properties\":{\"tempc\":{\"condition\":[\"manufacturerdata\",8,\"bit\",3,0],\"decoder\":[\"value_from_hex_data\",\"manufacturerdata\",8,6,false,false],\"post_proc\":[\"/\",1000,\">\",0,\"/\",10]},\"_tempc\":{\"condition\":[\"manufacturerdata\",8,\"bit\",3,1],\"decoder\":[\"value_from_hex_data\",\"manufacturerdata\",8,6,false,false],\"post_proc\":[\"&\",8388607,\"/\",1000,\">\",0,\"/\",10,\"*\",-1]},\"hum\":{\"condition\":[\"name\",\"not_contain\",\"GV5108\"],\"decoder\":[\"value_from_hex_data\",\"manufacturerdata\",8,6,false,false],\"post_proc\":[\"&\",8388607,\"%\",1000,\"/\",10]},\"batt\":{\"decoder\":[\"value_from_hex_data\",\"manufacturerdata\",14,2,false,false]}}}";
27+
28+
/* R""""(
29+
{
30+
"brand":"Govee",
31+
"model":"Thermo-Hygrometer",
32+
"model_id":"H5179_N",
33+
"tag":"0103",
34+
"condition":["name", "index", 0, "GV5179", "&", "manufacturerdata", ">=", 16, "index", 0, "0100"],
35+
"properties":{
36+
"tempc":{
37+
"condition":["manufacturerdata", 8, "bit", 3, 0],
38+
"decoder":["value_from_hex_data", "manufacturerdata", 8, 6, false, false],
39+
"post_proc":["/", 1000, ">", 0, "/", 10]
40+
},
41+
"_tempc":{
42+
"condition":["manufacturerdata", 8, "bit", 3, 1],
43+
"decoder":["value_from_hex_data", "manufacturerdata", 8, 6, false, false],
44+
"post_proc":["&", 8388607, "/", 1000, ">", 0, "/", 10, "*", -1]
45+
},
46+
"hum":{
47+
"condition":["name", "not_contain", "GV5108"],
48+
"decoder":["value_from_hex_data", "manufacturerdata", 8, 6, false, false],
49+
"post_proc":["&", 8388607, "%", 1000, "/", 10]
50+
},
51+
"batt":{
52+
"decoder":["value_from_hex_data", "manufacturerdata", 14, 2, false, false]
53+
}
54+
}
55+
})"""";*/
56+
2657
const char* _H5179_json_props = _common_BTH_props;

tests/BLE/test_ble.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,9 @@ const char* expected_mfg[] = {
225225
"{\"brand\":\"Inkbird\",\"model\":\"Pool Thermometer\",\"model_id\":\"IBS-P02B\",\"type\":\"THB\",\"cidc\":false,\"acts\":true,\"tempc\":22.1,\"tempf\":71.78,\"batt\":100,\"lowbatt\":false,\"displayunit\":\"°C\",\"mac\":\"AA:BB:CC:DD:EE:FF\"}",
226226
"{\"brand\":\"Inkbird\",\"model\":\"Pool Thermometer\",\"model_id\":\"IBS-P02B\",\"type\":\"THB\",\"cidc\":false,\"acts\":true,\"tempc\":24.3,\"tempf\":75.74,\"batt\":50,\"lowbatt\":false,\"displayunit\":\"°F\",\"mac\":\"AA:BB:CC:DD:EE:FF\"}",
227227
"{\"brand\":\"Inkbird\",\"model\":\"Pool Thermometer\",\"model_id\":\"IBS-P02B\",\"type\":\"THB\",\"cidc\":false,\"acts\":true,\"tempc\":22.7,\"tempf\":72.86,\"batt\":2,\"lowbatt\":true,\"displayunit\":\"°C\",\"mac\":\"AA:BB:CC:DD:EE:FF\"}",
228+
"{\"brand\":\"Govee\",\"model\":\"Thermo-Hygrometer\",\"model_id\":\"H5179_N\",\"type\":\"THB\",\"cidc\":false,\"acts\":true,\"tempc\":25.5,\"tempf\":77.9,\"hum\":43,\"batt\":100}",
229+
"{\"brand\":\"Govee\",\"model\":\"Thermo-Hygrometer\",\"model_id\":\"H5179_N\",\"type\":\"THB\",\"cidc\":false,\"acts\":true,\"tempc\":28.5,\"tempf\":83.3,\"hum\":6.8,\"batt\":100}",
230+
"{\"brand\":\"Govee\",\"model\":\"Thermo-Hygrometer\",\"model_id\":\"H5179_N\",\"type\":\"THB\",\"cidc\":false,\"acts\":true,\"tempc\":22.9,\"tempf\":73.22,\"hum\":56.4,\"batt\":100}",
228231
};
229232

230233
const char* expected_name_uuid_mfgsvcdata[] = {
@@ -800,6 +803,9 @@ const char* test_mfgdata[][3] = {
800803
{"Inkbird IBS-P02B", "IBS-P02B", "aabbccddeeffdd0000006400800000000000"},
801804
{"Inkbird IBS-P02B", "IBS-P02B", "aabbccddeefff30000003201800000000000"},
802805
{"Inkbird IBS-P02B", "IBS-P02B", "aabbccddeeffe30000000200801000000000"},
806+
{"H5179", "GV5179_1763", "0100010103e5c664"},
807+
{"H5179", "GV5179_1763", "0100010104598c64"},
808+
{"H5179", "GV5179_1763", "010001010380bc64"},
803809
};
804810

805811
TheengsDecoder::BLE_ID_NUM test_mfgdata_id_num[]{
@@ -1008,6 +1014,9 @@ TheengsDecoder::BLE_ID_NUM test_mfgdata_id_num[]{
10081014
TheengsDecoder::BLE_ID_NUM::IBS_P02B,
10091015
TheengsDecoder::BLE_ID_NUM::IBS_P02B,
10101016
TheengsDecoder::BLE_ID_NUM::IBS_P02B,
1017+
TheengsDecoder::BLE_ID_NUM::H5179_N,
1018+
TheengsDecoder::BLE_ID_NUM::H5179_N,
1019+
TheengsDecoder::BLE_ID_NUM::H5179_N,
10111020
};
10121021

10131022
// uuid test input [test name] [device name] [uuid] [manufacturer data] [service data]

0 commit comments

Comments
 (0)