Skip to content

Commit

Permalink
Govee H5108 probe thermometer
Browse files Browse the repository at this point in the history
  • Loading branch information
DigiH committed Nov 16, 2024
1 parent bf7d605 commit 565bcfc
Show file tree
Hide file tree
Showing 5 changed files with 60 additions and 0 deletions.
12 changes: 12 additions & 0 deletions docs/devices/H5108.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Govee H5108

|Model Id|[H5108](https://github.com/theengs/decoder/blob/development/src/devices/H5108_json.h)|
|-|-|
|Brand|Govee|
|Model|Smart Probe Thermometer|
|Short Description|Smart Probe Temperature monitor with LCD display|
|Communication|BLE broadcast|
|Frequency|2.4Ghz|
|Power Source|2 AAA|
|Exchanged Data|temperature, battery|
|Encrypted|No|
1 change: 1 addition & 0 deletions src/decoder.h
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ class TheengsDecoder {
H5074,
H5102,
H5106,
H5108,
H5179,
HHCCJCY10,
MUE4094RT,
Expand Down
2 changes: 2 additions & 0 deletions src/devices.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
#include "devices/H5074_json.h"
#include "devices/H5102_json.h"
#include "devices/H5106_json.h"
#include "devices/H5108_json.h"
#include "devices/H5179_json.h"
#include "devices/HHCCJCY10_json.h"
#include "devices/HHCCJCY01HHCC_json.h"
Expand Down Expand Up @@ -164,6 +165,7 @@ const char* _devices[][2] = {
{_H5074_json, _H5074_json_props},
{_H5102_json, _H5102_json_props},
{_H5106_json, _H5106_json_props},
{_H5108_json, _H5108_json_props},
{_H5179_json, _H5179_json_props},
{_HHCCJCY10_json, _HHCCJCY10_json_props},
{_MUE4094RT_json, _MUE4094RT_json_props},
Expand Down
30 changes: 30 additions & 0 deletions src/devices/H5108_json.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#include "common_props.h"

const char* _H5108_json = "{\"brand\":\"Govee\",\"model\":\"Smart Thermo-Hygrometer\",\"model_id\":\"H5108\",\"tag\":\"0103\",\"condition\":[\"name\",\"index\",0,\"GV5108\",\"&\",\"manufacturerdata\",\">=\",20,\"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]},\"batt\":{\"decoder\":[\"value_from_hex_data\",\"manufacturerdata\",14,2,false,false],\"post_proc\":[\"&\",127]}}}";

/* R""""(
{
"brand":"Govee",
"model":"Smart Thermo-Hygrometer",
"model_id":"H5108",
"tag":"0103",
"condition":["name", "index", 0, "GV5108","&", "manufacturerdata", ">=", 20, "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]
},
"batt":{
"decoder":["value_from_hex_data", "manufacturerdata", 14, 2, false, false],
"post_proc":["&", 127]
}
}
})"""";*/

const char* _H5108_json_props = _common_BTH_props;
15 changes: 15 additions & 0 deletions tests/BLE/test_ble.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,11 @@ const char* expected_mfg[] = {
"{\"brand\":\"Apple/Beats\",\"model\":\"AirPods (Pro)/Solo|Studio Buds\",\"model_id\":\"APPLEAIRPODS\",\"type\":\"AUDIO\",\"track\":true,\"prmac\":true,\"version\":\"AirPods Pro 2nd gen.\",\"color\":\"white\",\"status\":\"in ears\",\"batt_r\":100,\"batt_l\":100,\"batt_case\":100,\"charging_r\":false,\"charging_l\":false,\"charging_case\":false}",
"{\"brand\":\"Apple/Beats\",\"model\":\"AirPods (Pro)/Solo|Studio Buds\",\"model_id\":\"APPLEAIRPODS\",\"type\":\"AUDIO\",\"track\":true,\"prmac\":true,\"version\":\"AirPods Pro 2nd gen.\",\"color\":\"white\",\"status\":\"in ears\",\"batt_r\":90,\"batt_l\":100,\"batt_case\":100,\"charging_r\":false,\"charging_l\":false,\"charging_case\":false}",
"{\"brand\":\"Teltonika\",\"model\":\"FMT100\",\"model_id\":\"FMT100\",\"type\":\"TRACK\",\"acts\":true,\"track\":true,\"device\":\"FMT100 2G vehicle tracker\"}",
"{\"brand\":\"Govee\",\"model\":\"Smart Thermo-Hygrometer\",\"model_id\":\"H5108\",\"type\":\"THB\",\"cidc\":false,\"acts\":true,\"tempc\":23.4,\"tempf\":74.12,\"batt\":100}",
"{\"brand\":\"Govee\",\"model\":\"Smart Thermo-Hygrometer\",\"model_id\":\"H5108\",\"type\":\"THB\",\"cidc\":false,\"acts\":true,\"tempc\":2.2,\"tempf\":35.96,\"batt\":97}",
"{\"brand\":\"Govee\",\"model\":\"Smart Thermo-Hygrometer\",\"model_id\":\"H5108\",\"type\":\"THB\",\"cidc\":false,\"acts\":true,\"tempc\":1.7,\"tempf\":35.06,\"batt\":67}",
"{\"brand\":\"Govee\",\"model\":\"Smart Thermo-Hygrometer\",\"model_id\":\"H5108\",\"type\":\"THB\",\"cidc\":false,\"acts\":true,\"tempc\":-3.6,\"tempf\":25.52,\"batt\":35}",
"{\"brand\":\"Govee\",\"model\":\"Smart Thermo-Hygrometer\",\"model_id\":\"H5108\",\"type\":\"THB\",\"cidc\":false,\"acts\":true,\"tempc\":-8.4,\"tempf\":16.88,\"batt\":4}",
};

const char* expected_name_uuid_mfgsvcdata[] = {
Expand Down Expand Up @@ -694,6 +699,11 @@ const char* test_mfgdata[][3] = {
{"Apple", "AirPods", "4c00071901142023aa8f1100085925754da1d6ab3f80c398447e652875"},
{"Apple", "AirPods", "4c0007190114200b9a8f110004fa242ea8abb9e8f5e57cefb13a3077eb"},
{"Teltonika", "FMT100_3498163_LE", ""},
{"H5108", "GV51082A7E", "01000101039468640000"},
{"H5108", "GV51082A7E", "01000101005848610000"},
{"H5108", "GV51082A7E", "010001010044c0430000"},
{"H5108", "GV51082A7E", "01000101808ef8230000"},
{"H5108", "GV51082A7E", "01000101814a78040000"},
};

TheengsDecoder::BLE_ID_NUM test_mfgdata_id_num[]{
Expand Down Expand Up @@ -859,6 +869,11 @@ TheengsDecoder::BLE_ID_NUM test_mfgdata_id_num[]{
TheengsDecoder::BLE_ID_NUM::APPLEAIRPODS,
TheengsDecoder::BLE_ID_NUM::APPLEAIRPODS,
TheengsDecoder::BLE_ID_NUM::FMT100,
TheengsDecoder::BLE_ID_NUM::H5108,
TheengsDecoder::BLE_ID_NUM::H5108,
TheengsDecoder::BLE_ID_NUM::H5108,
TheengsDecoder::BLE_ID_NUM::H5108,
TheengsDecoder::BLE_ID_NUM::H5108,
};

// uuid test input [test name] [device name] [uuid] [manufacturer data] [service data]
Expand Down

0 comments on commit 565bcfc

Please sign in to comment.