Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@
.CMakeFiles
.cmake
_skbuild
dist
dist
/.idea/*
2 changes: 2 additions & 0 deletions src/devices.h
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@
#include "devices/SBHT_003C_json.h"
#include "devices/SBHT_003C_ENCR_json.h"
#include "devices/VCH6003_json.h"
#include "devices/TH05F_json.h"


const char* _devices[][2] = {
Expand Down Expand Up @@ -289,4 +290,5 @@ const char* _devices[][2] = {
{_SBHT_003C_json, _SBHT_003C_json_props},
{_SBHT_003C_ENCR_json, _SBHT_003C_ENCR_json_props},
{_VCH6003_json, _VCH6003_json_props},
{_TH05F_json, _TH05F_json_props},
};
49 changes: 49 additions & 0 deletions src/devices/TH05F_json.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
// Decode information from Tuya TH05F (internal TH05Y - https://pvvx.github.io/TH05F/) running pvvx v2.1 firmware

const char* _TH05F_json = "{\"brand\":\"Tuya\",\"model\":\"TH05F Thermo-Hygrometer\",\"model_id\":\"TH05F\",\"tag\":\"0102\",\"condition\":[\"uuid\",\"index\",0,\"fcd2\",\"&\",\"name\",\"contain\",\"TH05F\"],\"properties\":{\"packet\":{\"condition\":[\"servicedata\",2,\"00\"],\"decoder\":[\"value_from_hex_data\",\"servicedata\",4,2,false,false]},\"tempc\":{\"condition\":[\"servicedata\",10,\"02\"],\"decoder\":[\"value_from_hex_data\",\"servicedata\",12,4,true,true],\"post_proc\":[\"/\",100]},\"hum\":{\"condition\":[\"servicedata\",16,\"03\"],\"decoder\":[\"value_from_hex_data\",\"servicedata\",18,4,true,false],\"post_proc\":[\"/\",100]},\"batt\":{\"condition\":[\"servicedata\",6,\"01\"],\"decoder\":[\"value_from_hex_data\",\"servicedata\",8,2,false,false]},\"volt\":{\"condition\":[\"servicedata\",22,\"0c\"],\"decoder\":[\"value_from_hex_data\",\"servicedata\",24,4,true,false],\"post_proc\":[\"/\",1000]}}}";
/*R""""(
{
"brand": "Tuya",
"model": "TH05F Thermo-Hygrometer",
"model_id": "TH05F",
"tag": "0102",
"condition": ["uuid", "index", 0, "fcd2", "&","name", "contain", "TH05F"],
"properties":{
"packet":{
"condition":["servicedata", 2, "00"],
"decoder":["value_from_hex_data", "servicedata", 4, 2, false, false]
},
"tempc":{
"condition":["servicedata", 10, "02"],
"decoder":["value_from_hex_data", "servicedata", 12, 4, true, true],
"post_proc":["/", 100]
},
"hum":{
"condition":["servicedata", 16, "03"],
"decoder":["value_from_hex_data", "servicedata", 18, 4, true, false],
"post_proc":["/", 100]
},
"batt":{
"condition":["servicedata", 6, "01"],
"decoder":["value_from_hex_data", "servicedata", 8, 2, false, false]
},
"volt":{
"condition":["servicedata", 22, "0c"],
"decoder":["value_from_hex_data", "servicedata", 24, 4, true, false],
"post_proc":["/", 1000]
}
}
}
)"""";*/


const char* _TH05F_json_props = "{\"properties\":{\"tempc\":{\"unit\":\"°C\",\"name\":\"temperature\"},\"hum\":{\"unit\":\"%\",\"name\":\"humidity\"},\"volt\":{\"unit\":\"V\",\"name\":\"voltage\"}}}";
/*R""""(
{
"properties": {
"tempc": { "unit": "°C", "name": "temperature" },
"hum": { "unit": "%", "name": "humidity" },
"volt": { "unit": "V", "name": "voltage" }
}
}
)"""";*/