mirror of
https://github.com/IoTManagerProject/IoTManager.git
synced 2026-03-26 22:22:16 +03:00
new Ble ver, 2 parts
This commit is contained in:
39
lib/decoder/include/shared/theengs.h
Normal file
39
lib/decoder/include/shared/theengs.h
Normal file
@@ -0,0 +1,39 @@
|
||||
/*
|
||||
TheengsDecoder - Decode things and devices
|
||||
|
||||
Copyright: (c)Florian ROBERT
|
||||
|
||||
This file is part of TheengsDecoder.
|
||||
|
||||
TheengsDecoder is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
TheengsDecoder is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef _THEENGS_H_
|
||||
#define _THEENGS_H_
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
void* Theengs_NewDecoder();
|
||||
void Theengs_DestroyDecoder(void* decoder);
|
||||
const char* Theengs_DecodeBLE(void* decoder, const char* json_data);
|
||||
const char* Theengs_GetProperties(void* decoder, const char* model_id);
|
||||
const char* Theengs_GetAttribute(void* decoder, const char* model_id, const char* attribute);
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // extern "C"
|
||||
#endif
|
||||
|
||||
#endif // _THEENGS_H_
|
||||
1112
lib/decoder/src/decoder.h
Normal file
1112
lib/decoder/src/decoder.h
Normal file
File diff suppressed because it is too large
Load Diff
245
lib/decoder/src/devices.h
Normal file
245
lib/decoder/src/devices.h
Normal file
@@ -0,0 +1,245 @@
|
||||
/*
|
||||
TheengsDecoder - Decode things and devices
|
||||
|
||||
Copyright: (c)Florian ROBERT
|
||||
|
||||
This file is part of TheengsDecoder.
|
||||
|
||||
TheengsDecoder is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
TheengsDecoder is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef _DEVICE_H_
|
||||
#define _DEVICE_H_
|
||||
|
||||
//ТАК странно сделано, что бы не менять порядок файлов и было проще отследить изменения в оригинальной библиотеке
|
||||
//#pragma once
|
||||
|
||||
#if defined(PART1_XIAOMI)
|
||||
#include "devices/CGD1_json.h"
|
||||
#include "devices/CGDK2_json.h"
|
||||
#include "devices/CGG1_json.h"
|
||||
#include "devices/CGDN1_json.h"
|
||||
#include "devices/CGH1_json.h"
|
||||
#include "devices/CGP1W_json.h"
|
||||
#include "devices/CGPR1_json.h"
|
||||
#endif
|
||||
#if defined(PART2_OTHER)
|
||||
#include "devices/GAEN_json.h"
|
||||
#include "devices/H5055_json.h"
|
||||
#include "devices/H5072_json.h"
|
||||
#include "devices/H5074_json.h"
|
||||
#include "devices/H5102_json.h"
|
||||
#include "devices/H5106_json.h"
|
||||
#include "devices/H5179_json.h"
|
||||
#endif
|
||||
#if defined(PART1_XIAOMI)
|
||||
#include "devices/HHCCJCY10_json.h"
|
||||
#include "devices/HHCCJCY01HHCC_json.h"
|
||||
#include "devices/HHCCPOT002_json.h"
|
||||
#include "devices/IBS_THBP01B_json.h"
|
||||
#include "devices/IBT_2X_json.h"
|
||||
#include "devices/IBT_4XS_json.h"
|
||||
#include "devices/IBT_6XS_SOLIS6_json.h"
|
||||
#include "devices/JQJCY01YM_json.h"
|
||||
#include "devices/LYWSD02_json.h"
|
||||
#include "devices/LYWSD03MMC_json.h"
|
||||
#include "devices/LYWSD03MMC_ENCR_json.h"
|
||||
#include "devices/LYWSDCGQ_json.h"
|
||||
#endif
|
||||
#if defined(PART2_OTHER)
|
||||
#include "devices/MBXPRO_json.h"
|
||||
#include "devices/MS_CDP_json.h"
|
||||
#endif
|
||||
#if defined(PART1_XIAOMI)
|
||||
#include "devices/MUE4094RT_json.h"
|
||||
#include "devices/Miband_json.h"
|
||||
#include "devices/XMTZC04HMKG_json.h"
|
||||
#include "devices/XMTZC04HMLB_json.h"
|
||||
#include "devices/XMTZC05HMKG_json.h"
|
||||
#include "devices/XMTZC05HMLB_json.h"
|
||||
#endif
|
||||
#if defined(PART2_OTHER)
|
||||
#include "devices/Mokobeacon_json.h"
|
||||
#include "devices/RDL52832_json.h"
|
||||
#include "devices/RuuviTag_RAWv1_json.h"
|
||||
#include "devices/RuuviTag_RAWv2_json.h"
|
||||
#include "devices/SBCS_json.h"
|
||||
#include "devices/SBCU_json.h"
|
||||
#include "devices/SBMS_json.h"
|
||||
#include "devices/SBMT_json.h"
|
||||
#include "devices/SBOT_json.h"
|
||||
#include "devices/SBS1_json.h"
|
||||
#include "devices/SHT4X_json.h"
|
||||
#include "devices/SCD4X_json.h"
|
||||
#include "devices/Skale_json.h"
|
||||
#include "devices/SmartDry_json.h"
|
||||
#include "devices/TPMS_json.h"
|
||||
#include "devices/KKM_K6P_json.h"
|
||||
#include "devices/KKM_K9_json.h"
|
||||
#include "devices/ThermoBeacon_json.h"
|
||||
#include "devices/ABN03_json.h"
|
||||
#include "devices/ABN07_json.h"
|
||||
#include "devices/ABTemp_json.h"
|
||||
#include "devices/Amphiro_json.h"
|
||||
#include "devices/OralB_json.h"
|
||||
#include "devices/PH10_json.h"
|
||||
#include "devices/TPTH_json.h"
|
||||
#include "devices/Mopeka_json.h"
|
||||
#include "devices/T201_json.h"
|
||||
#include "devices/T301_json.h"
|
||||
#include "devices/tracker_json.h"
|
||||
#include "devices/iNodeEM_json.h"
|
||||
#include "devices/BC08_json.h"
|
||||
#include "devices/BM1IN1_json.h"
|
||||
#include "devices/BM3IN1_json.h"
|
||||
#include "devices/BM4IN1_json.h"
|
||||
#include "devices/BPARASITE_json.h"
|
||||
#include "devices/BWBSDOO_json.h"
|
||||
#include "devices/BM2_json.h"
|
||||
#include "devices/BM6_json.h"
|
||||
#include "devices/JHT_F525_json.h"
|
||||
#include "devices/iBeacon_json.h"
|
||||
#endif
|
||||
#if defined(PART1_XIAOMI)
|
||||
#include "devices/APPLE_json.h"
|
||||
#include "devices/ServiceData_json.h"
|
||||
#endif
|
||||
#if defined(PART2_OTHER)
|
||||
#include "devices/SBBT_002C_json.h"
|
||||
#include "devices/SBBT_002C_ENCR_json.h"
|
||||
#include "devices/SBDW_002C_json.h"
|
||||
#include "devices/SBDW_002C_ENCR_json.h"
|
||||
#include "devices/SBMO_003Z_json.h"
|
||||
#include "devices/SBMO_003Z_ENCR_json.h"
|
||||
#endif
|
||||
|
||||
const char* _devices[][2] = {
|
||||
#if defined(PART1_XIAOMI)
|
||||
{_HHCCJCY01HHCC_json, _HHCCJCY01HHCC_json_props},
|
||||
{_LYWSD02_json, _LYWSD02_json_props},
|
||||
{_LYWSDCGQ_json, _LYWSDCGQ_json_props},
|
||||
{_CGP1W_json, _CGP1W_json_props},
|
||||
{_CGG1_json_STOCK, _CGG1_json_props},
|
||||
{_CGG1_json_ATC1441, _CGG1_json_props},
|
||||
{_CGG1_json_PVVX, _CGG1_json_props},
|
||||
{_CGG1_json_STOCK_2, _CGG1_json_props},
|
||||
{_CGDN1_json, _CGDN1_json_props},
|
||||
{_CGD1_json, _CGD1_json_props},
|
||||
{_CGDK2_json_STOCK, _CGDK2_json_props},
|
||||
{_CGDK2_json_PVVX, _CGDK2_json_props},
|
||||
{_CGDK2_json_ATC1441, _CGDK2_json_props},
|
||||
{_CGH1_json, _CGH1_json_props},
|
||||
{_JQJCY01YM_json, _JQJCY01YM_json_props},
|
||||
{_IBS_THBP01B_json, _IBS_THBP01B_json_props},
|
||||
{_IBT_2X_json_2X, _IBT_2X_json_props},
|
||||
{_IBT_2X_json_2XS, _IBT_2X_json_props},
|
||||
{_IBT_4XS_json, _IBT_4XS_json_props},
|
||||
{_IBT_6XS_SOLIS6_json, _IBT_6XS_SOLIS6_json_props},
|
||||
{_Miband_json, _Miband_json_props},
|
||||
{_XMTZC04HMKG_json, _XMTZC04HMKG_json_props},
|
||||
{_XMTZC04HMLB_json, _XMTZC04HMLB_json_props},
|
||||
{_XMTZC05HMKG_json, _XMTZC05HMKG_json_props},
|
||||
{_XMTZC05HMLB_json, _XMTZC05HMLB_json_props},
|
||||
#endif
|
||||
#if defined(PART2_OTHER)
|
||||
{_TPMS_json, _TPMS_json_props},
|
||||
{_KKM_K6P_json, _KKM_K6P_json_props},
|
||||
{_KKM_K9_json, _KKM_K9_json_props},
|
||||
#endif
|
||||
#if defined(PART1_XIAOMI)
|
||||
{_LYWSD03MMC_json_ATC, _LYWSD03MMC_json_props},
|
||||
{_LYWSD03MMC_json_PVVX, _LYWSD03MMC_json_props},
|
||||
{_LYWSD03MMC_json_PVVX_DECR, _LYWSD03MMC_json_props},
|
||||
{_LYWSD03MMC_ENCR_json_PVVX, _LYWSD03MMC_ENCR_json_props},
|
||||
{_CGPR1_json, _CGPR1_json_props},
|
||||
#endif
|
||||
#if defined(PART2_OTHER)
|
||||
{_ThermoBeacon_json, _ThermoBeacon_json_props},
|
||||
{_H5055_json, _H5055_json_props},
|
||||
{_H5072_json, _H5072_json_props},
|
||||
{_H5074_json, _H5074_json_props},
|
||||
{_H5102_json, _H5102_json_props},
|
||||
{_H5106_json, _H5106_json_props},
|
||||
{_H5179_json, _H5179_json_props},
|
||||
#endif
|
||||
#if defined(PART1_XIAOMI)
|
||||
{_HHCCJCY10_json, _HHCCJCY10_json_props},
|
||||
{_MUE4094RT_json, _MUE4094RT_json_props},
|
||||
#endif
|
||||
#if defined(PART2_OTHER)
|
||||
{_Mokobeacon_json, _Mokobeacon_json_props},
|
||||
{_MBXPRO_json, _MBXPRO_json_props},
|
||||
{_iNodeEM_json, _iNodeEM_json_props},
|
||||
{_RuuviTag_RAWv1_json, _RuuviTag_RAWv1_json_props},
|
||||
{_RuuviTag_RAWv2_json, _RuuviTag_RAWv2_json_props},
|
||||
{_SBCS_json, _SBCS_json_props},
|
||||
{_SBCU_json, _SBCU_json_props},
|
||||
{_SBMS_json, _SBMS_json_props},
|
||||
{_SBMT_json, _SBMT_json_props},
|
||||
{_SBOT_json, _SBOT_json_props},
|
||||
{_SBS1_json, _SBS1_json_props},
|
||||
{_SHT4X_json, _SHT4X_json_props},
|
||||
{_SCD4X_json, _SCD4X_json_props},
|
||||
{_Skale_json, _Skale_json_props},
|
||||
{_SmartDry_json, _SmartDry_json_props},
|
||||
{_BC08_json, _BC08_json_props},
|
||||
{_BM1IN1_json, _BM1IN1_json_props},
|
||||
{_BM3IN1_json, _BM3IN1_json_props},
|
||||
{_BM4IN1_json, _BM4IN1_json_props},
|
||||
{_MS_CDP_json, _MS_CDP_json_props},
|
||||
{_GAEN_json, _GAEN_json_props},
|
||||
#endif
|
||||
#if defined(PART1_XIAOMI)
|
||||
{_HHCCPOT002_json, _HHCCPOT002_json_props},
|
||||
#endif
|
||||
#if defined(PART2_OTHER)
|
||||
{_BPARASITE_json, _BPARASITE_json_props},
|
||||
{_BWBSDOO_json, _BWBSDOO_json_props},
|
||||
{_BM2_json, _BM2_json_props},
|
||||
{_BM6_json, _BM6_json_props},
|
||||
{_RDL52832_json, _RDL52832_json_props},
|
||||
{_ABN03_json, _ABN03_json_props},
|
||||
{_ABN07_json, _ABN07_json_props},
|
||||
{_ABTemp_json, _ABTemp_json_props},
|
||||
{_AMPHIRO_json, _AMPHIRO_json_props},
|
||||
{_OralB_json, _OralB_json_props},
|
||||
{_PH10_json, _PH10_json_props},
|
||||
{_TPTH_json, _TPTH_json_props},
|
||||
{_Mopeka_json, _Mopeka_json_props},
|
||||
{_T201_json, _T201_json_props},
|
||||
{_T301_json, _T301_json_props},
|
||||
{_tracker_json_nut, _tracker_json_props},
|
||||
{_tracker_json_itag, _tracker_json_props},
|
||||
{_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},
|
||||
{_ibeacon_json, _ibeacon_json_props},
|
||||
#endif
|
||||
#if defined(PART1_XIAOMI)
|
||||
{_APPLE_json, _APPLE_json_props},
|
||||
{_APPLE_json_at, _APPLE_json_props},
|
||||
{_ServiceData_json, _ServiceData_json_props},
|
||||
#endif
|
||||
#if defined(PART2_OTHER)
|
||||
{_SBBT_002C_json, _SBBT_002C_json_props},
|
||||
{_SBBT_002C_ENCR_json, _SBBT_002C_ENCR_json_props},
|
||||
{_SBDW_002C_json, _SBDW_002C_json_props},
|
||||
{_SBDW_002C_ENCR_json, _SBDW_002C_ENCR_json_props},
|
||||
{_SBMO_003Z_json, _SBMO_003Z_json_props},
|
||||
{_SBMO_003Z_ENCR_json, _SBMO_003Z_ENCR_json_props},
|
||||
#endif
|
||||
};
|
||||
|
||||
#endif
|
||||
55
lib/decoder/src/devices/ABN03_json.h
Normal file
55
lib/decoder/src/devices/ABN03_json.h
Normal file
@@ -0,0 +1,55 @@
|
||||
const char* _ABN03_json = "{\"brand\":\"April Brother\",\"model\":\"N03\",\"model_id\":\"ABN03\",\"tag\":\"0208\",\"condition\":[\"servicedata\",\"=\",30,\"index\",0,\"ab03\"],\"properties\":{\"tempc\":{\"decoder\":[\"value_from_hex_data\",\"servicedata\",18,4,true,true],\"post_proc\":[\"/\",8]},\"hum\":{\"decoder\":[\"value_from_hex_data\",\"servicedata\",22,4,true,false],\"post_proc\":[\"/\",2]},\"lux\":{\"decoder\":[\"value_from_hex_data\",\"servicedata\",26,4,true,false]},\"batt\":{\"decoder\":[\"value_from_hex_data\",\"servicedata\",16,2,false,false]},\"mac\":{\"decoder\":[\"mac_from_hex_data\",\"servicedata\",4]}}}";
|
||||
/* R""""(
|
||||
{
|
||||
"brand":"April Brother",
|
||||
"model":"N03",
|
||||
"model_id":"ABN03",
|
||||
"tag":"0208",
|
||||
"condition":["servicedata", "=", 30, "index", 0, "ab03"],
|
||||
"properties":{
|
||||
"tempc":{
|
||||
"decoder":["value_from_hex_data", "servicedata", 18, 4, true, true],
|
||||
"post_proc":["/", 8]
|
||||
},
|
||||
"hum":{
|
||||
"decoder":["value_from_hex_data", "servicedata", 22, 4, true, false],
|
||||
"post_proc":["/", 2]
|
||||
},
|
||||
"lux":{
|
||||
"decoder":["value_from_hex_data", "servicedata", 26, 4, true, false]
|
||||
},
|
||||
"batt":{
|
||||
"decoder":["value_from_hex_data", "servicedata", 16, 2, false, false]
|
||||
},
|
||||
"mac":{
|
||||
"decoder":["mac_from_hex_data", "servicedata", 4]
|
||||
}
|
||||
}
|
||||
})"""";*/
|
||||
|
||||
const char* _ABN03_json_props = "{\"properties\":{\"tempc\":{\"unit\":\"°C\",\"name\":\"temperature\"},\"hum\":{\"unit\":\"%\",\"name\":\"humidity\"},\"lux\":{\"unit\":\"lx\",\"name\":\"illuminance\"},\"batt\":{\"unit\":\"%\",\"name\":\"battery\"},\"mac\":{\"unit\":\"string\",\"name\":\"MAC address\"}}}";
|
||||
/*R""""(
|
||||
{
|
||||
"properties":{
|
||||
"tempc":{
|
||||
"unit":"°C",
|
||||
"name":"temperature"
|
||||
},
|
||||
"hum":{
|
||||
"unit":"%",
|
||||
"name":"humidity"
|
||||
},
|
||||
"lux":{
|
||||
"unit":"lx",
|
||||
"name":"illuminance"
|
||||
},
|
||||
"batt":{
|
||||
"unit":"%",
|
||||
"name":"battery"
|
||||
},
|
||||
"mac":{
|
||||
"unit":"string",
|
||||
"name":"MAC address"
|
||||
}
|
||||
}
|
||||
})"""";*/
|
||||
52
lib/decoder/src/devices/ABN07_json.h
Normal file
52
lib/decoder/src/devices/ABN07_json.h
Normal file
@@ -0,0 +1,52 @@
|
||||
const char* _ABN07_json = "{\"brand\":\"April Brother\",\"model\":\"N07\",\"model_id\":\"ABN07\",\"tag\":\"010a\",\"condition\":[\"servicedata\",\"=\",22,\"index\",0,\"40\",\"&\",\"uuid\",\"index\",0,\"fcd2\",\"&\",\"name\",\"index\",0,\"asensor_\"],\"properties\":{\"packet\":{\"condition\":[\"servicedata\",2,\"00\"],\"decoder\":[\"value_from_hex_data\",\"servicedata\",4,2,false,false]},\"batt\":{\"condition\":[\"servicedata\",6,\"01\"],\"decoder\":[\"value_from_hex_data\",\"servicedata\",8,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]}}}";
|
||||
/* R""""(
|
||||
{
|
||||
"brand":"April Brother",
|
||||
"model":"N07",
|
||||
"model_id":"ABN07",
|
||||
"tag":"010a",
|
||||
"condition":["servicedata", "=", 22, "index", 0, "40", "&", "uuid", "index", 0, "fcd2", "&", "name", "index", 0, "asensor_"],
|
||||
"properties":{
|
||||
"packet":{
|
||||
"condition":["servicedata", 2, "00"],
|
||||
"decoder":["value_from_hex_data", "servicedata", 4, 2, false, false]
|
||||
},
|
||||
"batt":{
|
||||
"condition":["servicedata", 6, "01"],
|
||||
"decoder":["value_from_hex_data", "servicedata", 8, 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]
|
||||
}
|
||||
}
|
||||
})"""";*/
|
||||
|
||||
const char* _ABN07_json_props = "{\"properties\":{\"packet\":{\"unit\":\"int\",\"name\":\"packet id\"},\"batt\":{\"unit\":\"%\",\"name\":\"battery\"},\"tempc\":{\"unit\":\"°C\",\"name\":\"temperature\"},\"hum\":{\"unit\":\"%\",\"name\":\"humidity\"}}}";
|
||||
/*R""""(
|
||||
{
|
||||
"properties":{
|
||||
"packet":{
|
||||
"unit":"int",
|
||||
"name":"packet id"
|
||||
},
|
||||
"batt":{
|
||||
"unit":"%",
|
||||
"name":"battery"
|
||||
},
|
||||
"tempc":{
|
||||
"unit":"°C",
|
||||
"name":"temperature"
|
||||
},
|
||||
"hum":{
|
||||
"unit":"%",
|
||||
"name":"humidity"
|
||||
}
|
||||
}
|
||||
})"""";*/
|
||||
68
lib/decoder/src/devices/ABTemp_json.h
Normal file
68
lib/decoder/src/devices/ABTemp_json.h
Normal file
@@ -0,0 +1,68 @@
|
||||
const char* _ABTemp_json = "{\"brand\":\"April Brother\",\"model\":\"ABTemp\",\"model_id\":\"ABTemp\",\"tag\":\"0608\",\"condition\":[\"manufacturerdata\",\"=\",50,\"index\",0,\"4c000215b5b182c7eab14988aa99b5c1517008d9\"],\"properties\":{\"mfid\":{\"decoder\":[\"string_from_hex_data\",\"manufacturerdata\",0,4]},\"uuid\":{\"decoder\":[\"string_from_hex_data\",\"manufacturerdata\",8,32]},\"major\":{\"decoder\":[\"value_from_hex_data\",\"manufacturerdata\",40,4,false]},\"batt\":{\"decoder\":[\"value_from_hex_data\",\"manufacturerdata\",44,2,false]},\"tempc\":{\"decoder\":[\"value_from_hex_data\",\"manufacturerdata\",46,2,false]},\"txpower\":{\"decoder\":[\"value_from_hex_data\",\"manufacturerdata\",48,2,false]},\"mac\":{\"condition\":[\"servicedata\",\"=\",22],\"decoder\":[\"revmac_from_hex_data\",\"servicedata\",0]}}}";
|
||||
/*R""""(
|
||||
{
|
||||
"brand":"April Brother",
|
||||
"model":"ABTemp",
|
||||
"model_id":"ABTemp",
|
||||
"tag":"0608",
|
||||
"condition":["manufacturerdata", "=", 50, "index", 0, "4c000215b5b182c7eab14988aa99b5c1517008d9"],
|
||||
"properties":{
|
||||
"mfid":{
|
||||
"decoder":["string_from_hex_data", "manufacturerdata", 0, 4]
|
||||
},
|
||||
"uuid":{
|
||||
"decoder":["string_from_hex_data", "manufacturerdata", 8, 32]
|
||||
},
|
||||
"major":{
|
||||
"decoder":["value_from_hex_data", "manufacturerdata", 40, 4, false]
|
||||
},
|
||||
"batt":{
|
||||
"decoder":["value_from_hex_data", "manufacturerdata", 44, 2, false]
|
||||
},
|
||||
"tempc":{
|
||||
"decoder":["value_from_hex_data", "manufacturerdata", 46, 2, false]
|
||||
},
|
||||
"txpower":{
|
||||
"decoder":["value_from_hex_data","manufacturerdata", 48, 2, false]
|
||||
},
|
||||
"mac":{
|
||||
"condition":["servicedata", "=", 22],
|
||||
"decoder":["revmac_from_hex_data", "servicedata", 0]
|
||||
}
|
||||
}
|
||||
})"""";*/
|
||||
|
||||
const char* _ABTemp_json_props = "{\"properties\":{\"mfid\":{\"unit\":\"hex\",\"name\":\"manufacturer id\"},\"uuid\":{\"unit\":\"hex\",\"name\":\"service uuid\"},\"major\":{\"unit\":\"hex\",\"name\":\"major value\"},\"batt\":{\"unit\":\"%\",\"name\":\"battery\"},\"tempc\":{\"unit\":\"°C\",\"name\":\"temperature\"},\"txpower\":{\"unit\":\"dBm\",\"name\":\"tx power @ 1 m\"},\"mac\":{\"unit\":\"string\",\"name\":\"MAC address\"}}}";
|
||||
/*R""""(
|
||||
{
|
||||
"properties":{
|
||||
"mfid":{
|
||||
"unit":"hex",
|
||||
"name":"manufacturer id"
|
||||
},
|
||||
"uuid":{
|
||||
"unit":"hex",
|
||||
"name":"service uuid"
|
||||
},
|
||||
"major":{
|
||||
"unit":"hex",
|
||||
"name":"major value"
|
||||
},
|
||||
"batt":{
|
||||
"unit":"%",
|
||||
"name":"battery"
|
||||
},
|
||||
"tempc":{
|
||||
"unit":"°C",
|
||||
"name":"temperature"
|
||||
},
|
||||
"txpower":{
|
||||
"unit":"dBm",
|
||||
"name":"tx power @ 1 m"
|
||||
},
|
||||
"mac":{
|
||||
"unit":"string",
|
||||
"name":"MAC address"
|
||||
}
|
||||
}
|
||||
})"""";*/
|
||||
40
lib/decoder/src/devices/APPLE_json.h
Normal file
40
lib/decoder/src/devices/APPLE_json.h
Normal file
@@ -0,0 +1,40 @@
|
||||
const char* _APPLE_json = "{\"brand\":\"Apple\",\"model\":\"Apple Continuity\",\"model_id\":\"APPLE_CONT\",\"tag\":\"fe\",\"condition\":[\"manufacturerdata\",\">=\",10,\"index\",0,\"4c000\",\"|\",\"manufacturerdata\",\">=\",10,\"index\",0,\"4c001\",\"&\",\"manufacturerdata\",\"<\",50],\"properties\":{\"device\":{\"decoder\":[\"static_value\",\"Apple device\"]}}}";
|
||||
/*R""""(
|
||||
{
|
||||
"brand":"Apple",
|
||||
"model":"Apple Continuity",
|
||||
"model_id":"APPLE_CONT",
|
||||
"tag":"fe",
|
||||
"condition":["manufacturerdata", ">=", 10, "index", 0, "4c000", "|", "manufacturerdata", ">=", 10, "index", 0, "4c001", "&", "manufacturerdata", "<", 50],
|
||||
"properties":{
|
||||
"device":{
|
||||
"decoder":["static_value", "Apple device"]
|
||||
}
|
||||
}
|
||||
})"""";*/
|
||||
|
||||
const char* _APPLE_json_at = "{\"brand\":\"Apple\",\"model\":\"Apple Continuity\",\"model_id\":\"APPLE_CONTAT\",\"tag\":\"fe\",\"condition\":[\"manufacturerdata\",\">\",50,\"index\",0,\"4c000\",\"|\",\"manufacturerdata\",\">\",50,\"index\",0,\"4c001\"],\"properties\":{\"device\":{\"decoder\":[\"static_value\",\"Apple device\"]}}}";
|
||||
/*R""""(
|
||||
{
|
||||
"brand":"Apple",
|
||||
"model":"Apple Continuity",
|
||||
"model_id":"APPLE_CONTAT",
|
||||
"tag":"fe",
|
||||
"condition":["manufacturerdata", ">", 50, "index", 0, "4c000", "|", "manufacturerdata", ">", 50, "index", 0, "4c001"],
|
||||
"properties":{
|
||||
"device":{
|
||||
"decoder":["static_value", "Apple device"]
|
||||
}
|
||||
}
|
||||
})"""";*/
|
||||
|
||||
const char* _APPLE_json_props = "{\"properties\":{\"device\":{\"unit\":\"string\",\"name\":\"device\"}}}";
|
||||
/*R""""(
|
||||
{
|
||||
"properties":{
|
||||
"device":{
|
||||
"unit":"string",
|
||||
"name":"device"
|
||||
}
|
||||
}
|
||||
})"""";*/
|
||||
55
lib/decoder/src/devices/Amphiro_json.h
Normal file
55
lib/decoder/src/devices/Amphiro_json.h
Normal file
@@ -0,0 +1,55 @@
|
||||
const char* _AMPHIRO_json = "{\"brand\":\"Oras\",\"model\":\"Hydractiva Digital\",\"model_id\":\"ADHS\",\"tag\":\"0c01\",\"condition\":[\"manufacturerdata\",\"=\",42,\"index\",0,\"eefa\"],\"properties\":{\"session\":{\"decoder\":[\"value_from_hex_data\",\"manufacturerdata\",4,6,false,false]},\"seconds\":{\"decoder\":[\"value_from_hex_data\",\"manufacturerdata\",10,4,false,false]},\"litres\":{\"decoder\":[\"value_from_hex_data\",\"manufacturerdata\",20,6,false,false],\"post_proc\":[\"/\",2560]},\"tempc\":{\"decoder\":[\"value_from_hex_data\",\"manufacturerdata\",26,2,false,false]},\"energy\":{\"decoder\":[\"value_from_hex_data\",\"manufacturerdata\",28,4,false,false],\"post_proc\":[\"/\",100]}}}";
|
||||
/*R""""(
|
||||
{
|
||||
"brand":"Oras",
|
||||
"model":"Hydractiva Digital",
|
||||
"model_id":"ADHS",
|
||||
"tag":"0c01",
|
||||
"condition":["manufacturerdata", "=", 42, "index", 0, "eefa"],
|
||||
"properties":{
|
||||
"session":{
|
||||
"decoder":["value_from_hex_data", "manufacturerdata", 4, 6, false, false]
|
||||
},
|
||||
"seconds":{
|
||||
"decoder":["value_from_hex_data", "manufacturerdata", 10, 4, false, false]
|
||||
},
|
||||
"litres":{
|
||||
"decoder":["value_from_hex_data", "manufacturerdata", 20, 6, false, false],
|
||||
"post_proc":["/", 2560]
|
||||
},
|
||||
"tempc":{
|
||||
"decoder":["value_from_hex_data", "manufacturerdata", 26, 2, false, false]
|
||||
},
|
||||
"energy":{
|
||||
"decoder":["value_from_hex_data", "manufacturerdata", 28, 4, false, false],
|
||||
"post_proc":["/", 100]
|
||||
}
|
||||
}
|
||||
})"""";*/
|
||||
|
||||
const char* _AMPHIRO_json_props = "{\"properties\":{\"session\":{\"unit\":\"int\",\"name\":\"session\"},\"seconds\":{\"unit\":\"s\",\"name\":\"duration\"},\"litres\":{\"unit\":\"L\",\"name\":\"volume\"},\"tempc\":{\"unit\":\"°C\",\"name\":\"temperature\"},\"energy\":{\"unit\":\"kWh\",\"name\":\"energy\"}}}";
|
||||
/*R""""(
|
||||
{
|
||||
"properties":{
|
||||
"session":{
|
||||
"unit":"int",
|
||||
"name":"session"
|
||||
},
|
||||
"seconds":{
|
||||
"unit":"s",
|
||||
"name":"duration"
|
||||
},
|
||||
"litres":{
|
||||
"unit":"L",
|
||||
"name":"volume"
|
||||
},
|
||||
"tempc": {
|
||||
"unit": "°C",
|
||||
"name": "temperature"
|
||||
},
|
||||
"energy":{
|
||||
"unit":"kWh",
|
||||
"name":"energy"
|
||||
}
|
||||
}
|
||||
})"""";*/
|
||||
59
lib/decoder/src/devices/BC08_json.h
Normal file
59
lib/decoder/src/devices/BC08_json.h
Normal file
@@ -0,0 +1,59 @@
|
||||
const char* _BC08_json = "{\"brand\":\"BlueCharm\",\"model\":\"Beacon 08/04P/021\",\"model_id\":\"KSensor\",\"tag\":\"0708\",\"condition\":[\"servicedata\",\"=\",26,\"index\",0,\"21010b\",\"&\",\"uuid\",\"index\",0,\"feaa\"],\"properties\":{\".cal\":{\"decoder\":[\"value_from_hex_data\",\"servicedata\",12,2,false,false],\"post_proc\":[\"/\",256,\"*\",100,\">\",0,\"/\",100]},\"tempc\":{\"decoder\":[\"value_from_hex_data\",\"servicedata\",10,2,false,true],\"post_proc\":[\"+\",\".cal\"]},\"accx\":{\"decoder\":[\"value_from_hex_data\",\"servicedata\",14,4,false,true]},\"accy\":{\"decoder\":[\"value_from_hex_data\",\"servicedata\",18,4,false,true]},\"accz\":{\"decoder\":[\"value_from_hex_data\",\"servicedata\",22,4,false,true]},\"volt\":{\"decoder\":[\"value_from_hex_data\",\"servicedata\",6,4,false,false],\"post_proc\":[\"/\",1000]}}}";
|
||||
/*R""""(
|
||||
{
|
||||
"brand":"BlueCharm",
|
||||
"model":"Beacon 08/04P/021",
|
||||
"model_id":"KSensor",
|
||||
"tag":"0708",
|
||||
"condition":["servicedata", "=", 26, "index", 0, "21010b", "&", "uuid", "index", 0, "feaa"],
|
||||
"properties":{
|
||||
".cal":{
|
||||
"decoder":["value_from_hex_data", "servicedata", 12, 2, false, false],
|
||||
"post_proc":["/", 256, "*", 100, ">", 0, "/", 100]
|
||||
},
|
||||
"tempc":{
|
||||
"decoder":["value_from_hex_data", "servicedata", 10, 2, false, true],
|
||||
"post_proc":["+", ".cal"]
|
||||
},
|
||||
"accx":{
|
||||
"decoder":["value_from_hex_data", "servicedata", 14, 4, false, true]
|
||||
},
|
||||
"accy":{
|
||||
"decoder":["value_from_hex_data", "servicedata", 18, 4, false, true]
|
||||
},
|
||||
"accz":{
|
||||
"decoder":["value_from_hex_data", "servicedata", 22, 4, false, true]
|
||||
},
|
||||
"volt":{
|
||||
"decoder":["value_from_hex_data", "servicedata", 6, 4, false, false],
|
||||
"post_proc":["/", 1000]
|
||||
}
|
||||
}
|
||||
})"""";*/
|
||||
|
||||
const char* _BC08_json_props = "{\"properties\":{\"tempc\":{\"unit\":\"°C\",\"name\":\"temperature\"},\"accx\":{\"unit\":\"m/s²\",\"name\":\"acceleration x\"},\"accy\":{\"unit\":\"m/s²\",\"name\":\"acceleration y\"},\"accz\":{\"unit\":\"m/s²\",\"name\":\"acceleration z\"},\"volt\":{\"unit\":\"V\",\"name\":\"voltage\"}}}";
|
||||
/*R""""(
|
||||
{
|
||||
"properties":{
|
||||
"tempc":{
|
||||
"unit":"°C",
|
||||
"name":"temperature"
|
||||
},
|
||||
"accx":{
|
||||
"unit":"m/s²",
|
||||
"name":"acceleration x"
|
||||
},
|
||||
"accy":{
|
||||
"unit":"m/s²",
|
||||
"name":"acceleration y"
|
||||
},
|
||||
"accz":{
|
||||
"unit":"m/s²",
|
||||
"name":"acceleration z"
|
||||
},
|
||||
"volt":{
|
||||
"unit":"V",
|
||||
"name":"voltage"
|
||||
}
|
||||
}
|
||||
})"""";*/
|
||||
33
lib/decoder/src/devices/BM1IN1_json.h
Normal file
33
lib/decoder/src/devices/BM1IN1_json.h
Normal file
@@ -0,0 +1,33 @@
|
||||
const char* _BM1IN1_json = "{\"brand\":\"Blue Maestro\",\"model\":\"Tempo Disc\",\"model_id\":\"TD1in1\",\"tag\":\"0108\",\"condition\":[\"manufacturerdata\",\"index\",4,\"0d\",\"&\",\"manufacturerdata\",\"=\",24,\"index\",0,\"3301\"],\"properties\":{\"tempc\":{\"decoder\":[\"value_from_hex_data\",\"manufacturerdata\",16,4,false,true],\"post_proc\":[\"/\",10]},\"batt\":{\"decoder\":[\"value_from_hex_data\",\"manufacturerdata\",6,2,false,false]}}}";
|
||||
/*R""""(
|
||||
{
|
||||
"brand":"Blue Maestro",
|
||||
"model":"Tempo Disc",
|
||||
"model_id":"TD1in1",
|
||||
"tag":"0108",
|
||||
"condition":["manufacturerdata", "index", 4, "0d", "&", "manufacturerdata", "=", 24, "index", 0, "3301"],
|
||||
"properties":{
|
||||
"tempc":{
|
||||
"decoder":["value_from_hex_data", "manufacturerdata", 16, 4, false, true],
|
||||
"post_proc":["/", 10]
|
||||
},
|
||||
"batt":{
|
||||
"decoder":["value_from_hex_data", "manufacturerdata", 6, 2, false, false]
|
||||
}
|
||||
}
|
||||
})"""";*/
|
||||
|
||||
const char* _BM1IN1_json_props = "{\"properties\":{\"tempc\":{\"unit\":\"°C\",\"name\":\"temperature\"},\"batt\":{\"unit\":\"%\",\"name\":\"battery\"}}}";
|
||||
/*R""""(
|
||||
{
|
||||
"properties": {
|
||||
"tempc": {
|
||||
"unit": "°C",
|
||||
"name": "temperature"
|
||||
},
|
||||
"batt": {
|
||||
"unit": "%",
|
||||
"name": "battery"
|
||||
}
|
||||
}
|
||||
})"""";*/
|
||||
33
lib/decoder/src/devices/BM2_json.h
Normal file
33
lib/decoder/src/devices/BM2_json.h
Normal file
@@ -0,0 +1,33 @@
|
||||
const char* _BM2_json = "{\"brand\":\"GENERIC\",\"model\":\"BM2 Battery Monitor\",\"model_id\":\"BM2\",\"tag\":\"0808\",\"condition\":[\"manufacturerdata\",\"=\",50,\"index\",0,\"4c000215655f83caae16a10a702e31f30d58dd82\"],\"properties\":{\"batt\":{\"decoder\":[\"value_from_hex_data\",\"manufacturerdata\",48,2,false]},\"device\":{\"decoder\":[\"static_value\",\"BM2 Tracker\"]}}}";
|
||||
|
||||
/*R""""(
|
||||
{
|
||||
"brand":"GENERIC",
|
||||
"model":"BM2 Battery Monitor",
|
||||
"model_id":"BM2",
|
||||
"tag":"0808",
|
||||
"condition":["manufacturerdata", "=", 50, "index", 0, "4c000215655f83caae16a10a702e31f30d58dd82"],
|
||||
"properties":{
|
||||
"batt":{
|
||||
"decoder":["value_from_hex_data", "manufacturerdata", 48, 2, false]
|
||||
},
|
||||
"device":{
|
||||
"decoder":["static_value", "BM2 Tracker"]
|
||||
}
|
||||
}
|
||||
})"""";*/
|
||||
|
||||
const char* _BM2_json_props = "{\"properties\":{\"batt\":{\"unit\":\"%\",\"name\":\"battery\"},\"device\":{\"unit\":\"string\",\"name\":\"tracker device\"}}}";
|
||||
/*R""""(
|
||||
{
|
||||
"properties":{
|
||||
"batt":{
|
||||
"unit":"%",
|
||||
"name":"battery"
|
||||
},
|
||||
"device":{
|
||||
"unit":"string",
|
||||
"name":"tracker device"
|
||||
}
|
||||
}
|
||||
})"""";*/
|
||||
49
lib/decoder/src/devices/BM3IN1_json.h
Normal file
49
lib/decoder/src/devices/BM3IN1_json.h
Normal file
@@ -0,0 +1,49 @@
|
||||
const char* _BM3IN1_json = "{\"brand\":\"Blue Maestro\",\"model\":\"Tempo Disc\",\"model_id\":\"TD3in1\",\"tag\":\"0208\",\"condition\":[\"manufacturerdata\",\"index\",4,\"16\",\"|\",\"manufacturerdata\",\"index\",4,\"17\",\"&\",\"manufacturerdata\",\"=\",32,\"index\",0,\"3301\"],\"properties\":{\"tempc\":{\"decoder\":[\"value_from_hex_data\",\"manufacturerdata\",16,4,false,true],\"post_proc\":[\"/\",10]},\"hum\":{\"decoder\":[\"value_from_hex_data\",\"manufacturerdata\",20,4,false,false],\"post_proc\":[\"/\",10]},\"tempc2_dp\":{\"decoder\":[\"value_from_hex_data\",\"manufacturerdata\",24,4,false,true],\"post_proc\":[\"/\",10]},\"batt\":{\"decoder\":[\"value_from_hex_data\",\"manufacturerdata\",6,2,false,false]}}}";
|
||||
/*R""""(
|
||||
{
|
||||
"brand":"Blue Maestro",
|
||||
"model":"Tempo Disc",
|
||||
"model_id":"TD3in1",
|
||||
"tag":"0208",
|
||||
"condition":["manufacturerdata", "index", 4, "16", "|", "manufacturerdata", "index", 4, "17", "&", "manufacturerdata", "=", 32, "index", 0, "3301"],
|
||||
"properties":{
|
||||
"tempc":{
|
||||
"decoder":["value_from_hex_data", "manufacturerdata", 16, 4, false, true],
|
||||
"post_proc":["/", 10]
|
||||
},
|
||||
"hum":{
|
||||
"decoder":["value_from_hex_data", "manufacturerdata", 20, 4, false, false],
|
||||
"post_proc":["/", 10]
|
||||
},
|
||||
"tempc2_dp":{
|
||||
"decoder":["value_from_hex_data", "manufacturerdata", 24, 4, false, true],
|
||||
"post_proc":["/", 10]
|
||||
},
|
||||
"batt":{
|
||||
"decoder":["value_from_hex_data", "manufacturerdata", 6, 2, false, false]
|
||||
}
|
||||
}
|
||||
})"""";*/
|
||||
|
||||
const char* _BM3IN1_json_props = "{\"properties\":{\"tempc\":{\"unit\":\"°C\",\"name\":\"temperature\"},\"hum\":{\"unit\":\"%\",\"name\":\"humidity\"},\"tempc2_dp\":{\"unit\":\"°C\",\"name\":\"dew point\"},\"batt\":{\"unit\":\"%\",\"name\":\"battery\"}}}";
|
||||
/*R""""(
|
||||
{
|
||||
"properties": {
|
||||
"tempc": {
|
||||
"unit": "°C",
|
||||
"name": "temperature"
|
||||
},
|
||||
"hum": {
|
||||
"unit": "%",
|
||||
"name": "humidity"
|
||||
},
|
||||
"tempc2_dp": {
|
||||
"unit": "°C",
|
||||
"name": "dew point"
|
||||
},
|
||||
"batt": {
|
||||
"unit": "%",
|
||||
"name": "battery"
|
||||
}
|
||||
}
|
||||
})"""";*/
|
||||
49
lib/decoder/src/devices/BM4IN1_json.h
Normal file
49
lib/decoder/src/devices/BM4IN1_json.h
Normal file
@@ -0,0 +1,49 @@
|
||||
const char* _BM4IN1_json = "{\"brand\":\"Blue Maestro\",\"model\":\"Tempo Disc\",\"model_id\":\"TD4in1\",\"tag\":\"0208\",\"condition\":[\"manufacturerdata\",\"index\",4,\"1b\",\"&\",\"manufacturerdata\",\"=\",32,\"index\",0,\"3301\"],\"properties\":{\"tempc\":{\"decoder\":[\"value_from_hex_data\",\"manufacturerdata\",16,4,false,true],\"post_proc\":[\"/\",10]},\"hum\":{\"decoder\":[\"value_from_hex_data\",\"manufacturerdata\",20,4,false,false],\"post_proc\":[\"/\",10]},\"pres\":{\"decoder\":[\"value_from_hex_data\",\"manufacturerdata\",24,4,false,false],\"post_proc\":[\"/\",10]},\"batt\":{\"decoder\":[\"value_from_hex_data\",\"manufacturerdata\",6,2,false,false]}}}";
|
||||
/*R""""(
|
||||
{
|
||||
"brand":"Blue Maestro",
|
||||
"model":"Tempo Disc",
|
||||
"model_id":"TD4in1",
|
||||
"tag":"0208",
|
||||
"condition":["manufacturerdata", "index", 4, "1b", "&", "manufacturerdata", "=", 32, "index", 0, "3301"],
|
||||
"properties":{
|
||||
"tempc":{
|
||||
"decoder":["value_from_hex_data", "manufacturerdata", 16, 4, false, true],
|
||||
"post_proc":["/", 10]
|
||||
},
|
||||
"hum":{
|
||||
"decoder":["value_from_hex_data", "manufacturerdata", 20, 4, false, false],
|
||||
"post_proc":["/", 10]
|
||||
},
|
||||
"pres":{
|
||||
"decoder":["value_from_hex_data", "manufacturerdata", 24, 4, false, false],
|
||||
"post_proc":["/", 10]
|
||||
},
|
||||
"batt":{
|
||||
"decoder":["value_from_hex_data", "manufacturerdata", 6, 2, false, false]
|
||||
}
|
||||
}
|
||||
})"""";*/
|
||||
|
||||
const char* _BM4IN1_json_props = "{\"properties\":{\"tempc\":{\"unit\":\"°C\",\"name\":\"temperature\"},\"hum\":{\"unit\":\"%\",\"name\":\"humidity\"},\"pres\":{\"unit\":\"hPa\",\"name\":\"pressure\"},\"batt\":{\"unit\":\"%\",\"name\":\"battery\"}}}";
|
||||
/*R""""(
|
||||
{
|
||||
"properties": {
|
||||
"tempc": {
|
||||
"unit": "°C",
|
||||
"name": "temperature"
|
||||
},
|
||||
"hum": {
|
||||
"unit": "%",
|
||||
"name": "humidity"
|
||||
},
|
||||
"pres":{
|
||||
"unit":"hPa",
|
||||
"name":"pressure"
|
||||
},
|
||||
"batt": {
|
||||
"unit": "%",
|
||||
"name": "battery"
|
||||
}
|
||||
}
|
||||
})"""";*/
|
||||
32
lib/decoder/src/devices/BM6_json.h
Normal file
32
lib/decoder/src/devices/BM6_json.h
Normal file
@@ -0,0 +1,32 @@
|
||||
const char* _BM6_json = "{\"brand\":\"GENERIC\",\"model\":\"BM6 Battery Monitor\",\"model_id\":\"BM6\",\"tag\":\"0808\",\"condition\":[\"manufacturerdata\",\"=\",50,\"index\",0,\"4c0002153ba29cd9a42c894856badaf2606ef777\"],\"properties\":{\"batt\":{\"decoder\":[\"value_from_hex_data\",\"manufacturerdata\",42,2,false]},\"device\":{\"decoder\":[\"static_value\",\"BM6 Tracker\"]}}}";
|
||||
/*R""""(
|
||||
{
|
||||
"brand":"GENERIC",
|
||||
"model":"BM6 Battery Monitor",
|
||||
"model_id":"BM6",
|
||||
"tag":"0808",
|
||||
"condition":["manufacturerdata", "=", 50, "index", 0, "4c0002153ba29cd9a42c894856badaf2606ef777"],
|
||||
"properties":{
|
||||
"batt":{
|
||||
"decoder":["value_from_hex_data", "manufacturerdata", 42, 2, false]
|
||||
},
|
||||
"device":{
|
||||
"decoder":["static_value", "BM6 Tracker"]
|
||||
}
|
||||
}
|
||||
})"""";*/
|
||||
|
||||
const char* _BM6_json_props = "{\"properties\":{\"batt\":{\"unit\":\"%\",\"name\":\"battery\"},\"device\":{\"unit\":\"string\",\"name\":\"tracker device\"}}}";
|
||||
/*R""""(
|
||||
{
|
||||
"properties":{
|
||||
"batt":{
|
||||
"unit":"%",
|
||||
"name":"battery"
|
||||
},
|
||||
"device":{
|
||||
"unit":"string",
|
||||
"name":"tracker device"
|
||||
}
|
||||
}
|
||||
})"""";*/
|
||||
72
lib/decoder/src/devices/BPARASITE_json.h
Normal file
72
lib/decoder/src/devices/BPARASITE_json.h
Normal file
@@ -0,0 +1,72 @@
|
||||
const char* _BPARASITE_json = "{\"brand\":\"rbaron\",\"model\":\"b-parasite\",\"model_id\":\"BPv1.0-1.2\",\"tag\":\"0904\",\"condition\":[\"servicedata\",\">=\",32,\"index\",0,\"1\",\"|\",\"servicedata\",\">=\",32,\"index\",0,\"2\",\"&\",\"uuid\",\"index\",0,\"181a\"],\"properties\":{\"tempc\":{\"condition\":[\"servicedata\",0,\"1\"],\"decoder\":[\"value_from_hex_data\",\"servicedata\",8,4,false,true],\"post_proc\":[\"/\",1000]},\"_tempc\":{\"condition\":[\"servicedata\",0,\"2\"],\"decoder\":[\"value_from_hex_data\",\"servicedata\",8,4,false,true],\"post_proc\":[\"/\",100]},\"hum\":{\"decoder\":[\"value_from_hex_data\",\"servicedata\",12,4,false,false],\"post_proc\":[\"/\",655.35]},\"moi\":{\"decoder\":[\"value_from_hex_data\",\"servicedata\",16,4,false,false],\"post_proc\":[\"/\",655.35]},\"lux\":{\"condition\":[\"servicedata\",1,\"bit\",0,1],\"decoder\":[\"value_from_hex_data\",\"servicedata\",32,4,false,false]},\"volt\":{\"decoder\":[\"value_from_hex_data\",\"servicedata\",4,4,false,false],\"post_proc\":[\"/\",1000]},\"mac\":{\"decoder\":[\"mac_from_hex_data\",\"servicedata\",20]}}}";
|
||||
|
||||
/* R""""(
|
||||
{
|
||||
"brand":"rbaron",
|
||||
"model":"b-parasite",
|
||||
"model_id":"BPv1.0-1.2",
|
||||
"tag":"0904",
|
||||
"condition":["servicedata", ">=", 32, "index", 0, "1", "|", "servicedata", ">=", 32, "index", 0, "2", "&", "uuid", "index", 0, "181a"],
|
||||
"properties":{
|
||||
"tempc":{
|
||||
"condition":["servicedata", 0, "1"],
|
||||
"decoder":["value_from_hex_data", "servicedata", 8, 4, false, true],
|
||||
"post_proc":["/", 1000]
|
||||
},
|
||||
"_tempc":{
|
||||
"condition":["servicedata", 0, "2"],
|
||||
"decoder":["value_from_hex_data", "servicedata", 8, 4, false, true],
|
||||
"post_proc":["/", 100]
|
||||
},
|
||||
"hum":{
|
||||
"decoder":["value_from_hex_data", "servicedata", 12, 4, false, false],
|
||||
"post_proc":["/", 655.35]
|
||||
},
|
||||
"moi":{
|
||||
"decoder":["value_from_hex_data", "servicedata", 16, 4, false, false],
|
||||
"post_proc":["/", 655.35]
|
||||
},
|
||||
"lux":{
|
||||
"condition":["servicedata", 1, "bit", 0, 1],
|
||||
"decoder":["value_from_hex_data", "servicedata", 32, 4, false, false]
|
||||
},
|
||||
"volt":{
|
||||
"decoder":["value_from_hex_data", "servicedata", 4, 4, false, false],
|
||||
"post_proc":["/", 1000]
|
||||
},
|
||||
"mac":{
|
||||
"decoder":["mac_from_hex_data", "servicedata", 20]
|
||||
}
|
||||
}
|
||||
})"""";*/
|
||||
|
||||
const char* _BPARASITE_json_props = "{\"properties\":{\"tempc\":{\"unit\":\"°C\",\"name\":\"temperature\"},\"hum\":{\"unit\":\"%\",\"name\":\"humidity\"},\"moi\":{\"unit\":\"%\",\"name\":\"moisture\"},\"lux\":{\"unit\":\"lx\",\"name\":\"illuminance\"},\"volt\":{\"unit\":\"V\",\"name\":\"voltage\"},\"mac\":{\"unit\":\"string\",\"name\":\"MAC address\"}}}";
|
||||
/*R""""(
|
||||
{
|
||||
"properties":{
|
||||
"tempc":{
|
||||
"unit":"°C",
|
||||
"name":"temperature"
|
||||
},
|
||||
"hum":{
|
||||
"unit":"%",
|
||||
"name":"humidity"
|
||||
},
|
||||
"moi":{
|
||||
"unit":"%",
|
||||
"name":"moisture"
|
||||
},
|
||||
"lux":{
|
||||
"unit":"lx",
|
||||
"name":"illuminance"
|
||||
},
|
||||
"volt":{
|
||||
"unit":"V",
|
||||
"name":"voltage"
|
||||
},
|
||||
"mac":{
|
||||
"unit":"string",
|
||||
"name":"MAC address"
|
||||
}
|
||||
}
|
||||
})"""";*/
|
||||
32
lib/decoder/src/devices/BWBSDOO_json.h
Normal file
32
lib/decoder/src/devices/BWBSDOO_json.h
Normal file
@@ -0,0 +1,32 @@
|
||||
const char* _BWBSDOO_json = "{\"brand\":\"Otio/BeeWi\",\"model\":\"Door & Window Sensor\",\"model_id\":\"BSDOO\",\"tag\":\"0405\",\"condition\":[\"manufacturerdata\",\"=\",14,\"index\",4,\"080c\"],\"properties\":{\"open\":{\"decoder\":[\"bit_static_value\",\"manufacturerdata\",9,0,false,true]},\"batt\":{\"decoder\":[\"value_from_hex_data\",\"manufacturerdata\",12,2,false,false]}}}";
|
||||
/*R""""(
|
||||
{
|
||||
"brand":"Otio/BeeWi",
|
||||
"model":"Door & Window Sensor",
|
||||
"model_id":"BSDOO",
|
||||
"tag":"0405",
|
||||
"condition":["manufacturerdata", "=", 14, "index", 4, "080c"],
|
||||
"properties":{
|
||||
"open":{
|
||||
"decoder":["bit_static_value", "manufacturerdata", 9, 0, false, true]
|
||||
},
|
||||
"batt":{
|
||||
"decoder":["value_from_hex_data", "manufacturerdata", 12, 2, false, false]
|
||||
}
|
||||
}
|
||||
})"""";*/
|
||||
|
||||
const char* _BWBSDOO_json_props = "{\"properties\":{\"open\":{\"unit\":\"status\",\"name\":\"door\"},\"batt\":{\"unit\":\"%\",\"name\":\"battery\"}}}";
|
||||
/*R""""(
|
||||
{
|
||||
"properties":{
|
||||
"open":{
|
||||
"unit":"status",
|
||||
"name":"door"
|
||||
},
|
||||
"batt":{
|
||||
"unit":"%",
|
||||
"name":"battery"
|
||||
}
|
||||
}
|
||||
})"""";*/
|
||||
31
lib/decoder/src/devices/CGD1_json.h
Normal file
31
lib/decoder/src/devices/CGD1_json.h
Normal file
@@ -0,0 +1,31 @@
|
||||
#include "common_props.h"
|
||||
|
||||
const char* _CGD1_json = "{\"brand\":\"ClearGrass/Qingping\",\"model\":\"Alarm Clock\",\"model_id\":\"CGC1/CGD1\",\"tag\":\"01\",\"condition\":[\"servicedata\",\"=\",34,\"index\",2,\"0c\",\"|\",\"servicedata\",\"=\",34,\"index\",2,\"1e\",\"&\",\"uuid\",\"index\",0,\"fdcd\"],\"properties\":{\"tempc\":{\"decoder\":[\"value_from_hex_data\",\"servicedata\",20,4,true,true],\"post_proc\":[\"/\",10]},\"hum\":{\"decoder\":[\"value_from_hex_data\",\"servicedata\",24,4,true,false],\"post_proc\":[\"/\",10]},\"batt\":{\"decoder\":[\"value_from_hex_data\",\"servicedata\",32,2,false,false],\"post_proc\":[\"&\",127]},\"mac\":{\"decoder\":[\"revmac_from_hex_data\",\"servicedata\",4]}}}";
|
||||
|
||||
/*R""""(
|
||||
{
|
||||
"brand":"ClearGrass/Qingping",
|
||||
"model":"Alarm Clock",
|
||||
"model_id":"CGC1/CGD1",
|
||||
"tag":"01",
|
||||
"condition":["servicedata", "=", 34, "index", 2, "0c", "|", "servicedata", "=", 34, "index", 2, "1e", "&", "uuid", "index", 0, "fdcd"],
|
||||
"properties":{
|
||||
"tempc":{
|
||||
"decoder":["value_from_hex_data", "servicedata", 20, 4, true, true],
|
||||
"post_proc":["/", 10]
|
||||
},
|
||||
"hum":{
|
||||
"decoder":["value_from_hex_data", "servicedata", 24, 4, true, false],
|
||||
"post_proc":["/", 10]
|
||||
},
|
||||
"batt":{
|
||||
"decoder":["value_from_hex_data", "servicedata", 32, 2, false, false],
|
||||
"post_proc":["&", 127]
|
||||
},
|
||||
"mac":{
|
||||
"decoder":["revmac_from_hex_data", "servicedata", 4]
|
||||
}
|
||||
}
|
||||
})"""";*/
|
||||
|
||||
const char* _CGD1_json_props = _common_BTHM_props;
|
||||
87
lib/decoder/src/devices/CGDK2_json.h
Normal file
87
lib/decoder/src/devices/CGDK2_json.h
Normal file
@@ -0,0 +1,87 @@
|
||||
#include "common_props.h"
|
||||
|
||||
const char* _CGDK2_json_STOCK = "{\"brand\":\"Qingping\",\"model\":\"TH Lite\",\"model_id\":\"CGDK2\",\"tag\":\"01\",\"condition\":[\"servicedata\",\"=\",34,\"index\",2,\"10\",\"&\",\"uuid\",\"index\",0,\"fdcd\"],\"properties\":{\"tempc\":{\"decoder\":[\"value_from_hex_data\",\"servicedata\",20,4,true],\"post_proc\":[\"/\",10]},\"hum\":{\"decoder\":[\"value_from_hex_data\",\"servicedata\",24,4,true,false],\"post_proc\":[\"/\",10]},\"mac\":{\"decoder\":[\"revmac_from_hex_data\",\"servicedata\",4]}}}";
|
||||
/*R""""(
|
||||
{
|
||||
"brand":"Qingping",
|
||||
"model":"TH Lite",
|
||||
"model_id":"CGDK2",
|
||||
"tag":"01",
|
||||
"condition":["servicedata", "=", 34, "index", 2, "10", "&", "uuid", "index", 0, "fdcd"],
|
||||
"properties":{
|
||||
"tempc":{
|
||||
"decoder":["value_from_hex_data", "servicedata", 20, 4, true],
|
||||
"post_proc":["/", 10]
|
||||
},
|
||||
"hum":{
|
||||
"decoder":["value_from_hex_data", "servicedata", 24, 4, true, false],
|
||||
"post_proc":["/", 10]
|
||||
},
|
||||
"mac":{
|
||||
"decoder":["revmac_from_hex_data", "servicedata", 4]
|
||||
}
|
||||
}
|
||||
})"""";*/
|
||||
|
||||
// ATC1441
|
||||
const char* _CGDK2_json_ATC1441 = "{\"brand\":\"ClearGrass/Qingping\",\"model\":\"TH Lite\",\"model_id\":\"CGDK2_ATC1441\",\"tag\":\"0102\",\"condition\":[\"servicedata\",\"=\",26,\"&\",\"uuid\",\"index\",0,\"181a\",\"&\",\"name\",\"index\",0,\"CGDK\"],\"properties\":{\"tempc\":{\"decoder\":[\"value_from_hex_data\",\"servicedata\",12,4,false],\"post_proc\":[\"/\",10]},\"hum\":{\"decoder\":[\"value_from_hex_data\",\"servicedata\",16,2,false]},\"batt\":{\"decoder\":[\"value_from_hex_data\",\"servicedata\",18,2,false]},\"volt\":{\"decoder\":[\"value_from_hex_data\",\"servicedata\",20,4,false],\"post_proc\":[\"/\",1000]},\"mac\":{\"decoder\":[\"mac_from_hex_data\",\"servicedata\",0]}}}";
|
||||
/* R""""(
|
||||
{
|
||||
"brand":"ClearGrass/Qingping",
|
||||
"model":"TH Lite",
|
||||
"model_id":"CGDK2_ATC1441",
|
||||
"tag":"0102",
|
||||
"condition":["servicedata", "=", 26, "&", "uuid", "index", 0, "181a", "&", "name", "index", 0, "CGDK"],
|
||||
"properties":{
|
||||
"tempc":{
|
||||
"decoder":["value_from_hex_data", "servicedata", 12, 4, false],
|
||||
"post_proc":["/", 10]
|
||||
},
|
||||
"hum":{
|
||||
"decoder":["value_from_hex_data", "servicedata", 16, 2, false]
|
||||
},
|
||||
"batt":{
|
||||
"decoder":["value_from_hex_data", "servicedata", 18, 2, false]
|
||||
},
|
||||
"volt":{
|
||||
"decoder":["value_from_hex_data", "servicedata", 20, 4, false],
|
||||
"post_proc":["/", 1000]
|
||||
},
|
||||
"mac":{
|
||||
"decoder":["mac_from_hex_data", "servicedata", 0]
|
||||
}
|
||||
}
|
||||
})"""";*/
|
||||
|
||||
// PVVX
|
||||
const char* _CGDK2_json_PVVX = "{\"brand\":\"ClearGrass/Qingping\",\"model\":\"TH Lite\",\"model_id\":\"CGDK2_PVVX\",\"tag\":\"0102\",\"condition\":[\"servicedata\",\"=\",30,\"&\",\"uuid\",\"index\",0,\"181a\",\"&\",\"name\",\"index\",0,\"CGDK\"],\"properties\":{\"tempc\":{\"decoder\":[\"value_from_hex_data\",\"servicedata\",12,4,true],\"post_proc\":[\"/\",100]},\"hum\":{\"decoder\":[\"value_from_hex_data\",\"servicedata\",16,4,true],\"post_proc\":[\"/\",100]},\"batt\":{\"decoder\":[\"value_from_hex_data\",\"servicedata\",24,2,false]},\"volt\":{\"decoder\":[\"value_from_hex_data\",\"servicedata\",20,4,true],\"post_proc\":[\"/\",1000]},\"mac\":{\"decoder\":[\"revmac_from_hex_data\",\"servicedata\",0]}}}";
|
||||
/* R""""(
|
||||
{
|
||||
"brand":"ClearGrass/Qingping",
|
||||
"model":"TH Lite",
|
||||
"model_id":"CGDK2_PVVX",
|
||||
"tag":"0102",
|
||||
"condition":["servicedata", "=", 30, "&", "uuid", "index", 0, "181a", "&", "name", "index", 0, "CGDK"],
|
||||
"properties":{
|
||||
"tempc":{
|
||||
"decoder":["value_from_hex_data", "servicedata", 12, 4, true],
|
||||
"post_proc":["/", 100]
|
||||
},
|
||||
"hum":{
|
||||
"decoder":["value_from_hex_data", "servicedata", 16, 4, true],
|
||||
"post_proc":["/", 100]
|
||||
},
|
||||
"batt":{
|
||||
"decoder":["value_from_hex_data", "servicedata", 24, 2, false]
|
||||
},
|
||||
"volt":{
|
||||
"decoder":["value_from_hex_data", "servicedata", 20, 4, true],
|
||||
"post_proc":["/", 1000]
|
||||
},
|
||||
"mac":{
|
||||
"decoder":["revmac_from_hex_data", "servicedata", 0]
|
||||
}
|
||||
}
|
||||
})"""";*/
|
||||
|
||||
const char* _CGDK2_json_props = _common_BVTH_props;
|
||||
55
lib/decoder/src/devices/CGDN1_json.h
Normal file
55
lib/decoder/src/devices/CGDN1_json.h
Normal file
@@ -0,0 +1,55 @@
|
||||
const char* _CGDN1_json = "{\"brand\":\"Qingping\",\"model\":\"Air Monitor Lite\",\"model_id\":\"CGDN1\",\"tag\":\"0f\",\"condition\":[\"servicedata\",\"=\",48,\"index\",2,\"0e\",\"|\",\"servicedata\",\"=\",48,\"index\",2,\"24\",\"&\",\"uuid\",\"index\",0,\"fdcd\"],\"properties\":{\"tempc\":{\"decoder\":[\"value_from_hex_data\",\"servicedata\",20,4,true,false],\"post_proc\":[\"/\",10]},\"hum\":{\"decoder\":[\"value_from_hex_data\",\"servicedata\",24,4,true,false],\"post_proc\":[\"/\",10]},\"pm25\":{\"decoder\":[\"value_from_hex_data\",\"servicedata\",32,4,true,false]},\"pm10\":{\"decoder\":[\"value_from_hex_data\",\"servicedata\",36,4,true,false]},\"co2\":{\"decoder\":[\"value_from_hex_data\",\"servicedata\",44,4,true,false]}}}";
|
||||
/*R""""(
|
||||
{
|
||||
"brand":"Qingping",
|
||||
"model":"Air Monitor Lite",
|
||||
"model_id":"CGDN1",
|
||||
"tag":"0f",
|
||||
"condition":["servicedata", "=", 48, "index", 2, "0e", "|", "servicedata", "=", 48, "index", 2, "24", "&", "uuid", "index", 0, "fdcd"],
|
||||
"properties":{
|
||||
"tempc":{
|
||||
"decoder":["value_from_hex_data", "servicedata", 20, 4, true, false],
|
||||
"post_proc":["/", 10]
|
||||
},
|
||||
"hum":{
|
||||
"decoder":["value_from_hex_data", "servicedata", 24, 4, true, false],
|
||||
"post_proc":["/", 10]
|
||||
},
|
||||
"pm25":{
|
||||
"decoder":["value_from_hex_data", "servicedata", 32, 4, true, false]
|
||||
},
|
||||
"pm10":{
|
||||
"decoder":["value_from_hex_data", "servicedata", 36, 4, true, false]
|
||||
},
|
||||
"co2":{
|
||||
"decoder":["value_from_hex_data", "servicedata", 44, 4, true, false]
|
||||
}
|
||||
}
|
||||
})"""";*/
|
||||
|
||||
const char* _CGDN1_json_props = "{\"properties\":{\"tempc\":{\"unit\":\"°C\",\"name\":\"temperature\"},\"hum\":{\"unit\":\"%\",\"name\":\"humidity\"},\"pm25\":{\"unit\":\"μg/m³\",\"name\":\"PM2.5\"},\"pm10\":{\"unit\":\"μg/m³\",\"name\":\"PM10\"},\"co2\":{\"unit\":\"ppm\",\"name\":\"carbon dioxide\"}}}";
|
||||
/*R""""(
|
||||
{
|
||||
"properties":{
|
||||
"tempc":{
|
||||
"unit":"°C",
|
||||
"name":"temperature"
|
||||
},
|
||||
"hum":{
|
||||
"unit":"%",
|
||||
"name":"humidity"
|
||||
},
|
||||
"pm25":{
|
||||
"unit":"μg/m³",
|
||||
"name":"PM2.5"
|
||||
},
|
||||
"pm10":{
|
||||
"unit":"μg/m³",
|
||||
"name":"PM10"
|
||||
},
|
||||
"co2":{
|
||||
"unit":"ppm",
|
||||
"name":"carbon dioxide"
|
||||
}
|
||||
}
|
||||
})"""";*/
|
||||
125
lib/decoder/src/devices/CGG1_json.h
Normal file
125
lib/decoder/src/devices/CGG1_json.h
Normal file
@@ -0,0 +1,125 @@
|
||||
#include "common_props.h"
|
||||
|
||||
const char* _CGG1_json_STOCK = "{\"brand\":\"ClearGrass/Qingping\",\"model\":\"Round TH\",\"model_id\":\"CGG1\",\"tag\":\"01\",\"condition\":[\"servicedata\",\"=\",34,\"index\",2,\"07\",\"|\",\"servicedata\",\"=\",34,\"index\",2,\"16\",\"&\",\"uuid\",\"index\",0,\"fdcd\"],\"properties\":{\"tempc\":{\"decoder\":[\"value_from_hex_data\",\"servicedata\",20,4,true],\"post_proc\":[\"/\",10]},\"hum\":{\"decoder\":[\"value_from_hex_data\",\"servicedata\",24,4,true],\"post_proc\":[\"/\",10]},\"batt\":{\"decoder\":[\"value_from_hex_data\",\"servicedata\",32,2,false]},\"mac\":{\"decoder\":[\"revmac_from_hex_data\",\"servicedata\",4]}}}";
|
||||
/* R""""(
|
||||
{
|
||||
"brand":"ClearGrass/Qingping",
|
||||
"model":"Round TH",
|
||||
"model_id":"CGG1",
|
||||
"tag":"01",
|
||||
"condition":["servicedata", "=", 34, "index", 2, "07", "|", "servicedata", "=", 34, "index", 2, "16", "&", "uuid", "index", 0, "fdcd"],
|
||||
"properties":{
|
||||
"tempc":{
|
||||
"decoder":["value_from_hex_data", "servicedata", 20, 4, true],
|
||||
"post_proc":["/", 10]
|
||||
},
|
||||
"hum":{
|
||||
"decoder":["value_from_hex_data", "servicedata", 24, 4, true],
|
||||
"post_proc":["/", 10]
|
||||
},
|
||||
"batt":{
|
||||
"decoder":["value_from_hex_data", "servicedata", 32, 2, false]
|
||||
},
|
||||
"mac":{
|
||||
"decoder":["revmac_from_hex_data", "servicedata", 4]
|
||||
}
|
||||
}
|
||||
})"""";*/
|
||||
|
||||
// ATC1441
|
||||
const char* _CGG1_json_ATC1441 = "{\"brand\":\"ClearGrass/Qingping\",\"model\":\"Round TH\",\"model_id\":\"CGG1_ATC1441\",\"tag\":\"0102\",\"condition\":[\"servicedata\",\"=\",26,\"&\",\"uuid\",\"index\",0,\"181a\",\"&\",\"name\",\"index\",0,\"CGG\"],\"properties\":{\"tempc\":{\"decoder\":[\"value_from_hex_data\",\"servicedata\",12,4,false],\"post_proc\":[\"/\",10]},\"hum\":{\"decoder\":[\"value_from_hex_data\",\"servicedata\",16,2,false]},\"batt\":{\"decoder\":[\"value_from_hex_data\",\"servicedata\",18,2,false]},\"volt\":{\"decoder\":[\"value_from_hex_data\",\"servicedata\",20,4,false],\"post_proc\":[\"/\",1000]},\"mac\":{\"decoder\":[\"mac_from_hex_data\",\"servicedata\",0]}}}";
|
||||
/* R""""(
|
||||
{
|
||||
"brand":"ClearGrass/Qingping",
|
||||
"model":"Round TH",
|
||||
"model_id":"CGG1_ATC1441",
|
||||
"tag":"0102",
|
||||
"condition":["servicedata", "=", 26, "&", "uuid", "index", 0, "181a", "&", "name", "index", 0, "CGG"],
|
||||
"properties":{
|
||||
"tempc":{
|
||||
"decoder":["value_from_hex_data", "servicedata", 12, 4, false],
|
||||
"post_proc":["/", 10]
|
||||
},
|
||||
"hum":{
|
||||
"decoder":["value_from_hex_data", "servicedata", 16, 2, false]
|
||||
},
|
||||
"batt":{
|
||||
"decoder":["value_from_hex_data", "servicedata", 18, 2, false]
|
||||
},
|
||||
"volt":{
|
||||
"decoder":["value_from_hex_data", "servicedata", 20, 4, false],
|
||||
"post_proc":["/", 1000]
|
||||
},
|
||||
"mac":{
|
||||
"decoder":["mac_from_hex_data", "servicedata", 0]
|
||||
}
|
||||
}
|
||||
})"""";*/
|
||||
|
||||
// PVVX
|
||||
const char* _CGG1_json_PVVX = "{\"brand\":\"ClearGrass/Qingping\",\"model\":\"Round TH\",\"model_id\":\"CGG1_PVVX\",\"tag\":\"0102\",\"condition\":[\"servicedata\",\"=\",30,\"&\",\"uuid\",\"index\",0,\"181a\",\"&\",\"name\",\"index\",0,\"CGG\"],\"properties\":{\"tempc\":{\"decoder\":[\"value_from_hex_data\",\"servicedata\",12,4,true],\"post_proc\":[\"/\",100]},\"hum\":{\"decoder\":[\"value_from_hex_data\",\"servicedata\",16,4,true],\"post_proc\":[\"/\",100]},\"batt\":{\"decoder\":[\"value_from_hex_data\",\"servicedata\",24,2,false]},\"volt\":{\"decoder\":[\"value_from_hex_data\",\"servicedata\",20,4,true],\"post_proc\":[\"/\",1000]},\"mac\":{\"decoder\":[\"revmac_from_hex_data\",\"servicedata\",0]}}}";
|
||||
/* R""""(
|
||||
{
|
||||
"brand":"ClearGrass/Qingping",
|
||||
"model":"Round TH",
|
||||
"model_id":"CGG1_PVVX",
|
||||
"tag":"0102",
|
||||
"condition":["servicedata", "=", 30, "&", "uuid", "index", 0, "181a", "&", "name", "index", 0, "CGG"],
|
||||
"properties":{
|
||||
"tempc":{
|
||||
"decoder":["value_from_hex_data", "servicedata", 12, 4, true],
|
||||
"post_proc":["/", 100]
|
||||
},
|
||||
"hum":{
|
||||
"decoder":["value_from_hex_data", "servicedata", 16, 4, true],
|
||||
"post_proc":["/", 100]
|
||||
},
|
||||
"batt":{
|
||||
"decoder":["value_from_hex_data", "servicedata", 24, 2, false]
|
||||
},
|
||||
"volt":{
|
||||
"decoder":["value_from_hex_data", "servicedata", 20, 4, true],
|
||||
"post_proc":["/", 1000]
|
||||
},
|
||||
"mac":{
|
||||
"decoder":["revmac_from_hex_data", "servicedata", 0]
|
||||
}
|
||||
}
|
||||
})"""";*/
|
||||
|
||||
const char* _CGG1_json_STOCK_2 = "{\"brand\":\"ClearGrass/Qingping\",\"model\":\"Round TH\",\"model_id\":\"CGG1\",\"tag\":\"0102\",\"condition\":[\"servicedata\",\"=\",30,\"|\",\"servicedata\",\"=\",32,\"|\",\"servicedata\",\"=\",36,\"&\",\"name\",\"index\",0,\"Qingping Temp & RH\",\"|\",\"name\",\"index\",0,\"ClearGrass Temp & RH\",\"&\",\"uuid\",\"index\",0,\"fe95\"],\"properties\":{\"tempc\":{\"condition\":[\"servicedata\",\">=\",32,\"&\",\"servicedata\",23,\"!\",\"6\"],\"decoder\":[\"value_from_hex_data\",\"servicedata\",28,4,true],\"post_proc\":[\"/\",10]},\"hum\":{\"condition\":[\"servicedata\",\"=\",36,\"&\",\"servicedata\",23,\"!\",\"6\"],\"decoder\":[\"value_from_hex_data\",\"servicedata\",32,4,true],\"post_proc\":[\"/\",10]},\"_hum\":{\"condition\":[\"servicedata\",\"=\",32,\"&\",\"servicedata\",23,\"6\"],\"decoder\":[\"value_from_hex_data\",\"servicedata\",28,4,true],\"post_proc\":[\"/\",10]},\"batt\":{\"condition\":[\"servicedata\",\"=\",30],\"decoder\":[\"value_from_hex_data\",\"servicedata\",28,2,false]},\"mac\":{\"decoder\":[\"revmac_from_hex_data\",\"servicedata\",10]}}}";
|
||||
/*
|
||||
R""""(
|
||||
{
|
||||
"brand":"ClearGrass/Qingping",
|
||||
"model":"Round TH",
|
||||
"model_id":"CGG1",
|
||||
"tag":"0102",
|
||||
"condition":["servicedata", "=", 30, "|", "servicedata", "=", 32, "|", "servicedata", "=", 36, "&", "name", "index", 0, "Qingping Temp & RH", "|", "name", "index", 0, "ClearGrass Temp & RH", "&","uuid", "index", 0, "fe95"],
|
||||
"properties":{
|
||||
"tempc":{
|
||||
"condition":["servicedata", ">=", 32, "&", "servicedata", 23, "!", "6"],
|
||||
"decoder":["value_from_hex_data", "servicedata", 28, 4, true],
|
||||
"post_proc":["/", 10]
|
||||
},
|
||||
"hum":{
|
||||
"condition":["servicedata", "=", 36, "&", "servicedata", 23, "!", "6"],
|
||||
"decoder":["value_from_hex_data", "servicedata", 32, 4, true],
|
||||
"post_proc":["/", 10]
|
||||
},
|
||||
"_hum":{
|
||||
"condition":["servicedata", "=", 32, "&", "servicedata", 23, "6"],
|
||||
"decoder":["value_from_hex_data", "servicedata", 28, 4, true],
|
||||
"post_proc":["/", 10]
|
||||
},
|
||||
"batt":{
|
||||
"condition":["servicedata", "=", 30],
|
||||
"decoder":["value_from_hex_data", "servicedata", 28, 2, false]
|
||||
},
|
||||
"mac":{
|
||||
"decoder":["revmac_from_hex_data", "servicedata", 10]
|
||||
}
|
||||
}
|
||||
})"""";*/
|
||||
|
||||
const char* _CGG1_json_props = _common_BVTH_props;
|
||||
37
lib/decoder/src/devices/CGH1_json.h
Normal file
37
lib/decoder/src/devices/CGH1_json.h
Normal file
@@ -0,0 +1,37 @@
|
||||
const char* _CGH1_json = "{\"brand\":\"Qingping\",\"model\":\"Contact Sensor\",\"model_id\":\"CGH1\",\"tag\":\"0404\",\"condition\":[\"servicedata\",\"=\",34,\"index\",2,\"04\",\"|\",\"servicedata\",\"=\",28,\"index\",2,\"04\",\"&\",\"uuid\",\"index\",0,\"fdcd\"],\"properties\":{\"open\":{\"condition\":[\"servicedata\",\"=\",28],\"decoder\":[\"bit_static_value\",\"servicedata\",21,0,true,false]},\"_open\":{\"condition\":[\"servicedata\",\"=\",34],\"decoder\":[\"bit_static_value\",\"servicedata\",33,0,true,false]},\"mac\":{\"decoder\":[\"revmac_from_hex_data\",\"servicedata\",4]}}}";
|
||||
/*R""""(
|
||||
{
|
||||
"brand":"Qingping",
|
||||
"model":"Contact Sensor",
|
||||
"model_id":"CGH1",
|
||||
"tag":"0404",
|
||||
"condition":["servicedata", "=", 34, "index", 2, "04", "|", "servicedata", "=", 28, "index", 2, "04", "&", "uuid", "index", 0, "fdcd"],
|
||||
"properties":{
|
||||
"open":{
|
||||
"condition":["servicedata", "=", 28],
|
||||
"decoder":["bit_static_value", "servicedata", 21, 0, true, false]
|
||||
},
|
||||
"_open":{
|
||||
"condition":["servicedata", "=", 34],
|
||||
"decoder":["bit_static_value", "servicedata", 33, 0, true, false]
|
||||
},
|
||||
"mac":{
|
||||
"decoder":["revmac_from_hex_data", "servicedata", 4]
|
||||
}
|
||||
}
|
||||
})"""";*/
|
||||
|
||||
const char* _CGH1_json_props = "{\"properties\":{\"open\":{\"unit\":\"status\",\"name\":\"door\"},\"mac\":{\"unit\":\"string\",\"name\":\"MAC address\"}}}";
|
||||
/*R""""(
|
||||
{
|
||||
"properties":{
|
||||
"open":{
|
||||
"unit":"status",
|
||||
"name":"door"
|
||||
},
|
||||
"mac":{
|
||||
"unit":"string",
|
||||
"name":"MAC address"
|
||||
}
|
||||
}
|
||||
})"""";*/
|
||||
49
lib/decoder/src/devices/CGP1W_json.h
Normal file
49
lib/decoder/src/devices/CGP1W_json.h
Normal file
@@ -0,0 +1,49 @@
|
||||
const char* _CGP1W_json = "{\"brand\":\"ClearGrass\",\"model\":\"Weather Station\",\"model_id\":\"CGP1W\",\"tag\":\"02\",\"condition\":[\"servicedata\",\"=\",42,\"index\",2,\"09\",\"&\",\"uuid\",\"index\",0,\"fdcd\"],\"properties\":{\"tempc\":{\"decoder\":[\"value_from_hex_data\",\"servicedata\",20,4,true],\"post_proc\":[\"/\",10]},\"hum\":{\"decoder\":[\"value_from_hex_data\",\"servicedata\",24,4,true,false],\"post_proc\":[\"/\",10]},\"pres\":{\"decoder\":[\"value_from_hex_data\",\"servicedata\",32,4,true,false],\"post_proc\":[\"/\",10]},\"mac\":{\"decoder\":[\"revmac_from_hex_data\",\"servicedata\",4]}}}";
|
||||
/*R""""(
|
||||
{
|
||||
"brand":"ClearGrass",
|
||||
"model":"Weather Station",
|
||||
"model_id":"CGP1W",
|
||||
"tag":"02",
|
||||
"condition":["servicedata", "=", 42, "index", 2, "09", "&", "uuid", "index", 0, "fdcd"],
|
||||
"properties":{
|
||||
"tempc":{
|
||||
"decoder":["value_from_hex_data", "servicedata", 20, 4, true],
|
||||
"post_proc":["/", 10]
|
||||
},
|
||||
"hum":{
|
||||
"decoder":["value_from_hex_data", "servicedata", 24, 4, true, false],
|
||||
"post_proc":["/", 10]
|
||||
},
|
||||
"pres":{
|
||||
"decoder":["value_from_hex_data", "servicedata", 32, 4, true, false],
|
||||
"post_proc":["/", 10]
|
||||
},
|
||||
"mac":{
|
||||
"decoder":["revmac_from_hex_data", "servicedata", 4]
|
||||
}
|
||||
}
|
||||
})"""";*/
|
||||
|
||||
const char* _CGP1W_json_props = "{\"properties\":{\"pres\":{\"unit\":\"hPa\",\"name\":\"pressure\"},\"tempc\":{\"unit\":\"°C\",\"name\":\"temperature\"},\"hum\":{\"unit\":\"%\",\"name\":\"humidity\"},\"mac\":{\"unit\":\"string\",\"name\":\"MAC address\"}}}";
|
||||
/*R""""(
|
||||
{
|
||||
"properties":{
|
||||
"pres":{
|
||||
"unit":"hPa",
|
||||
"name":"pressure"
|
||||
},
|
||||
"tempc":{
|
||||
"unit":"°C",
|
||||
"name":"temperature"
|
||||
},
|
||||
"hum":{
|
||||
"unit":"%",
|
||||
"name":"humidity"
|
||||
},
|
||||
"mac":{
|
||||
"unit":"string",
|
||||
"name":"MAC address"
|
||||
}
|
||||
}
|
||||
})"""";*/
|
||||
58
lib/decoder/src/devices/CGPR1_json.h
Normal file
58
lib/decoder/src/devices/CGPR1_json.h
Normal file
@@ -0,0 +1,58 @@
|
||||
const char* _CGPR1_json = "{\"brand\":\"Qingping\",\"model\":\"Motion & Light\",\"model_id\":\"CGPR1\",\"tag\":\"0404\",\"condition\":[\"servicedata\",\"=\",28,\"index\",2,\"12\",\"|\",\"servicedata\",\"=\",34,\"index\",2,\"12\",\"|\",\"servicedata\",\"=\",40,\"index\",2,\"12\",\"&\",\"uuid\",\"index\",0,\"fdcd\"],\"properties\":{\"lux\":{\"condition\":[\"servicedata\",\"=\",40],\"decoder\":[\"value_from_hex_data\",\"servicedata\",32,4,true,false]},\"_lux\":{\"condition\":[\"servicedata\",\"=\",34],\"decoder\":[\"value_from_hex_data\",\"servicedata\",22,4,true,false]},\"motion\":{\"condition\":[\"servicedata\",\"=\",34],\"decoder\":[\"bit_static_value\",\"servicedata\",21,0,false,true]},\"_motion\":{\"condition\":[\"servicedata\",\"=\",28],\"decoder\":[\"bit_static_value\",\"servicedata\",21,0,false,true]},\"batt\":{\"condition\":[\"servicedata\",\"=\",40],\"decoder\":[\"value_from_hex_data\",\"servicedata\",20,2,false,false]},\"mac\":{\"decoder\":[\"revmac_from_hex_data\",\"servicedata\",4]}}}";
|
||||
/*
|
||||
R""""(
|
||||
{
|
||||
"brand":"Qingping",
|
||||
"model":"Motion & Light",
|
||||
"model_id":"CGPR1",
|
||||
"tag":"0404",
|
||||
"condition":["servicedata", "=", 28, "index", 2, "12", "|", "servicedata", "=", 34, "index", 2, "12", "|", "servicedata", "=", 40, "index", 2, "12", "&", "uuid", "index", 0, "fdcd"],
|
||||
"properties":{
|
||||
"lux":{
|
||||
"condition":["servicedata", "=", 40],
|
||||
"decoder":["value_from_hex_data", "servicedata", 32, 4, true, false]
|
||||
},
|
||||
"_lux":{
|
||||
"condition":["servicedata", "=", 34],
|
||||
"decoder":["value_from_hex_data", "servicedata", 22, 4, true, false]
|
||||
},
|
||||
"motion":{
|
||||
"condition":["servicedata", "=", 34],
|
||||
"decoder":["bit_static_value", "servicedata", 21, 0, false, true]
|
||||
},
|
||||
"_motion":{
|
||||
"condition":["servicedata", "=", 28],
|
||||
"decoder":["bit_static_value", "servicedata", 21, 0, false, true]
|
||||
},
|
||||
"batt":{
|
||||
"condition":["servicedata", "=", 40],
|
||||
"decoder":["value_from_hex_data", "servicedata", 20, 2, false, false]
|
||||
},
|
||||
"mac":{
|
||||
"decoder":["revmac_from_hex_data", "servicedata", 4]
|
||||
}
|
||||
}
|
||||
})"""";*/
|
||||
|
||||
const char* _CGPR1_json_props = "{\"properties\":{\"lux\":{\"unit\":\"lx\",\"name\":\"illuminance\"},\"motion\":{\"unit\":\"status\",\"name\":\"motion\"},\"batt\":{\"unit\":\"%\",\"name\":\"battery\"},\"mac\":{\"unit\":\"string\",\"name\":\"MAC address\"}}}";
|
||||
/*R""""(
|
||||
{
|
||||
"properties":{
|
||||
"lux":{
|
||||
"unit":"lx",
|
||||
"name":"illuminance"
|
||||
},
|
||||
"motion":{
|
||||
"unit":"status",
|
||||
"name":"motion"
|
||||
},
|
||||
"batt":{
|
||||
"unit":"%",
|
||||
"name":"battery"
|
||||
},
|
||||
"mac":{
|
||||
"unit":"string",
|
||||
"name":"MAC address"
|
||||
}
|
||||
}
|
||||
})"""";*/
|
||||
33
lib/decoder/src/devices/GAEN_json.h
Normal file
33
lib/decoder/src/devices/GAEN_json.h
Normal file
@@ -0,0 +1,33 @@
|
||||
const char* _GAEN_json = "{\"brand\":\"GENERIC\",\"model\":\"GAEN\",\"model_id\":\"GAEN\",\"tag\":\"fe\",\"condition\":[\"uuid\",\"index\",0,\"fd6f\"],\"properties\":{\"rpi\":{\"decoder\":[\"string_from_hex_data\",\"servicedata\",0,32]},\"aem\":{\"decoder\":[\"string_from_hex_data\",\"servicedata\",32,8]}}}";
|
||||
|
||||
/*R""""(
|
||||
{
|
||||
"brand":"GENERIC",
|
||||
"model":"GAEN",
|
||||
"model_id":"GAEN",
|
||||
"tag":"fe",
|
||||
"condition":["uuid", "index", 0, "fd6f"],
|
||||
"properties":{
|
||||
"rpi":{
|
||||
"decoder":["string_from_hex_data", "servicedata", 0, 32]
|
||||
},
|
||||
"aem":{
|
||||
"decoder":["string_from_hex_data", "servicedata", 32, 8]
|
||||
}
|
||||
}
|
||||
})"""";*/
|
||||
|
||||
const char* _GAEN_json_props = "{\"properties\":{\"rpi\":{\"unit\":\"hex\",\"name\":\"rolling proximity identifier\"},\"aem\":{\"unit\":\"hex\",\"name\":\"associated encrypted metadata\"}}}";
|
||||
/*R""""(
|
||||
{
|
||||
"properties":{
|
||||
"rpi":{
|
||||
"unit":"hex",
|
||||
"name":"rolling proximity identifier"
|
||||
},
|
||||
"aem":{
|
||||
"unit":"hex",
|
||||
"name":"associated encrypted metadata"
|
||||
}
|
||||
}
|
||||
})"""";*/
|
||||
74
lib/decoder/src/devices/H5055_json.h
Normal file
74
lib/decoder/src/devices/H5055_json.h
Normal file
@@ -0,0 +1,74 @@
|
||||
const char* _H5055_json = "{\"brand\":\"Govee\",\"model\":\"Bluetooth BBQ Thermometer\",\"model_id\":\"H5055\",\"tag\":\"0301\",\"condition\":[\"manufacturerdata\",\">=\",41,\"index\",12,\"06\",\"|\",\"manufacturerdata\",\">=\",41,\"index\",12,\"20\",\"&\",\"manufacturerdata\",\"index\",26,\"06\",\"|\",\"manufacturerdata\",\">=\",41,\"index\",26,\"20\",\"&\",\"manufacturerdata\",\"index\",40,\"0\"],\"properties\":{\"tempc1\":{\"condition\":[\"manufacturerdata\",14,\"!\",\"ffff\",\"&\",\"manufacturerdata\",10,\"bit\",3,0,\"&\",\"manufacturerdata\",10,\"bit\",2,0],\"decoder\":[\"value_from_hex_data\",\"manufacturerdata\",14,4,true,false]},\"tempc2\":{\"condition\":[\"manufacturerdata\",28,\"!\",\"ffff\",\"&\",\"manufacturerdata\",10,\"bit\",3,0,\"&\",\"manufacturerdata\",10,\"bit\",2,0],\"decoder\":[\"value_from_hex_data\",\"manufacturerdata\",28,4,true,false]},\"tempc3\":{\"condition\":[\"manufacturerdata\",14,\"!\",\"ffff\",\"&\",\"manufacturerdata\",10,\"bit\",3,0,\"&\",\"manufacturerdata\",10,\"bit\",2,1],\"decoder\":[\"value_from_hex_data\",\"manufacturerdata\",14,4,true,false]},\"tempc4\":{\"condition\":[\"manufacturerdata\",28,\"!\",\"ffff\",\"&\",\"manufacturerdata\",10,\"bit\",3,0,\"&\",\"manufacturerdata\",10,\"bit\",2,1],\"decoder\":[\"value_from_hex_data\",\"manufacturerdata\",28,4,true,false]},\"tempc5\":{\"condition\":[\"manufacturerdata\",14,\"!\",\"ffff\",\"&\",\"manufacturerdata\",10,\"bit\",3,1,\"&\",\"manufacturerdata\",10,\"bit\",2,0],\"decoder\":[\"value_from_hex_data\",\"manufacturerdata\",14,4,true,false]},\"tempc6\":{\"condition\":[\"manufacturerdata\",28,\"!\",\"ffff\",\"&\",\"manufacturerdata\",10,\"bit\",3,1,\"&\",\"manufacturerdata\",10,\"bit\",2,0],\"decoder\":[\"value_from_hex_data\",\"manufacturerdata\",28,4,true,false]},\"batt\":{\"decoder\":[\"value_from_hex_data\",\"manufacturerdata\",8,2,false]}}}";
|
||||
/*R""""(
|
||||
{
|
||||
"brand":"Govee",
|
||||
"model":"Bluetooth BBQ Thermometer",
|
||||
"model_id":"H5055",
|
||||
"tag":"0301",
|
||||
"condition":["manufacturerdata", ">=", 41, "index", 12, "06", "|", "manufacturerdata", ">=", 41, "index", 12, "20", "&", "manufacturerdata", "index", 26, "06", "|", "manufacturerdata", ">=", 41, "index", 26, "20", "&", "manufacturerdata", "index", 40, "0"],
|
||||
"properties":{
|
||||
"tempc1":{
|
||||
"condition":["manufacturerdata", 14, "!", "ffff", "&", "manufacturerdata", 10, "bit", 3, 0, "&", "manufacturerdata", 10, "bit", 2, 0],
|
||||
"decoder":["value_from_hex_data", "manufacturerdata", 14, 4, true, false]
|
||||
},
|
||||
"tempc2":{
|
||||
"condition":["manufacturerdata", 28, "!", "ffff", "&", "manufacturerdata", 10, "bit", 3, 0, "&", "manufacturerdata", 10, "bit", 2, 0],
|
||||
"decoder":["value_from_hex_data", "manufacturerdata", 28, 4, true, false]
|
||||
},
|
||||
"tempc3":{
|
||||
"condition":["manufacturerdata", 14, "!", "ffff", "&", "manufacturerdata", 10, "bit", 3, 0, "&", "manufacturerdata", 10, "bit", 2, 1],
|
||||
"decoder":["value_from_hex_data", "manufacturerdata", 14, 4, true, false]
|
||||
},
|
||||
"tempc4":{
|
||||
"condition":["manufacturerdata", 28, "!", "ffff", "&", "manufacturerdata", 10, "bit", 3, 0, "&", "manufacturerdata", 10, "bit", 2, 1],
|
||||
"decoder":["value_from_hex_data", "manufacturerdata", 28, 4, true, false]
|
||||
},
|
||||
"tempc5":{
|
||||
"condition":["manufacturerdata", 14, "!", "ffff", "&", "manufacturerdata", 10, "bit", 3, 1, "&", "manufacturerdata", 10, "bit", 2, 0],
|
||||
"decoder":["value_from_hex_data", "manufacturerdata", 14, 4, true, false]
|
||||
},
|
||||
"tempc6":{
|
||||
"condition":["manufacturerdata", 28, "!", "ffff", "&", "manufacturerdata", 10, "bit", 3, 1, "&", "manufacturerdata", 10, "bit", 2, 0],
|
||||
"decoder":["value_from_hex_data", "manufacturerdata", 28, 4, true, false]
|
||||
},
|
||||
"batt":{
|
||||
"decoder":["value_from_hex_data", "manufacturerdata", 8, 2, false]
|
||||
}
|
||||
}
|
||||
})"""";*/
|
||||
|
||||
const char* _H5055_json_props = "{\"properties\":{\"tempc1\":{\"unit\":\"°C\",\"name\":\"tempc1\"},\"tempc2\":{\"unit\":\"°C\",\"name\":\"tempc2\"},\"tempc3\":{\"unit\":\"°C\",\"name\":\"tempc3\"},\"tempc4\":{\"unit\":\"°C\",\"name\":\"tempc4\"},\"tempc5\":{\"unit\":\"°C\",\"name\":\"tempc5\"},\"tempc6\":{\"unit\":\"°C\",\"name\":\"tempc6\"},\"batt\":{\"unit\":\"%\",\"name\":\"battery\"}}}";
|
||||
/*R""""(
|
||||
{
|
||||
"properties":{
|
||||
|
||||
"tempc1":{
|
||||
"unit":"°C",
|
||||
"name":"tempc1"
|
||||
},
|
||||
"tempc2":{
|
||||
"unit":"°C",
|
||||
"name":"tempc2"
|
||||
},
|
||||
"tempc3":{
|
||||
"unit":"°C",
|
||||
"name":"tempc3"
|
||||
},
|
||||
"tempc4":{
|
||||
"unit":"°C",
|
||||
"name":"tempc4"
|
||||
},
|
||||
"tempc5":{
|
||||
"unit":"°C",
|
||||
"name":"tempc5"
|
||||
},
|
||||
"tempc6":{
|
||||
"unit":"°C",
|
||||
"name":"tempc6"
|
||||
},
|
||||
"batt":{
|
||||
"unit":"%",
|
||||
"name":"battery"
|
||||
}
|
||||
}
|
||||
})"""";*/
|
||||
33
lib/decoder/src/devices/H5072_json.h
Normal file
33
lib/decoder/src/devices/H5072_json.h
Normal file
@@ -0,0 +1,33 @@
|
||||
#include "common_props.h"
|
||||
|
||||
const char* _H5072_json = "{\"brand\":\"Govee\",\"model\":\"Thermo-Hygrometer\",\"model_id\":\"H5072/75\",\"tag\":\"0103\",\"condition\":[\"name\",\"index\",0,\"GVH5072\",\"|\",\"name\",\"index\",0,\"GVH5075\",\"&\",\"manufacturerdata\",\">=\",16,\"index\",0,\"88ec\"],\"properties\":{\"tempc\":{\"condition\":[\"manufacturerdata\",6,\"bit\",3,0],\"decoder\":[\"value_from_hex_data\",\"manufacturerdata\",6,6,false,false],\"post_proc\":[\"/\",1000,\">\",0,\"/\",10]},\"_tempc\":{\"condition\":[\"manufacturerdata\",6,\"bit\",3,1],\"decoder\":[\"value_from_hex_data\",\"manufacturerdata\",6,6,false,false],\"post_proc\":[\"-\",8388608,\"/\",10000,\"*\",-1]},\"hum\":{\"decoder\":[\"value_from_hex_data\",\"manufacturerdata\",6,6,false,false],\"post_proc\":[\"%\",1000,\"/\",10]},\"batt\":{\"decoder\":[\"value_from_hex_data\",\"manufacturerdata\",12,2,false,false]}}}";
|
||||
|
||||
/* R""""(
|
||||
{
|
||||
"brand":"Govee",
|
||||
"model":"Thermo-Hygrometer",
|
||||
"model_id":"H5072/75",
|
||||
"tag":"0103",
|
||||
"condition":["name", "index", 0, "GVH5072", "|", "name", "index", 0, "GVH5075", "&", "manufacturerdata", ">=", 16, "index", 0, "88ec"],
|
||||
"properties":{
|
||||
"tempc":{
|
||||
"condition":["manufacturerdata", 6, "bit", 3, 0],
|
||||
"decoder":["value_from_hex_data", "manufacturerdata", 6, 6, false, false],
|
||||
"post_proc":["/", 1000, ">", 0, "/", 10]
|
||||
},
|
||||
"_tempc":{
|
||||
"condition":["manufacturerdata", 6, "bit", 3, 1],
|
||||
"decoder":["value_from_hex_data", "manufacturerdata", 6, 6, false, false],
|
||||
"post_proc":["-", 8388608, "/", 10000, "*", -1]
|
||||
},
|
||||
"hum":{
|
||||
"decoder":["value_from_hex_data", "manufacturerdata", 6, 6, false, false],
|
||||
"post_proc":["%", 1000, "/", 10]
|
||||
},
|
||||
"batt":{
|
||||
"decoder":["value_from_hex_data", "manufacturerdata", 12, 2, false, false]
|
||||
}
|
||||
}
|
||||
})"""";*/
|
||||
|
||||
const char* _H5072_json_props = _common_BTH_props;
|
||||
26
lib/decoder/src/devices/H5074_json.h
Normal file
26
lib/decoder/src/devices/H5074_json.h
Normal file
@@ -0,0 +1,26 @@
|
||||
#include "common_props.h"
|
||||
|
||||
const char* _H5074_json = "{\"brand\":\"Govee\",\"model\":\"Thermo-Hygrometer\",\"model_id\":\"H5074\",\"tag\":\"0103\",\"condition\":[\"name\",\"index\",0,\"Govee_H5074\",\"&\",\"manufacturerdata\",\">=\",18,\"index\",0,\"88ec\"],\"properties\":{\"tempc\":{\"decoder\":[\"value_from_hex_data\",\"manufacturerdata\",6,4,true,true],\"post_proc\":[\"/\",100]},\"hum\":{\"decoder\":[\"value_from_hex_data\",\"manufacturerdata\",10,4,true,false],\"post_proc\":[\"/\",100]},\"batt\":{\"decoder\":[\"value_from_hex_data\",\"manufacturerdata\",14,2,false,false]}}}";
|
||||
/* R""""(
|
||||
{
|
||||
"brand":"Govee",
|
||||
"model":"Thermo-Hygrometer",
|
||||
"model_id":"H5074",
|
||||
"tag":"0103",
|
||||
"condition":["name", "index", 0, "Govee_H5074", "&", "manufacturerdata", ">=", 18, "index", 0, "88ec"],
|
||||
"properties":{
|
||||
"tempc":{
|
||||
"decoder":["value_from_hex_data", "manufacturerdata", 6, 4, true, true],
|
||||
"post_proc":["/", 100]
|
||||
},
|
||||
"hum":{
|
||||
"decoder":["value_from_hex_data", "manufacturerdata", 10, 4, true, false],
|
||||
"post_proc":["/", 100]
|
||||
},
|
||||
"batt":{
|
||||
"decoder":["value_from_hex_data", "manufacturerdata", 14, 2, false, false]
|
||||
}
|
||||
}
|
||||
})"""";*/
|
||||
|
||||
const char* _H5074_json_props = _common_BTH_props;
|
||||
33
lib/decoder/src/devices/H5102_json.h
Normal file
33
lib/decoder/src/devices/H5102_json.h
Normal file
@@ -0,0 +1,33 @@
|
||||
#include "common_props.h"
|
||||
|
||||
const char* _H5102_json = "{\"brand\":\"Govee\",\"model\":\"Smart Thermo-Hygrometer\",\"model_id\":\"H5100/01/02/04/74/77\",\"tag\":\"0103\",\"condition\":[\"name\",\"index\",0,\"GVH5100\",\"|\",\"name\",\"index\",0,\"GVH5101\",\"|\",\"name\",\"index\",0,\"GVH5102\",\"|\",\"name\",\"index\",0,\"GVH5104\",\"|\",\"name\",\"index\",0,\"GVH5174\",\"|\",\"name\",\"index\",0,\"GVH5177\",\"&\",\"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\":{\"decoder\":[\"value_from_hex_data\",\"manufacturerdata\",8,6,false,false],\"post_proc\":[\"%\",1000,\"/\",10]},\"batt\":{\"decoder\":[\"value_from_hex_data\",\"manufacturerdata\",14,2,false,false]}}}";
|
||||
|
||||
/* R""""(
|
||||
{
|
||||
"brand":"Govee",
|
||||
"model":"Smart Thermo-Hygrometer",
|
||||
"model_id":"H5100/01/02/04/74/77",
|
||||
"tag":"0103",
|
||||
"condition":["name", "index", 0, "GVH5100", "|", "name", "index", 0, "GVH5101", "|", "name", "index", 0, "GVH5102", "|", "name", "index", 0, "GVH5104", "|", "name", "index", 0, "GVH5174", "|", "name", "index", 0, "GVH5177", "&", "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":{
|
||||
"decoder":["value_from_hex_data", "manufacturerdata", 8, 6, false, false],
|
||||
"post_proc":["%", 1000, "/", 10]
|
||||
},
|
||||
"batt":{
|
||||
"decoder":["value_from_hex_data", "manufacturerdata", 14, 2, false, false]
|
||||
}
|
||||
}
|
||||
})"""";*/
|
||||
|
||||
const char* _H5102_json_props = _common_BTH_props;
|
||||
52
lib/decoder/src/devices/H5106_json.h
Normal file
52
lib/decoder/src/devices/H5106_json.h
Normal file
@@ -0,0 +1,52 @@
|
||||
const char* _H5106_json = "{\"brand\":\"Govee\",\"model\":\"Smart Air Quality Monitor\",\"model_id\":\"H5106\",\"tag\":\"0f03\",\"condition\":[\"name\",\"index\",0,\"GVH5106\",\"&\",\"manufacturerdata\",\">=\",16,\"index\",0,\"0100\"],\"properties\":{\"tempc\":{\"condition\":[\"manufacturerdata\",8,\"bit\",3,0],\"decoder\":[\"value_from_hex_data\",\"manufacturerdata\",8,8,false,false],\"post_proc\":[\"/\",1000000,\">\",0,\"/\",10]},\"_tempc\":{\"condition\":[\"manufacturerdata\",8,\"bit\",3,1],\"decoder\":[\"value_from_hex_data\",\"manufacturerdata\",8,8,false,false],\"post_proc\":[\"&\",2147483647,\"/\",1000000,\">\",0,\"/\",10,\"*\",-1]},\"hum\":{\"decoder\":[\"value_from_hex_data\",\"manufacturerdata\",8,8,false,false],\"post_proc\":[\"&\",2147483647,\"%\",1000000,\"/\",1000,\">\",0,\"/\",10]},\".cal\":{\"decoder\":[\"value_from_hex_data\",\"manufacturerdata\",8,8,false,false],\"post_proc\":[\"&\",2147483647,\"/\",1000,\">\",0,\"*\",1000]},\"pm25\":{\"decoder\":[\"value_from_hex_data\",\"manufacturerdata\",8,8,false,false],\"post_proc\":[\"&\",2147483647,\"-\",\".cal\"]}}}";
|
||||
/* R""""(
|
||||
{
|
||||
"brand":"Govee",
|
||||
"model":"Smart Air Quality Monitor",
|
||||
"model_id":"H5106",
|
||||
"tag":"0f03",
|
||||
"condition":["name", "index", 0, "GVH5106", "&", "manufacturerdata", ">=", 16, "index", 0, "0100"],
|
||||
"properties":{
|
||||
"tempc":{
|
||||
"condition":["manufacturerdata", 8, "bit", 3, 0],
|
||||
"decoder":["value_from_hex_data", "manufacturerdata", 8, 8, false, false],
|
||||
"post_proc":["/", 1000000, ">", 0, "/", 10]
|
||||
},
|
||||
"_tempc":{
|
||||
"condition":["manufacturerdata", 8, "bit", 3, 1],
|
||||
"decoder":["value_from_hex_data", "manufacturerdata", 8, 8, false, false],
|
||||
"post_proc":["&", 2147483647, "/", 1000000, ">", 0, "/", 10, "*", -1]
|
||||
},
|
||||
"hum":{
|
||||
"decoder":["value_from_hex_data", "manufacturerdata", 8, 8, false, false],
|
||||
"post_proc":["&", 2147483647, "%", 1000000, "/", 1000, ">", 0, "/", 10]
|
||||
},
|
||||
".cal":{
|
||||
"decoder":["value_from_hex_data", "manufacturerdata", 8, 8, false, false],
|
||||
"post_proc":["&", 2147483647, "/", 1000, ">", 0, "*", 1000]
|
||||
},
|
||||
"pm25":{
|
||||
"decoder":["value_from_hex_data", "manufacturerdata", 8, 8, false, false],
|
||||
"post_proc":["&", 2147483647, "-", ".cal"]
|
||||
}
|
||||
}
|
||||
})"""";*/
|
||||
|
||||
const char* _H5106_json_props = "{\"properties\":{\"tempc\":{\"unit\":\"°C\",\"name\":\"temperature\"},\"hum\":{\"unit\":\"%\",\"name\":\"humidity\"},\"pm25\":{\"unit\":\"μg/m³\",\"name\":\"PM2.5\"}}}";
|
||||
/*R""""(
|
||||
{
|
||||
"properties":{
|
||||
"tempc":{
|
||||
"unit":"°C",
|
||||
"name":"temperature"
|
||||
},
|
||||
"hum":{
|
||||
"unit":"%",
|
||||
"name":"humidity"
|
||||
},
|
||||
"pm25":{
|
||||
"unit":"μg/m³",
|
||||
"name":"PM2.5"
|
||||
}
|
||||
}
|
||||
})"""";*/
|
||||
26
lib/decoder/src/devices/H5179_json.h
Normal file
26
lib/decoder/src/devices/H5179_json.h
Normal file
@@ -0,0 +1,26 @@
|
||||
#include "common_props.h"
|
||||
|
||||
const char* _H5179_json = "{\"brand\":\"Govee\",\"model\":\"Thermo-Hygrometer\",\"model_id\":\"H5179\",\"tag\":\"0103\",\"condition\":[\"name\",\"index\",0,\"Govee_H5179\",\"&\",\"manufacturerdata\",\"=\",22,\"index\",0,\"0188ec\"],\"properties\":{\"tempc\":{\"decoder\":[\"value_from_hex_data\",\"manufacturerdata\",12,4,true,true],\"post_proc\":[\"/\",100]},\"hum\":{\"decoder\":[\"value_from_hex_data\",\"manufacturerdata\",16,4,true,false],\"post_proc\":[\"/\",100]},\"batt\":{\"decoder\":[\"value_from_hex_data\",\"manufacturerdata\",20,2,false,false]}}}";
|
||||
/* R""""(
|
||||
{
|
||||
"brand":"Govee",
|
||||
"model":"Thermo-Hygrometer",
|
||||
"model_id":"H5179",
|
||||
"tag":"0103",
|
||||
"condition":["name", "index", 0, "Govee_H5179", "&", "manufacturerdata", "=", 22, "index", 0, "0188ec"],
|
||||
"properties":{
|
||||
"tempc":{
|
||||
"decoder":["value_from_hex_data", "manufacturerdata", 12, 4, true, true],
|
||||
"post_proc":["/", 100]
|
||||
},
|
||||
"hum":{
|
||||
"decoder":["value_from_hex_data", "manufacturerdata", 16, 4, true, false],
|
||||
"post_proc":["/", 100]
|
||||
},
|
||||
"batt":{
|
||||
"decoder":["value_from_hex_data", "manufacturerdata", 20, 2, false, false]
|
||||
}
|
||||
}
|
||||
})"""";*/
|
||||
|
||||
const char* _H5179_json_props = _common_BTH_props;
|
||||
58
lib/decoder/src/devices/HHCCJCY01HHCC_json.h
Normal file
58
lib/decoder/src/devices/HHCCJCY01HHCC_json.h
Normal file
@@ -0,0 +1,58 @@
|
||||
const char* _HHCCJCY01HHCC_json = "{\"brand\":\"Xiaomi/VegTrug\",\"model\":\"MiFlora\",\"model_id\":\"HHCCJCY01HHCC\",\"tag\":\"09\",\"condition\":[\"servicedata\",\"index\",4,\"9800\",\"|\",\"servicedata\",\"index\",4,\"bc03\",\"&\",\"uuid\",\"index\",0,\"fe95\"],\"properties\":{\"tempc\":{\"condition\":[\"servicedata\",24,\"0410\"],\"decoder\":[\"value_from_hex_data\",\"servicedata\",30,4,true],\"post_proc\":[\"/\",10]},\"moi\":{\"condition\":[\"servicedata\",24,\"0810\"],\"decoder\":[\"value_from_hex_data\",\"servicedata\",30,2,false]},\"lux\":{\"condition\":[\"servicedata\",24,\"0710\"],\"decoder\":[\"value_from_hex_data\",\"servicedata\",30,6,true]},\"fer\":{\"condition\":[\"servicedata\",24,\"0910\"],\"decoder\":[\"value_from_hex_data\",\"servicedata\",30,4,true]},\"mac\":{\"decoder\":[\"revmac_from_hex_data\",\"servicedata\",10]}}}";
|
||||
/*R""""(
|
||||
{
|
||||
"brand":"Xiaomi/VegTrug",
|
||||
"model":"MiFlora",
|
||||
"model_id":"HHCCJCY01HHCC",
|
||||
"tag":"09",
|
||||
"condition":["servicedata", "index", 4, "9800", "|", "servicedata", "index", 4, "bc03", "&", "uuid", "index", 0, "fe95"],
|
||||
"properties":{
|
||||
"tempc":{
|
||||
"condition":["servicedata", 24, "0410"],
|
||||
"decoder":["value_from_hex_data", "servicedata", 30, 4, true],
|
||||
"post_proc":["/", 10]
|
||||
},
|
||||
"moi":{
|
||||
"condition":["servicedata", 24, "0810"],
|
||||
"decoder":["value_from_hex_data", "servicedata", 30, 2, false]
|
||||
},
|
||||
"lux":{
|
||||
"condition":["servicedata", 24, "0710"],
|
||||
"decoder":["value_from_hex_data", "servicedata", 30, 6, true]
|
||||
},
|
||||
"fer":{
|
||||
"condition":["servicedata", 24, "0910"],
|
||||
"decoder":["value_from_hex_data", "servicedata", 30, 4, true]
|
||||
},
|
||||
"mac":{
|
||||
"decoder":["revmac_from_hex_data", "servicedata", 10]
|
||||
}
|
||||
}
|
||||
})"""";*/
|
||||
|
||||
const char* _HHCCJCY01HHCC_json_props = "{\"properties\":{\"lux\":{\"unit\":\"lx\",\"name\":\"illuminance\"},\"tempc\":{\"unit\":\"°C\",\"name\":\"temperature\"},\"fer\":{\"unit\":\"µS/cm\",\"name\":\"fertility\"},\"moi\":{\"unit\":\"%\",\"name\":\"moisture\"},\"mac\":{\"unit\":\"string\",\"name\":\"MAC address\"}}}";
|
||||
/*R""""(
|
||||
{
|
||||
"properties":{
|
||||
"lux":{
|
||||
"unit":"lx",
|
||||
"name":"illuminance"
|
||||
},
|
||||
"tempc":{
|
||||
"unit":"°C",
|
||||
"name":"temperature"
|
||||
},
|
||||
"fer":{
|
||||
"unit":"µS/cm",
|
||||
"name":"fertility"
|
||||
},
|
||||
"moi":{
|
||||
"unit":"%",
|
||||
"name":"moisture"
|
||||
},
|
||||
"mac":{
|
||||
"unit":"string",
|
||||
"name":"MAC address"
|
||||
}
|
||||
}
|
||||
})"""";*/
|
||||
54
lib/decoder/src/devices/HHCCJCY10_json.h
Normal file
54
lib/decoder/src/devices/HHCCJCY10_json.h
Normal file
@@ -0,0 +1,54 @@
|
||||
const char* _HHCCJCY10_json = "{\"brand\":\"Xiaomi/VegTrug\",\"model\":\"MiFlora\",\"model_id\":\"HHCCJCY10\",\"tag\":\"09\",\"condition\":[\"servicedata\",\"=\",18,\"&\",\"uuid\",\"index\",0,\"fd50\"],\"properties\":{\"tempc\":{\"decoder\":[\"value_from_hex_data\",\"servicedata\",2,4,false,true],\"post_proc\":[\"/\",10]},\"moi\":{\"decoder\":[\"value_from_hex_data\",\"servicedata\",0,2,false,false]},\"lux\":{\"decoder\":[\"value_from_hex_data\",\"servicedata\",6,6,false,false]},\"fer\":{\"decoder\":[\"value_from_hex_data\",\"servicedata\",14,4,false,false]},\"batt\":{\"decoder\":[\"value_from_hex_data\",\"servicedata\",12,2,false,false]}}}";
|
||||
/*R""""(
|
||||
{
|
||||
"brand":"Xiaomi/VegTrug",
|
||||
"model":"MiFlora",
|
||||
"model_id":"HHCCJCY10",
|
||||
"tag":"09",
|
||||
"condition":["servicedata", "=", 18, "&", "uuid", "index", 0, "fd50"],
|
||||
"properties":{
|
||||
"tempc":{
|
||||
"decoder":["value_from_hex_data", "servicedata", 2, 4, false, true],
|
||||
"post_proc":["/", 10]
|
||||
},
|
||||
"moi":{
|
||||
"decoder":["value_from_hex_data", "servicedata", 0, 2, false, false]
|
||||
},
|
||||
"lux":{
|
||||
"decoder":["value_from_hex_data", "servicedata", 6, 6, false, false]
|
||||
},
|
||||
"fer":{
|
||||
"decoder":["value_from_hex_data", "servicedata", 14, 4, false, false]
|
||||
},
|
||||
"batt":{
|
||||
"decoder":["value_from_hex_data", "servicedata", 12, 2, false, false]
|
||||
}
|
||||
}
|
||||
})"""";*/
|
||||
|
||||
const char* _HHCCJCY10_json_props = "{\"properties\":{\"tempc\":{\"unit\":\"°C\",\"name\":\"temperature\"},\"moi\":{\"unit\":\"%\",\"name\":\"moisture\"},\"lux\":{\"unit\":\"lx\",\"name\":\"illuminance\"},\"fer\":{\"unit\":\"µS/cm\",\"name\":\"fertility\"},\"batt\":{\"unit\":\"%\",\"name\":\"battery\"}}}";
|
||||
/*R""""(
|
||||
{
|
||||
"properties":{
|
||||
"tempc":{
|
||||
"unit":"°C",
|
||||
"name":"temperature"
|
||||
},
|
||||
"moi":{
|
||||
"unit":"%",
|
||||
"name":"moisture"
|
||||
},
|
||||
"lux":{
|
||||
"unit":"lx",
|
||||
"name":"illuminance"
|
||||
},
|
||||
"fer":{
|
||||
"unit":"µS/cm",
|
||||
"name":"fertility"
|
||||
},
|
||||
"batt":{
|
||||
"unit":"%",
|
||||
"name":"battery"
|
||||
}
|
||||
}
|
||||
})"""";*/
|
||||
41
lib/decoder/src/devices/HHCCPOT002_json.h
Normal file
41
lib/decoder/src/devices/HHCCPOT002_json.h
Normal file
@@ -0,0 +1,41 @@
|
||||
const char* _HHCCPOT002_json = "{\"brand\":\"Xiaomi\",\"model\":\"RoPot\",\"model_id\":\"HHCCPOT002\",\"tag\":\"09\",\"condition\":[\"servicedata\",\"index\",2,\"205d01\"],\"properties\":{\"moi\":{\"condition\":[\"servicedata\",25,\"8\"],\"decoder\":[\"value_from_hex_data\",\"servicedata\",30,2,false]},\"fer\":{\"condition\":[\"servicedata\",25,\"9\"],\"decoder\":[\"value_from_hex_data\",\"servicedata\",30,4,true]},\"mac\":{\"decoder\":[\"revmac_from_hex_data\",\"servicedata\",10]}}}";
|
||||
/*R""""(
|
||||
{
|
||||
"brand":"Xiaomi",
|
||||
"model":"RoPot",
|
||||
"model_id":"HHCCPOT002",
|
||||
"tag":"09",
|
||||
"condition":["servicedata", "index", 2, "205d01"],
|
||||
"properties":{
|
||||
"moi":{
|
||||
"condition":["servicedata", 25, "8"],
|
||||
"decoder":["value_from_hex_data", "servicedata", 30, 2, false]
|
||||
},
|
||||
"fer":{
|
||||
"condition":["servicedata", 25, "9"],
|
||||
"decoder":["value_from_hex_data", "servicedata", 30, 4, true]
|
||||
},
|
||||
"mac":{
|
||||
"decoder":["revmac_from_hex_data", "servicedata", 10]
|
||||
}
|
||||
}
|
||||
})"""";*/
|
||||
|
||||
const char* _HHCCPOT002_json_props = "{\"properties\":{\"moi\":{\"unit\":\"%\",\"name\":\"moisture\"},\"fer\":{\"unit\":\"µS/cm\",\"name\":\"fertility\"},\"mac\":{\"unit\":\"string\",\"name\":\"MAC address\"}}}";
|
||||
/*R""""(
|
||||
{
|
||||
"properties":{
|
||||
"moi":{
|
||||
"unit":"%",
|
||||
"name":"moisture"
|
||||
},
|
||||
"fer":{
|
||||
"unit":"µS/cm",
|
||||
"name":"fertility"
|
||||
},
|
||||
"mac":{
|
||||
"unit":"string",
|
||||
"name":"MAC address"
|
||||
}
|
||||
}
|
||||
})"""";*/
|
||||
51
lib/decoder/src/devices/IBS_THBP01B_json.h
Normal file
51
lib/decoder/src/devices/IBS_THBP01B_json.h
Normal file
@@ -0,0 +1,51 @@
|
||||
const char* _IBS_THBP01B_json = "{\"brand\":\"Inkbird\",\"model\":\"T(H) Sensor\",\"model_id\":\"IBS-TH1/TH2/P01B/ITH-12S\",\"tag\":\"0103\",\"condition\":[\"name\",\"index\",0,\"sps\",\"|\",\"name\",\"index\",0,\"tps\",\"&\",\"manufacturerdata\",\"=\",18],\"properties\":{\"tempc\":{\"decoder\":[\"value_from_hex_data\",\"manufacturerdata\",0,4,true],\"post_proc\":[\"/\",100]},\"extprobe\":{\"condition\":[\"manufacturerdata\",9,\"!\",\"0\"],\"decoder\":[\"static_value\",true]},\"hum\":{\"condition\":[\"manufacturerdata\",4,\"!\",\"ffff\",\"&\",\"manufacturerdata\",4,\"!\",\"0000\"],\"decoder\":[\"value_from_hex_data\",\"manufacturerdata\",4,4,true,false],\"post_proc\":[\"/\",100]},\"batt\":{\"condition\":[\"manufacturerdata\",14,\"!\",\"f\",\"&\",\"manufacturerdata\",14,\"!\",\"e\"],\"decoder\":[\"value_from_hex_data\",\"manufacturerdata\",14,2,false,false]}}}";
|
||||
/*R""""(
|
||||
{
|
||||
"brand":"Inkbird",
|
||||
"model":"T(H) Sensor",
|
||||
"model_id":"IBS-TH1/TH2/P01B/ITH-12S",
|
||||
"tag":"0103",
|
||||
"condition":["name", "index", 0, "sps", "|", "name", "index", 0, "tps", "&", "manufacturerdata", "=", 18],
|
||||
"properties":{
|
||||
"tempc":{
|
||||
"decoder":["value_from_hex_data", "manufacturerdata", 0, 4, true],
|
||||
"post_proc":["/", 100]
|
||||
},
|
||||
"extprobe":{
|
||||
"condition":["manufacturerdata", 9, "!", "0"],
|
||||
"decoder":["static_value", true]
|
||||
},
|
||||
"hum":{
|
||||
"condition":["manufacturerdata", 4, "!", "ffff", "&", "manufacturerdata", 4, "!", "0000"],
|
||||
"decoder":["value_from_hex_data", "manufacturerdata", 4, 4, true, false],
|
||||
"post_proc":["/", 100]
|
||||
},
|
||||
"batt":{
|
||||
"condition":["manufacturerdata", 14, "!", "f", "&", "manufacturerdata", 14, "!", "e"],
|
||||
"decoder":["value_from_hex_data", "manufacturerdata", 14, 2, false, false]
|
||||
}
|
||||
}
|
||||
})"""";*/
|
||||
|
||||
const char* _IBS_THBP01B_json_props = "{\"properties\":{\"tempc\":{\"unit\":\"°C\",\"name\":\"temperature\"},\"extprobe\":{\"unit\":\"status\",\"name\":\"external probe connected\"},\"hum\":{\"unit\":\"%\",\"name\":\"humidity\"},\"batt\":{\"unit\":\"%\",\"name\":\"battery\"}}}";
|
||||
/*R""""(
|
||||
{
|
||||
"properties":{
|
||||
"tempc":{
|
||||
"unit":"°C",
|
||||
"name":"temperature"
|
||||
},
|
||||
"extprobe":{
|
||||
"unit":"status",
|
||||
"name":"external probe connected"
|
||||
},
|
||||
"hum":{
|
||||
"unit":"%",
|
||||
"name":"humidity"
|
||||
},
|
||||
"batt":{
|
||||
"unit":"%",
|
||||
"name":"battery"
|
||||
}
|
||||
}
|
||||
})"""";*/
|
||||
70
lib/decoder/src/devices/IBT_2X_json.h
Normal file
70
lib/decoder/src/devices/IBT_2X_json.h
Normal file
@@ -0,0 +1,70 @@
|
||||
const char* _IBT_2X_json_2XS = "{\"brand\":\"Inkbird\",\"model\":\"iBBQ\",\"model_id\":\"IBT-2X(S)\",\"tag\":\"0301\",\"condition\":[\"manufacturerdata\",\"=\",28,\"index\",0,\"00000000\",\"&\",\"manufacturerdata\",\"mac@index\",8],\"conditionnomac\":[\"name\",\"index\",0,\"iBBQ\",\"|\",\"name\",\"index\",0,\"xBBQ\",\"&\",\"manufacturerdata\",\"=\",28,\"index\",0,\"00000000\"],\"properties\":{\"tempc\":{\"condition\":[\"manufacturerdata\",22,\"!\",\"ff\"],\"decoder\":[\"value_from_hex_data\",\"manufacturerdata\",20,4,true,false],\"post_proc\":[\"/\",10]},\"tempc2\":{\"condition\":[\"manufacturerdata\",26,\"!\",\"ff\"],\"decoder\":[\"value_from_hex_data\",\"manufacturerdata\",24,4,true,false],\"post_proc\":[\"/\",10]},\"mac\":{\"decoder\":[\"mac_from_hex_data\",\"manufacturerdata\",8]}}}";
|
||||
/*R""""(
|
||||
{
|
||||
"brand":"Inkbird",
|
||||
"model":"iBBQ",
|
||||
"model_id":"IBT-2X(S)",
|
||||
"tag":"0301",
|
||||
"condition":["manufacturerdata", "=", 28, "index", 0, "00000000", "&", "manufacturerdata", "mac@index", 8],
|
||||
"conditionnomac":["name", "index", 0, "iBBQ", "|", "name", "index", 0, "xBBQ", "&","manufacturerdata", "=", 28, "index", 0, "00000000"],
|
||||
"properties":{
|
||||
"tempc":{
|
||||
"condition":["manufacturerdata", 22, "!", "ff"],
|
||||
"decoder":["value_from_hex_data", "manufacturerdata", 20, 4, true, false],
|
||||
"post_proc":["/", 10]
|
||||
},
|
||||
"tempc2":{
|
||||
"condition":["manufacturerdata", 26, "!", "ff"],
|
||||
"decoder":["value_from_hex_data", "manufacturerdata", 24, 4, true, false],
|
||||
"post_proc":["/", 10]
|
||||
},
|
||||
"mac":{
|
||||
"decoder":["mac_from_hex_data", "manufacturerdata", 8]
|
||||
}
|
||||
}
|
||||
})"""";*/
|
||||
|
||||
const char* _IBT_2X_json_2X = "{\"brand\":\"Inkbird\",\"model\":\"iBBQ\",\"model_id\":\"IBT-2X(S)\",\"tag\":\"0301\",\"condition\":[\"manufacturerdata\",\"=\",28,\"index\",0,\"01000000\",\"&\",\"manufacturerdata\",\"revmac@index\",8],\"conditionnomac\":[\"name\",\"index\",0,\"iBBQ\",\"|\",\"name\",\"index\",0,\"xBBQ\",\"&\",\"manufacturerdata\",\"=\",28,\"index\",0,\"01000000\"],\"properties\":{\"tempc\":{\"condition\":[\"manufacturerdata\",22,\"!\",\"ff\"],\"decoder\":[\"value_from_hex_data\",\"manufacturerdata\",20,4,true,false],\"post_proc\":[\"/\",10]},\"tempc2\":{\"condition\":[\"manufacturerdata\",26,\"!\",\"ff\"],\"decoder\":[\"value_from_hex_data\",\"manufacturerdata\",24,4,true,false],\"post_proc\":[\"/\",10]},\"mac\":{\"decoder\":[\"revmac_from_hex_data\",\"manufacturerdata\",8]}}}";
|
||||
/*R""""(
|
||||
{
|
||||
"brand":"Inkbird",
|
||||
"model":"iBBQ",
|
||||
"model_id":"IBT-2X(S)",
|
||||
"tag":"0301",
|
||||
"condition":["manufacturerdata", "=", 28, "index", 0, "01000000", "&", "manufacturerdata", "revmac@index", 8],
|
||||
"conditionnomac":["name", "index", 0, "iBBQ", "|", "name", "index", 0, "xBBQ", "&", "manufacturerdata", "=", 28, "index", 0, "01000000"],
|
||||
"properties":{
|
||||
"tempc":{
|
||||
"condition":["manufacturerdata", 22, "!", "ff"],
|
||||
"decoder":["value_from_hex_data", "manufacturerdata", 20, 4, true, false],
|
||||
"post_proc":["/", 10]
|
||||
},
|
||||
"tempc2":{
|
||||
"condition":["manufacturerdata", 26, "!", "ff"],
|
||||
"decoder":["value_from_hex_data", "manufacturerdata", 24, 4, true, false],
|
||||
"post_proc":["/", 10]
|
||||
},
|
||||
"mac":{
|
||||
"decoder":["revmac_from_hex_data", "manufacturerdata", 8]
|
||||
}
|
||||
}
|
||||
})"""";*/
|
||||
|
||||
const char* _IBT_2X_json_props = "{\"properties\":{\"tempc\":{\"unit\":\"°C\",\"name\":\"temperature\"},\"tempc2\":{\"unit\":\"°C\",\"name\":\"temperature\"},\"mac\":{\"unit\":\"string\",\"name\":\"MAC address\"}}}";
|
||||
/*R""""(
|
||||
{
|
||||
"properties":{
|
||||
"tempc":{
|
||||
"unit":"°C",
|
||||
"name":"temperature"
|
||||
},
|
||||
"tempc2":{
|
||||
"unit":"°C",
|
||||
"name":"temperature"
|
||||
},
|
||||
"mac":{
|
||||
"unit":"string",
|
||||
"name":"MAC address"
|
||||
}
|
||||
}
|
||||
})"""";*/
|
||||
62
lib/decoder/src/devices/IBT_4XS_json.h
Normal file
62
lib/decoder/src/devices/IBT_4XS_json.h
Normal file
@@ -0,0 +1,62 @@
|
||||
const char* _IBT_4XS_json = "{\"brand\":\"Inkbird\",\"model\":\"iBBQ\",\"model_id\":\"IBT-4X(S/C)\",\"tag\":\"0301\",\"condition\":[\"manufacturerdata\",\"=\",36,\"index\",0,\"00000000\",\"&\",\"manufacturerdata\",\"mac@index\",8],\"conditionnomac\":[\"name\",\"index\",0,\"iBBQ\",\"&\",\"manufacturerdata\",\"=\",36,\"index\",0,\"00000000\"],\"properties\":{\"tempc\":{\"condition\":[\"manufacturerdata\",22,\"!\",\"ff\"],\"decoder\":[\"value_from_hex_data\",\"manufacturerdata\",20,4,true,false],\"post_proc\":[\"/\",10]},\"tempc2\":{\"condition\":[\"manufacturerdata\",26,\"!\",\"ff\"],\"decoder\":[\"value_from_hex_data\",\"manufacturerdata\",24,4,true,false],\"post_proc\":[\"/\",10]},\"tempc3\":{\"condition\":[\"manufacturerdata\",30,\"!\",\"ff\"],\"decoder\":[\"value_from_hex_data\",\"manufacturerdata\",28,4,true,false],\"post_proc\":[\"/\",10]},\"tempc4\":{\"condition\":[\"manufacturerdata\",34,\"!\",\"ff\"],\"decoder\":[\"value_from_hex_data\",\"manufacturerdata\",32,4,true,false],\"post_proc\":[\"/\",10]},\"mac\":{\"decoder\":[\"mac_from_hex_data\",\"manufacturerdata\",8]}}}";
|
||||
/*R""""(
|
||||
{
|
||||
"brand":"Inkbird",
|
||||
"model":"iBBQ",
|
||||
"model_id":"IBT-4X(S/C)",
|
||||
"tag":"0301",
|
||||
"condition":["manufacturerdata", "=" ,36 ,"index", 0, "00000000", "&", "manufacturerdata", "mac@index", 8],
|
||||
"conditionnomac":["name", "index", 0, "iBBQ","&","manufacturerdata", "=" ,36 ,"index", 0, "00000000"],
|
||||
"properties":{
|
||||
"tempc":{
|
||||
"condition":["manufacturerdata", 22, "!", "ff"],
|
||||
"decoder":["value_from_hex_data", "manufacturerdata", 20, 4, true, false],
|
||||
"post_proc":["/", 10]
|
||||
},
|
||||
"tempc2":{
|
||||
"condition":["manufacturerdata", 26, "!", "ff"],
|
||||
"decoder":["value_from_hex_data", "manufacturerdata", 24, 4, true, false],
|
||||
"post_proc":["/", 10]
|
||||
},
|
||||
"tempc3":{
|
||||
"condition":["manufacturerdata", 30, "!", "ff"],
|
||||
"decoder":["value_from_hex_data", "manufacturerdata", 28, 4, true, false],
|
||||
"post_proc":["/", 10]
|
||||
},
|
||||
"tempc4":{
|
||||
"condition":["manufacturerdata", 34, "!", "ff"],
|
||||
"decoder":["value_from_hex_data", "manufacturerdata", 32, 4, true, false],
|
||||
"post_proc":["/", 10]
|
||||
},
|
||||
"mac":{
|
||||
"decoder":["mac_from_hex_data", "manufacturerdata", 8]
|
||||
}
|
||||
}
|
||||
})"""";*/
|
||||
|
||||
const char* _IBT_4XS_json_props = "{\"properties\":{\"tempc\":{\"unit\":\"°C\",\"name\":\"temperature\"},\"tempc2\":{\"unit\":\"°C\",\"name\":\"temperature\"},\"tempc3\":{\"unit\":\"°C\",\"name\":\"temperature\"},\"tempc4\":{\"unit\":\"°C\",\"name\":\"temperature\"},\"mac\":{\"unit\":\"string\",\"name\":\"MAC address\"}}}";
|
||||
/*R""""(
|
||||
{
|
||||
"properties":{
|
||||
"tempc":{
|
||||
"unit":"°C",
|
||||
"name":"temperature"
|
||||
},
|
||||
"tempc2":{
|
||||
"unit":"°C",
|
||||
"name":"temperature"
|
||||
},
|
||||
"tempc3":{
|
||||
"unit":"°C",
|
||||
"name":"temperature"
|
||||
},
|
||||
"tempc4":{
|
||||
"unit":"°C",
|
||||
"name":"temperature"
|
||||
},
|
||||
"mac":{
|
||||
"unit":"string",
|
||||
"name":"MAC address"
|
||||
}
|
||||
}
|
||||
})"""";*/
|
||||
80
lib/decoder/src/devices/IBT_6XS_SOLIS6_json.h
Normal file
80
lib/decoder/src/devices/IBT_6XS_SOLIS6_json.h
Normal file
@@ -0,0 +1,80 @@
|
||||
const char* _IBT_6XS_SOLIS6_json = "{\"brand\":\"Inkbird/Tenergy\",\"model\":\"iBBQ/SOLIS6\",\"model_id\":\"IBT-6XS/SOLIS-6\",\"tag\":\"0301\",\"condition\":[\"manufacturerdata\",\"=\",44,\"index\",0,\"00000000\",\"&\",\"manufacturerdata\",\"mac@index\",8],\"conditionnomac\":[\"name\",\"index\",0,\"iBBQ\",\"&\",\"manufacturerdata\",\"=\",44,\"index\",0,\"00000000\"],\"properties\":{\"tempc\":{\"condition\":[\"manufacturerdata\",22,\"!\",\"ff\"],\"decoder\":[\"value_from_hex_data\",\"manufacturerdata\",20,4,true,false],\"post_proc\":[\"/\",10]},\"tempc2\":{\"condition\":[\"manufacturerdata\",26,\"!\",\"ff\"],\"decoder\":[\"value_from_hex_data\",\"manufacturerdata\",24,4,true,false],\"post_proc\":[\"/\",10]},\"tempc3\":{\"condition\":[\"manufacturerdata\",30,\"!\",\"ff\"],\"decoder\":[\"value_from_hex_data\",\"manufacturerdata\",28,4,true,false],\"post_proc\":[\"/\",10]},\"tempc4\":{\"condition\":[\"manufacturerdata\",34,\"!\",\"ff\"],\"decoder\":[\"value_from_hex_data\",\"manufacturerdata\",32,4,true,false],\"post_proc\":[\"/\",10]},\"tempc5\":{\"condition\":[\"manufacturerdata\",38,\"!\",\"ff\"],\"decoder\":[\"value_from_hex_data\",\"manufacturerdata\",36,4,true,false],\"post_proc\":[\"/\",10]},\"tempc6\":{\"condition\":[\"manufacturerdata\",42,\"!\",\"ff\"],\"decoder\":[\"value_from_hex_data\",\"manufacturerdata\",40,4,true,false],\"post_proc\":[\"/\",10]},\"mac\":{\"decoder\":[\"mac_from_hex_data\",\"manufacturerdata\",8]}}}";
|
||||
/*R""""(
|
||||
{
|
||||
"brand":"Inkbird/Tenergy",
|
||||
"model":"iBBQ/SOLIS6",
|
||||
"model_id":"IBT-6XS/SOLIS-6",
|
||||
"tag":"0301",
|
||||
"condition":["manufacturerdata", "=", 44, "index", 0, "00000000", "&", "manufacturerdata", "mac@index", 8],
|
||||
"conditionnomac":["name", "index", 0, "iBBQ", "&", "manufacturerdata", "=", 44, "index", 0, "00000000"],
|
||||
"properties":{
|
||||
"tempc":{
|
||||
"condition":["manufacturerdata", 22, "!", "ff"],
|
||||
"decoder":["value_from_hex_data", "manufacturerdata", 20, 4, true, false],
|
||||
"post_proc":["/", 10]
|
||||
},
|
||||
"tempc2":{
|
||||
"condition":["manufacturerdata", 26, "!", "ff"],
|
||||
"decoder":["value_from_hex_data", "manufacturerdata", 24, 4, true, false],
|
||||
"post_proc":["/", 10]
|
||||
},
|
||||
"tempc3":{
|
||||
"condition":["manufacturerdata", 30, "!", "ff"],
|
||||
"decoder":["value_from_hex_data", "manufacturerdata", 28, 4, true, false],
|
||||
"post_proc":["/", 10]
|
||||
},
|
||||
"tempc4":{
|
||||
"condition":["manufacturerdata", 34, "!", "ff"],
|
||||
"decoder":["value_from_hex_data", "manufacturerdata", 32, 4, true, false],
|
||||
"post_proc":["/", 10]
|
||||
},
|
||||
"tempc5":{
|
||||
"condition":["manufacturerdata", 38, "!", "ff"],
|
||||
"decoder":["value_from_hex_data", "manufacturerdata", 36, 4, true, false],
|
||||
"post_proc":["/", 10]
|
||||
},
|
||||
"tempc6":{
|
||||
"condition":["manufacturerdata", 42, "!", "ff"],
|
||||
"decoder":["value_from_hex_data", "manufacturerdata", 40, 4, true, false],
|
||||
"post_proc":["/", 10]
|
||||
},
|
||||
"mac":{
|
||||
"decoder":["mac_from_hex_data", "manufacturerdata", 8]
|
||||
}
|
||||
}
|
||||
})"""";*/
|
||||
|
||||
const char* _IBT_6XS_SOLIS6_json_props = "{\"properties\":{\"tempc\":{\"unit\":\"°C\",\"name\":\"temperature\"},\"tempc2\":{\"unit\":\"°C\",\"name\":\"temperature\"},\"tempc3\":{\"unit\":\"°C\",\"name\":\"temperature\"},\"tempc4\":{\"unit\":\"°C\",\"name\":\"temperature\"},\"tempc5\":{\"unit\":\"°C\",\"name\":\"temperature\"},\"tempc6\":{\"unit\":\"°C\",\"name\":\"temperature\"},\"mac\":{\"unit\":\"string\",\"name\":\"MAC address\"}}}";
|
||||
/*R""""(
|
||||
{
|
||||
"properties":{
|
||||
"tempc":{
|
||||
"unit":"°C",
|
||||
"name":"temperature"
|
||||
},
|
||||
"tempc2":{
|
||||
"unit":"°C",
|
||||
"name":"temperature"
|
||||
},
|
||||
"tempc3":{
|
||||
"unit":"°C",
|
||||
"name":"temperature"
|
||||
},
|
||||
"tempc4":{
|
||||
"unit":"°C",
|
||||
"name":"temperature"
|
||||
},
|
||||
"tempc5":{
|
||||
"unit":"°C",
|
||||
"name":"temperature"
|
||||
},
|
||||
"tempc6":{
|
||||
"unit":"°C",
|
||||
"name":"temperature"
|
||||
},
|
||||
"mac":{
|
||||
"unit":"string",
|
||||
"name":"MAC address"
|
||||
}
|
||||
}
|
||||
})"""";*/
|
||||
26
lib/decoder/src/devices/JHT_F525_json.h
Normal file
26
lib/decoder/src/devices/JHT_F525_json.h
Normal file
@@ -0,0 +1,26 @@
|
||||
#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]}}}";
|
||||
/* 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.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_props = _common_BTH_props;
|
||||
60
lib/decoder/src/devices/JQJCY01YM_json.h
Normal file
60
lib/decoder/src/devices/JQJCY01YM_json.h
Normal file
@@ -0,0 +1,60 @@
|
||||
const char* _JQJCY01YM_json = "{\"brand\":\"Xiaomi\",\"model\":\"Formaldehyde detector\",\"model_id\":\"JQJCY01YM\",\"tag\":\"0f\",\"condition\":[\"servicedata\",\"index\",2,\"20df02\"],\"properties\":{\"for\":{\"condition\":[\"servicedata\",23,\"0\"],\"decoder\":[\"value_from_hex_data\",\"servicedata\",28,4,true],\"post_proc\":[\"/\",100]},\"hum\":{\"condition\":[\"servicedata\",23,\"6\"],\"decoder\":[\"value_from_hex_data\",\"servicedata\",28,4,true,false],\"post_proc\":[\"/\",10]},\"tempc\":{\"condition\":[\"servicedata\",23,\"4\"],\"decoder\":[\"value_from_hex_data\",\"servicedata\",28,4,true,false],\"post_proc\":[\"/\",10]},\"batt\":{\"condition\":[\"servicedata\",23,\"a\"],\"decoder\":[\"value_from_hex_data\",\"servicedata\",28,2,false,false]},\"mac\":{\"decoder\":[\"revmac_from_hex_data\",\"servicedata\",10]}}}";
|
||||
/*R""""(
|
||||
{
|
||||
"brand":"Xiaomi",
|
||||
"model":"Formaldehyde detector",
|
||||
"model_id":"JQJCY01YM",
|
||||
"tag":"0f",
|
||||
"condition":["servicedata", "index", 2, "20df02"],
|
||||
"properties":{
|
||||
"for":{
|
||||
"condition":["servicedata", 23, "0"],
|
||||
"decoder":["value_from_hex_data", "servicedata", 28, 4, true],
|
||||
"post_proc":["/", 100]
|
||||
},
|
||||
"hum":{
|
||||
"condition":["servicedata", 23, "6"],
|
||||
"decoder":["value_from_hex_data", "servicedata", 28, 4, true, false],
|
||||
"post_proc":["/", 10]
|
||||
},
|
||||
"tempc":{
|
||||
"condition":["servicedata", 23, "4"],
|
||||
"decoder":["value_from_hex_data", "servicedata", 28, 4, true, false],
|
||||
"post_proc":["/", 10]
|
||||
},
|
||||
"batt":{
|
||||
"condition":["servicedata", 23, "a"],
|
||||
"decoder":["value_from_hex_data", "servicedata", 28, 2, false, false]
|
||||
},
|
||||
"mac":{
|
||||
"decoder":["revmac_from_hex_data", "servicedata", 10]
|
||||
}
|
||||
}
|
||||
})"""";*/
|
||||
|
||||
const char* _JQJCY01YM_json_props = "{\"properties\":{\"batt\":{\"unit\":\"%\",\"name\":\"battery\"},\"tempc\":{\"unit\":\"°C\",\"name\":\"temperature\"},\"hum\":{\"unit\":\"%\",\"name\":\"humidity\"},\"for\":{\"unit\":\"mg/m³\",\"name\":\"formaldehyde\"},\"mac\":{\"unit\":\"string\",\"name\":\"MAC address\"}}}";
|
||||
/*R""""(
|
||||
{
|
||||
"properties":{
|
||||
"batt":{
|
||||
"unit":"%",
|
||||
"name":"battery"
|
||||
},
|
||||
"tempc":{
|
||||
"unit":"°C",
|
||||
"name":"temperature"
|
||||
},
|
||||
"hum":{
|
||||
"unit":"%",
|
||||
"name":"humidity"
|
||||
},
|
||||
"for":{
|
||||
"unit":"mg/m³",
|
||||
"name":"formaldehyde"
|
||||
},
|
||||
"mac":{
|
||||
"unit":"string",
|
||||
"name":"MAC address"
|
||||
}
|
||||
}
|
||||
})"""";*/
|
||||
50
lib/decoder/src/devices/KKM_K6P_json.h
Normal file
50
lib/decoder/src/devices/KKM_K6P_json.h
Normal file
@@ -0,0 +1,50 @@
|
||||
const char* _KKM_K6P_json = "{\"brand\":\"KKM\",\"model\":\"Long Range K6P\",\"model_id\":\"K6P\",\"tag\":\"01\",\"condition\":[\"servicedata\",\"=\",18,\"index\",0,\"210107\",\"&\",\"uuid\",\"index\",0,\"feaa\"],\"properties\":{\".cal\":{\"decoder\":[\"value_from_hex_data\",\"servicedata\",12,2,false,false],\"post_proc\":[\"/\",256,\"*\",100,\">\",0,\"/\",100]},\"tempc\":{\"decoder\":[\"value_from_hex_data\",\"servicedata\",10,2,false,true],\"post_proc\":[\"+\",\".cal\"]},\"_.cal\":{\"decoder\":[\"value_from_hex_data\",\"servicedata\",16,2,false,false],\"post_proc\":[\"/\",256,\"*\",100,\">\",0,\"/\",100]},\"hum\":{\"decoder\":[\"value_from_hex_data\",\"servicedata\",14,2,false,false],\"post_proc\":[\"+\",\".cal\"]},\"volt\":{\"decoder\":[\"value_from_hex_data\",\"servicedata\",6,4,false,false],\"post_proc\":[\"/\",1000]}}}";
|
||||
/*R""""(
|
||||
{
|
||||
"brand":"KKM",
|
||||
"model":"Long Range K6P",
|
||||
"model_id":"K6P",
|
||||
"tag":"01",
|
||||
"condition":["servicedata", "=", 18, "index", 0, "210107", "&", "uuid", "index", 0, "feaa"],
|
||||
"properties":{
|
||||
".cal":{
|
||||
"decoder":["value_from_hex_data", "servicedata", 12, 2, false, false],
|
||||
"post_proc":["/", 256, "*", 100, ">", 0, "/", 100]
|
||||
},
|
||||
"tempc":{
|
||||
"decoder":["value_from_hex_data", "servicedata", 10, 2, false, true],
|
||||
"post_proc":["+", ".cal"]
|
||||
},
|
||||
"_.cal":{
|
||||
"decoder":["value_from_hex_data", "servicedata", 16, 2, false, false],
|
||||
"post_proc":["/", 256, "*", 100, ">", 0, "/", 100]
|
||||
},
|
||||
"hum":{
|
||||
"decoder":["value_from_hex_data", "servicedata", 14, 2, false, false],
|
||||
"post_proc":["+", ".cal"]
|
||||
},
|
||||
"volt":{
|
||||
"decoder":["value_from_hex_data", "servicedata", 6, 4, false, false],
|
||||
"post_proc":["/", 1000]
|
||||
}
|
||||
}
|
||||
})"""";*/
|
||||
|
||||
const char* _KKM_K6P_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"
|
||||
}
|
||||
}
|
||||
})"""";*/
|
||||
74
lib/decoder/src/devices/KKM_K9_json.h
Normal file
74
lib/decoder/src/devices/KKM_K9_json.h
Normal file
@@ -0,0 +1,74 @@
|
||||
const char* _KKM_K9_json = "{\"brand\":\"KKM\",\"model\":\"Tracking K9\",\"model_id\":\"K9\",\"tag\":\"0708\",\"condition\":[\"servicedata\",\"=\",30,\"index\",0,\"21010f\",\"&\",\"uuid\",\"index\",0,\"feaa\"],\"properties\":{\".cal\":{\"decoder\":[\"value_from_hex_data\",\"servicedata\",12,2,false,false],\"post_proc\":[\"/\",256,\"*\",100,\">\",0,\"/\",100]},\"tempc\":{\"decoder\":[\"value_from_hex_data\",\"servicedata\",10,2,false,true],\"post_proc\":[\"+\",\".cal\"]},\"_.cal\":{\"decoder\":[\"value_from_hex_data\",\"servicedata\",16,2,false,false],\"post_proc\":[\"/\",256,\"*\",100,\">\",0,\"/\",100]},\"hum\":{\"decoder\":[\"value_from_hex_data\",\"servicedata\",14,2,false,false],\"post_proc\":[\"+\",\".cal\"]},\"volt\":{\"decoder\":[\"value_from_hex_data\",\"servicedata\",6,4,false,false],\"post_proc\":[\"/\",1000]},\"accx\":{\"condition\":[\"servicedata\",0,\"21010f\"],\"decoder\":[\"value_from_hex_data\",\"servicedata\",18,4,false,true]},\"accy\":{\"condition\":[\"servicedata\",0,\"21010f\"],\"decoder\":[\"value_from_hex_data\",\"servicedata\",22,4,false,true]},\"accz\":{\"condition\":[\"servicedata\",0,\"21010f\"],\"decoder\":[\"value_from_hex_data\",\"servicedata\",26,4,false,true]}}}";
|
||||
/*R""""(
|
||||
{
|
||||
"brand":"KKM",
|
||||
"model":"Tracking K9",
|
||||
"model_id":"K9",
|
||||
"tag":"0708",
|
||||
"condition":["servicedata", "=", 30, "index", 0, "21010f", "&", "uuid", "index", 0, "feaa"],
|
||||
"properties":{
|
||||
".cal":{
|
||||
"decoder":["value_from_hex_data", "servicedata", 12, 2, false, false],
|
||||
"post_proc":["/", 256, "*", 100, ">", 0, "/", 100]
|
||||
},
|
||||
"tempc":{
|
||||
"decoder":["value_from_hex_data", "servicedata", 10, 2, false, true],
|
||||
"post_proc":["+", ".cal"]
|
||||
},
|
||||
"_.cal":{
|
||||
"decoder":["value_from_hex_data", "servicedata", 16, 2, false, false],
|
||||
"post_proc":["/", 256, "*", 100, ">", 0, "/", 100]
|
||||
},
|
||||
"hum":{
|
||||
"decoder":["value_from_hex_data", "servicedata", 14, 2, false, false],
|
||||
"post_proc":["+", ".cal"]
|
||||
},
|
||||
"volt":{
|
||||
"decoder":["value_from_hex_data", "servicedata", 6, 4, false, false],
|
||||
"post_proc":["/", 1000]
|
||||
},
|
||||
"accx":{
|
||||
"condition":["servicedata", 0, "21010f"],
|
||||
"decoder":["value_from_hex_data", "servicedata", 18, 4, false, true]
|
||||
},
|
||||
"accy":{
|
||||
"condition":["servicedata", 0, "21010f"],
|
||||
"decoder":["value_from_hex_data", "servicedata", 22, 4, false, true]
|
||||
},
|
||||
"accz":{
|
||||
"condition":["servicedata", 0, "21010f"],
|
||||
"decoder":["value_from_hex_data", "servicedata", 26, 4, false, true]
|
||||
}
|
||||
}
|
||||
})"""";*/
|
||||
|
||||
const char* _KKM_K9_json_props = "{\"properties\":{\"tempc\":{\"unit\":\"°C\",\"name\":\"temperature\"},\"hum\":{\"unit\":\"%\",\"name\":\"humidity\"},\"volt\":{\"unit\":\"V\",\"name\":\"voltage\"},\"accx\":{\"unit\":\"m/s²\",\"name\":\"acceleration x\"},\"accy\":{\"unit\":\"m/s²\",\"name\":\"acceleration y\"},\"accz\":{\"unit\":\"m/s²\",\"name\":\"acceleration z\"}}}";
|
||||
/*R""""(
|
||||
{
|
||||
"properties":{
|
||||
"tempc":{
|
||||
"unit":"°C",
|
||||
"name":"temperature"
|
||||
},
|
||||
"hum":{
|
||||
"unit":"%",
|
||||
"name":"humidity"
|
||||
},
|
||||
"volt":{
|
||||
"unit":"V",
|
||||
"name":"voltage"
|
||||
},
|
||||
"accx":{
|
||||
"unit":"m/s²",
|
||||
"name":"acceleration x"
|
||||
},
|
||||
"accy":{
|
||||
"unit":"m/s²",
|
||||
"name":"acceleration y"
|
||||
},
|
||||
"accz":{
|
||||
"unit":"m/s²",
|
||||
"name":"acceleration z"
|
||||
}
|
||||
}
|
||||
})"""";*/
|
||||
32
lib/decoder/src/devices/LYWSD02_json.h
Normal file
32
lib/decoder/src/devices/LYWSD02_json.h
Normal file
@@ -0,0 +1,32 @@
|
||||
#include "common_props.h"
|
||||
|
||||
const char* _LYWSD02_json = "{\"brand\":\"Xiaomi/Mijia\",\"model\":\"e-ink Clock\",\"model_id\":\"LYWSD02\",\"tag\":\"01\",\"condition\":[\"uuid\",\"index\",0,\"fe95\",\"&\",\"servicedata\",\"index\",4,\"5b04\"],\"properties\":{\"tempc\":{\"condition\":[\"servicedata\",24,\"0410\"],\"decoder\":[\"value_from_hex_data\",\"servicedata\",30,4,true],\"post_proc\":[\"/\",10]},\"hum\":{\"condition\":[\"servicedata\",24,\"0610\"],\"decoder\":[\"value_from_hex_data\",\"servicedata\",30,4,true,false],\"post_proc\":[\"/\",10]},\"batt\":{\"condition\":[\"servicedata\",24,\"0a10\"],\"decoder\":[\"value_from_hex_data\",\"servicedata\",30,2,false,false]},\"mac\":{\"decoder\":[\"revmac_from_hex_data\",\"servicedata\",10]}}}";
|
||||
/* R""""(
|
||||
{
|
||||
"brand":"Xiaomi/Mijia",
|
||||
"model":"e-ink Clock",
|
||||
"model_id":"LYWSD02",
|
||||
"tag":"01",
|
||||
"condition":["uuid", "index", 0, "fe95", "&", "servicedata", "index", 4, "5b04"],
|
||||
"properties":{
|
||||
"tempc":{
|
||||
"condition":["servicedata", 24, "0410"],
|
||||
"decoder":["value_from_hex_data", "servicedata", 30, 4, true],
|
||||
"post_proc":["/", 10]
|
||||
},
|
||||
"hum":{
|
||||
"condition":["servicedata", 24, "0610"],
|
||||
"decoder":["value_from_hex_data", "servicedata", 30, 4, true, false],
|
||||
"post_proc":["/", 10]
|
||||
},
|
||||
"batt":{
|
||||
"condition":["servicedata", 24, "0a10"],
|
||||
"decoder":["value_from_hex_data", "servicedata", 30, 2, false, false]
|
||||
},
|
||||
"mac":{
|
||||
"decoder":["revmac_from_hex_data", "servicedata", 10]
|
||||
}
|
||||
}
|
||||
})"""";*/
|
||||
|
||||
const char* _LYWSD02_json_props = _common_BTHM_props;
|
||||
39
lib/decoder/src/devices/LYWSD03MMC_ENCR_json.h
Normal file
39
lib/decoder/src/devices/LYWSD03MMC_ENCR_json.h
Normal file
@@ -0,0 +1,39 @@
|
||||
const char* _LYWSD03MMC_ENCR_json_PVVX = "{\"brand\":\"Xiaomi\",\"model\":\"TH Sensor\",\"model_id\":\"LYWSD03MMC/MJWSD05MMC_PVVX_ENCR\",\"tag\":\"010001\",\"condition\":[\"servicedata\",\"=\",22,\"&\",\"uuid\",\"index\",0,\"181a\"],\"properties\":{\"cipher\":{\"decoder\":[\"string_from_hex_data\",\"servicedata\",2,12]},\"ctr\":{\"decoder\":[\"string_from_hex_data\",\"servicedata\",0,2]},\"mic\":{\"decoder\":[\"string_from_hex_data\",\"servicedata\",14,8]}}}";
|
||||
/*R""""(
|
||||
{
|
||||
"brand":"Xiaomi",
|
||||
"model":"TH Sensor",
|
||||
"model_id":"LYWSD03MMC/MJWSD05MMC_PVVX_ENCR",
|
||||
"tag":"010001",
|
||||
"condition":["servicedata", "=", 22, "&", "uuid", "index", 0, "181a"],
|
||||
"properties":{
|
||||
"cipher":{
|
||||
"decoder":["string_from_hex_data", "servicedata", 2, 12]
|
||||
},
|
||||
"ctr":{
|
||||
"decoder":["string_from_hex_data", "servicedata", 0, 2]
|
||||
},
|
||||
"mic":{
|
||||
"decoder":["string_from_hex_data", "servicedata", 14, 8]
|
||||
}
|
||||
}
|
||||
})"""";*/
|
||||
|
||||
const char* _LYWSD03MMC_ENCR_json_props = "{\"properties\":{\"cipher\":{\"unit\":\"hex\",\"name\":\"ciphertext\"},\"ctr\":{\"unit\":\"hex\",\"name\":\"counter\"},\"mic\":{\"unit\":\"hex\",\"name\":\"message integrity check\"}}}";
|
||||
/*R""""(
|
||||
{
|
||||
"properties":{
|
||||
"cipher":{
|
||||
"unit":"hex",
|
||||
"name":"ciphertext"
|
||||
},
|
||||
"ctr":{
|
||||
"unit":"hex",
|
||||
"name":"counter"
|
||||
},
|
||||
"mic":{
|
||||
"unit":"hex",
|
||||
"name":"message integrity check"
|
||||
}
|
||||
}
|
||||
})"""";*/
|
||||
85
lib/decoder/src/devices/LYWSD03MMC_json.h
Normal file
85
lib/decoder/src/devices/LYWSD03MMC_json.h
Normal file
@@ -0,0 +1,85 @@
|
||||
#include "common_props.h"
|
||||
|
||||
const char* _LYWSD03MMC_json_ATC = "{\"brand\":\"Xiaomi\",\"model\":\"TH Sensor\",\"model_id\":\"LYWSD03MMC/MJWSD05MMC_ATC\",\"tag\":\"01\",\"condition\":[\"servicedata\",\"=\",26,\"index\",0,\"a4c138\",\"&\",\"uuid\",\"index\",0,\"181a\"],\"properties\":{\"tempc\":{\"decoder\":[\"value_from_hex_data\",\"servicedata\",12,4,false,true],\"post_proc\":[\"/\",10]},\"hum\":{\"decoder\":[\"value_from_hex_data\",\"servicedata\",16,2,false,false]},\"batt\":{\"decoder\":[\"value_from_hex_data\",\"servicedata\",18,2,false,false]},\"volt\":{\"decoder\":[\"value_from_hex_data\",\"servicedata\",20,4,false,false],\"post_proc\":[\"/\",1000]},\"mac\":{\"decoder\":[\"mac_from_hex_data\",\"servicedata\",0]}}}";
|
||||
/* R""""(
|
||||
{
|
||||
"brand":"Xiaomi",
|
||||
"model":"TH Sensor",
|
||||
"model_id":"LYWSD03MMC/MJWSD05MMC_ATC",
|
||||
"tag":"01",
|
||||
"condition":["servicedata", "=", 26, "index", 0 , "a4c138", "&", "uuid", "index", 0, "181a"],
|
||||
"properties":{
|
||||
"tempc":{
|
||||
"decoder":["value_from_hex_data", "servicedata", 12, 4, false, true],
|
||||
"post_proc":["/", 10]
|
||||
},
|
||||
"hum":{
|
||||
"decoder":["value_from_hex_data", "servicedata", 16, 2, false, false]
|
||||
},
|
||||
"batt":{
|
||||
"decoder":["value_from_hex_data", "servicedata", 18, 2, false, false]
|
||||
},
|
||||
"volt":{
|
||||
"decoder":["value_from_hex_data", "servicedata", 20, 4, false, false],
|
||||
"post_proc":["/", 1000]
|
||||
},
|
||||
"mac":{
|
||||
"decoder":["mac_from_hex_data", "servicedata", 0]
|
||||
}
|
||||
}
|
||||
})"""";*/
|
||||
|
||||
const char* _LYWSD03MMC_json_PVVX = "{\"brand\":\"Xiaomi\",\"model\":\"TH Sensor\",\"model_id\":\"LYWSD03MMC/MJWSD05MMC_PVVX\",\"tag\":\"01\",\"condition\":[\"servicedata\",\"=\",30,\"index\",6,\"38c1a4\",\"&\",\"uuid\",\"index\",0,\"181a\"],\"properties\":{\"tempc\":{\"decoder\":[\"value_from_hex_data\",\"servicedata\",12,4,true,true],\"post_proc\":[\"/\",100]},\"hum\":{\"decoder\":[\"value_from_hex_data\",\"servicedata\",16,4,true,false],\"post_proc\":[\"/\",100]},\"batt\":{\"decoder\":[\"value_from_hex_data\",\"servicedata\",24,2,false,false]},\"volt\":{\"decoder\":[\"value_from_hex_data\",\"servicedata\",20,4,true,false],\"post_proc\":[\"/\",1000]},\"mac\":{\"decoder\":[\"revmac_from_hex_data\",\"servicedata\",0]}}}";
|
||||
/* R""""(
|
||||
{
|
||||
"brand":"Xiaomi",
|
||||
"model":"TH Sensor",
|
||||
"model_id":"LYWSD03MMC/MJWSD05MMC_PVVX",
|
||||
"tag":"01",
|
||||
"condition":["servicedata", "=", 30, "index", 6 , "38c1a4", "&", "uuid", "index", 0, "181a"],
|
||||
"properties":{
|
||||
"tempc":{
|
||||
"decoder":["value_from_hex_data", "servicedata", 12, 4, true, true],
|
||||
"post_proc":["/", 100]
|
||||
},
|
||||
"hum":{
|
||||
"decoder":["value_from_hex_data", "servicedata", 16, 4, true, false],
|
||||
"post_proc":["/", 100]
|
||||
},
|
||||
"batt":{
|
||||
"decoder":["value_from_hex_data", "servicedata", 24, 2, false, false]
|
||||
},
|
||||
"volt":{
|
||||
"decoder":["value_from_hex_data", "servicedata", 20, 4, true, false],
|
||||
"post_proc":["/", 1000]
|
||||
},
|
||||
"mac":{
|
||||
"decoder":["revmac_from_hex_data", "servicedata", 0]
|
||||
}
|
||||
}
|
||||
})"""";*/
|
||||
|
||||
const char* _LYWSD03MMC_json_PVVX_DECR = "{\"brand\":\"Xiaomi\",\"model\":\"TH Sensor\",\"model_id\":\"LYWSD03MMC/MJWSD05MMC_PVVX_DECR\",\"tag\":\"01\",\"condition\":[\"servicedata\",\"=\",12,\"&\",\"uuid\",\"index\",0,\"181a\"],\"properties\":{\"tempc\":{\"decoder\":[\"value_from_hex_data\",\"servicedata\",0,4,true,true],\"post_proc\":[\"/\",100]},\"hum\":{\"decoder\":[\"value_from_hex_data\",\"servicedata\",4,4,true,false],\"post_proc\":[\"/\",100]},\"batt\":{\"decoder\":[\"value_from_hex_data\",\"servicedata\",8,2,false,false]}}}";
|
||||
/* R""""(
|
||||
{
|
||||
"brand":"Xiaomi",
|
||||
"model":"TH Sensor",
|
||||
"model_id":"LYWSD03MMC/MJWSD05MMC_PVVX_DECR",
|
||||
"tag":"01",
|
||||
"condition":["servicedata", "=", 12, "&", "uuid", "index", 0, "181a"],
|
||||
"properties":{
|
||||
"tempc":{
|
||||
"decoder":["value_from_hex_data", "servicedata", 0, 4, true, true],
|
||||
"post_proc":["/", 100]
|
||||
},
|
||||
"hum":{
|
||||
"decoder":["value_from_hex_data", "servicedata", 4, 4, true, false],
|
||||
"post_proc":["/", 100]
|
||||
},
|
||||
"batt":{
|
||||
"decoder":["value_from_hex_data", "servicedata", 8, 2, false, false]
|
||||
}
|
||||
}
|
||||
})"""";*/
|
||||
|
||||
const char* _LYWSD03MMC_json_props = _common_BVTH_props;
|
||||
37
lib/decoder/src/devices/LYWSDCGQ_json.h
Normal file
37
lib/decoder/src/devices/LYWSDCGQ_json.h
Normal file
@@ -0,0 +1,37 @@
|
||||
#include "common_props.h"
|
||||
|
||||
const char* _LYWSDCGQ_json = "{\"brand\":\"Xiaomi\",\"model\":\"Mi Jia round\",\"model_id\":\"LYWSDCGQ\",\"tag\":\"01\",\"condition\":[\"servicedata\",\"index\",2,\"20aa01\"],\"properties\":{\"batt\":{\"condition\":[\"servicedata\",23,\"a\"],\"decoder\":[\"value_from_hex_data\",\"servicedata\",28,2,true,false]},\"tempc\":{\"condition\":[\"servicedata\",23,\"d\",\"|\",\"servicedata\",23,\"4\"],\"decoder\":[\"value_from_hex_data\",\"servicedata\",28,4,true],\"post_proc\":[\"/\",10]},\"hum\":{\"condition\":[\"servicedata\",23,\"d\"],\"decoder\":[\"value_from_hex_data\",\"servicedata\",32,4,true,false],\"post_proc\":[\"/\",10]},\"_hum\":{\"condition\":[\"servicedata\",23,\"6\"],\"decoder\":[\"value_from_hex_data\",\"servicedata\",28,4,true,false],\"post_proc\":[\"/\",10]},\"mac\":{\"decoder\":[\"revmac_from_hex_data\",\"servicedata\",10]}}}";
|
||||
/*R""""(
|
||||
{
|
||||
"brand":"Xiaomi",
|
||||
"model":"Mi Jia round",
|
||||
"model_id":"LYWSDCGQ",
|
||||
"tag":"01",
|
||||
"condition":["servicedata", "index", 2, "20aa01"],
|
||||
"properties":{
|
||||
"batt":{
|
||||
"condition":["servicedata", 23, "a"],
|
||||
"decoder":["value_from_hex_data", "servicedata", 28, 2, true, false]
|
||||
},
|
||||
"tempc":{
|
||||
"condition":["servicedata", 23, "d", "|", "servicedata", 23, "4"],
|
||||
"decoder":["value_from_hex_data", "servicedata", 28, 4, true],
|
||||
"post_proc":["/", 10]
|
||||
},
|
||||
"hum":{
|
||||
"condition":["servicedata", 23, "d"],
|
||||
"decoder":["value_from_hex_data", "servicedata", 32, 4, true, false],
|
||||
"post_proc":["/", 10]
|
||||
},
|
||||
"_hum":{
|
||||
"condition":["servicedata", 23, "6"],
|
||||
"decoder":["value_from_hex_data", "servicedata", 28, 4, true, false],
|
||||
"post_proc":["/", 10]
|
||||
},
|
||||
"mac":{
|
||||
"decoder":["revmac_from_hex_data", "servicedata", 10]
|
||||
}
|
||||
}
|
||||
})"""";*/
|
||||
|
||||
const char* _LYWSDCGQ_json_props = _common_BTHM_props;
|
||||
82
lib/decoder/src/devices/MBXPRO_json.h
Normal file
82
lib/decoder/src/devices/MBXPRO_json.h
Normal file
@@ -0,0 +1,82 @@
|
||||
const char* _MBXPRO_json = "{\"brand\":\"Mokosmart\",\"model\":\"BeaconX Pro\",\"model_id\":\"MBXPRO\",\"tag\":\"0708\",\"condition\":[\"uuid\",\"index\",0,\"feab\"],\"properties\":{\"volt\":{\"condition\":[\"servicedata\",0,\"40\"],\"decoder\":[\"value_from_hex_data\",\"servicedata\",6,4,false],\"post_proc\":[\"/\",1000]},\"x_axis\":{\"condition\":[\"servicedata\",0,\"60\"],\"decoder\":[\"value_from_hex_data\",\"servicedata\",12,4,false],\"post_proc\":[\"/\",10000,\"*\",9.80665]},\"y_axis\":{\"condition\":[\"servicedata\",0,\"60\"],\"decoder\":[\"value_from_hex_data\",\"servicedata\",16,4,false],\"post_proc\":[\"/\",10000,\"*\",9.80665]},\"z_axis\":{\"condition\":[\"servicedata\",0,\"60\"],\"decoder\":[\"value_from_hex_data\",\"servicedata\",20,4,false],\"post_proc\":[\"/\",10000,\"*\",9.80665]},\"_volt\":{\"condition\":[\"servicedata\",0,\"60\"],\"decoder\":[\"value_from_hex_data\",\"servicedata\",24,4,false],\"post_proc\":[\"/\",1000]},\"tempc\":{\"condition\":[\"servicedata\",0,\"70\"],\"decoder\":[\"value_from_hex_data\",\"servicedata\",6,4,false],\"post_proc\":[\"/\",10]},\"hum\":{\"condition\":[\"servicedata\",0,\"70\"],\"decoder\":[\"value_from_hex_data\",\"servicedata\",10,4,false,false],\"post_proc\":[\"/\",10]},\"__volt\":{\"condition\":[\"servicedata\",0,\"70\"],\"decoder\":[\"value_from_hex_data\",\"servicedata\",14,4,false],\"post_proc\":[\"/\",1000]}}}";
|
||||
/*R""""(
|
||||
{
|
||||
"brand":"Mokosmart",
|
||||
"model":"BeaconX Pro",
|
||||
"model_id":"MBXPRO",
|
||||
"tag":"0708",
|
||||
"condition":["uuid", "index", 0, "feab"],
|
||||
"properties":{
|
||||
"volt":{
|
||||
"condition":["servicedata", 0, "40"],
|
||||
"decoder":["value_from_hex_data", "servicedata", 6, 4, false],
|
||||
"post_proc":["/", 1000]
|
||||
},
|
||||
"x_axis":{
|
||||
"condition":["servicedata", 0, "60"],
|
||||
"decoder":["value_from_hex_data", "servicedata", 12, 4, false],
|
||||
"post_proc":["/", 10000, "*", 9.80665]
|
||||
},
|
||||
"y_axis":{
|
||||
"condition":["servicedata", 0, "60"],
|
||||
"decoder":["value_from_hex_data", "servicedata", 16, 4, false],
|
||||
"post_proc":["/", 10000, "*", 9.80665]
|
||||
},
|
||||
"z_axis":{
|
||||
"condition":["servicedata", 0, "60"],
|
||||
"decoder":["value_from_hex_data", "servicedata", 20, 4, false],
|
||||
"post_proc":["/", 10000, "*", 9.80665]
|
||||
},
|
||||
"_volt":{
|
||||
"condition":["servicedata", 0, "60"],
|
||||
"decoder":["value_from_hex_data", "servicedata", 24, 4, false],
|
||||
"post_proc":["/", 1000]
|
||||
},
|
||||
"tempc":{
|
||||
"condition":["servicedata", 0, "70"],
|
||||
"decoder":["value_from_hex_data", "servicedata", 6, 4, false],
|
||||
"post_proc":["/", 10]
|
||||
},
|
||||
"hum":{
|
||||
"condition":["servicedata", 0, "70"],
|
||||
"decoder":["value_from_hex_data", "servicedata", 10, 4, false, false],
|
||||
"post_proc":["/", 10]
|
||||
},
|
||||
"__volt":{
|
||||
"condition":["servicedata", 0, "70"],
|
||||
"decoder":["value_from_hex_data", "servicedata", 14, 4, false],
|
||||
"post_proc":["/", 1000]
|
||||
}
|
||||
}
|
||||
})"""";*/
|
||||
|
||||
const char* _MBXPRO_json_props = "{\"properties\":{\"volt\":{\"unit\":\"V\",\"name\":\"voltage\"},\"x_axis\":{\"unit\":\"m/s²\",\"name\":\"x_axis\"},\"y_axis\":{\"unit\":\"m/s²\",\"name\":\"y_axis\"},\"z_axis\":{\"unit\":\"m/s²\",\"name\":\"z_axis\"},\"tempc\":{\"unit\":\"°C\",\"name\":\"temperature\"},\"hum\":{\"unit\":\"%\",\"name\":\"humidity\"}}}";
|
||||
/*R""""(
|
||||
{
|
||||
"properties":{
|
||||
"volt":{
|
||||
"unit":"V",
|
||||
"name":"voltage"
|
||||
},
|
||||
"x_axis":{
|
||||
"unit":"m/s²",
|
||||
"name":"x_axis"
|
||||
},
|
||||
"y_axis":{
|
||||
"unit":"m/s²",
|
||||
"name":"y_axis"
|
||||
},
|
||||
"z_axis":{
|
||||
"unit":"m/s²",
|
||||
"name":"z_axis"
|
||||
},
|
||||
"tempc":{
|
||||
"unit":"°C",
|
||||
"name":"temperature"
|
||||
},
|
||||
"hum":{
|
||||
"unit":"%",
|
||||
"name":"humidity"
|
||||
}
|
||||
}
|
||||
})"""";*/
|
||||
25
lib/decoder/src/devices/MS_CDP_json.h
Normal file
25
lib/decoder/src/devices/MS_CDP_json.h
Normal file
@@ -0,0 +1,25 @@
|
||||
const char* _MS_CDP_json = "{\"brand\":\"GENERIC\",\"model\":\"MS-CDP\",\"model_id\":\"MS-CDP\",\"tag\":\"fe\",\"condition\":[\"manufacturerdata\",\"index\",0,\"060001\"],\"properties\":{\"device\":{\"decoder\":[\"static_value\",\"Microsoft advertising beacon\"]}}}";
|
||||
/*R""""(
|
||||
{
|
||||
"brand":"GENERIC",
|
||||
"model":"MS-CDP",
|
||||
"model_id":"MS-CDP",
|
||||
"tag":"fe",
|
||||
"condition":["manufacturerdata", "index", 0, "060001"],
|
||||
"properties":{
|
||||
"device":{
|
||||
"decoder":["static_value", "Microsoft advertising beacon"]
|
||||
}
|
||||
}
|
||||
})"""";*/
|
||||
|
||||
const char* _MS_CDP_json_props = "{\"properties\":{\"device\":{\"unit\":\"string\",\"name\":\"device type\"}}}";
|
||||
/*R""""(
|
||||
{
|
||||
"properties":{
|
||||
"device":{
|
||||
"unit":"string",
|
||||
"name":"device type"
|
||||
}
|
||||
}
|
||||
})"""";*/
|
||||
34
lib/decoder/src/devices/MUE4094RT_json.h
Normal file
34
lib/decoder/src/devices/MUE4094RT_json.h
Normal file
@@ -0,0 +1,34 @@
|
||||
const char* _MUE4094RT_json = "{\"brand\":\"Xiaomi\",\"model\":\"MiLamp\",\"model_id\":\"MUE4094RT\",\"tag\":\"0404\",\"condition\":[\"servicedata\",\"index\",0,\"4030dd\"],\"properties\":{\"motion\":{\"decoder\":[\"static_value\",true],\"is_bool\":1},\"darkness\":{\"decoder\":[\"value_from_hex_data\",\"servicedata\",8,2,true]}}}";
|
||||
/*
|
||||
R""""(
|
||||
{
|
||||
"brand":"Xiaomi",
|
||||
"model":"MiLamp",
|
||||
"model_id":"MUE4094RT",
|
||||
"tag":"0404",
|
||||
"condition":["servicedata", "index", 0, "4030dd"],
|
||||
"properties":{
|
||||
"motion":{
|
||||
"decoder":["static_value", true],
|
||||
"is_bool":1
|
||||
},
|
||||
"darkness":{
|
||||
"decoder":["value_from_hex_data", "servicedata", 8, 2, true]
|
||||
}
|
||||
}
|
||||
})"""";*/
|
||||
|
||||
const char* _MUE4094RT_json_props = "{\"properties\":{\"motion\":{\"unit\":\"status\",\"name\":\"motion\"},\"darkness\":{\"unit\":\"lx\",\"name\":\"illuminance\"}}}";
|
||||
/*R""""(
|
||||
{
|
||||
"properties":{
|
||||
"motion":{
|
||||
"unit":"status",
|
||||
"name":"motion"
|
||||
},
|
||||
"darkness":{
|
||||
"unit":"lx",
|
||||
"name":"illuminance"
|
||||
}
|
||||
}
|
||||
})"""";*/
|
||||
49
lib/decoder/src/devices/Miband_json.h
Normal file
49
lib/decoder/src/devices/Miband_json.h
Normal file
@@ -0,0 +1,49 @@
|
||||
const char* _Miband_json = "{\"brand\":\"Xiaomi/Amazfit\",\"model\":\"Mi Band/Smart Watch\",\"model_id\":\"MB/SW\",\"tag\":\"0b0a\",\"condition\":[\"manufacturerdata\",\"=\",52,\"index\",0,\"5701\",\"&\",\"manufacturerdata\",\"mac@index\",40],\"conditionnomac\":[\"uuid\",\"contain\",\"fee0\"],\"properties\":{\"steps\":{\"condition\":[\"servicedata\",\"=\",8],\"decoder\":[\"value_from_hex_data\",\"servicedata\",0,4,true,false]},\"act_bpm\":{\"condition\":[\"manufacturerdata\",0,\"570102\",\"&\",\"manufacturerdata\",10,\"!\",\"f\"],\"decoder\":[\"value_from_hex_data\",\"manufacturerdata\",10,2,false,false]},\"device\":{\"decoder\":[\"static_value\",\"Xiaomi/Amazfit Tracker\"]},\"mac\":{\"decoder\":[\"mac_from_hex_data\",\"manufacturerdata\",40]}}}";
|
||||
/*R""""(
|
||||
{
|
||||
"brand":"Xiaomi/Amazfit",
|
||||
"model":"Mi Band/Smart Watch",
|
||||
"model_id":"MB/SW",
|
||||
"tag":"0b0a",
|
||||
"condition":["manufacturerdata", "=", 52, "index", 0, "5701", "&", "manufacturerdata", "mac@index", 40],
|
||||
"conditionnomac":["uuid", "contain", "fee0"],
|
||||
"properties":{
|
||||
"steps":{
|
||||
"condition":["servicedata", "=", 8],
|
||||
"decoder":["value_from_hex_data", "servicedata", 0, 4, true, false]
|
||||
},
|
||||
"act_bpm":{
|
||||
"condition":["manufacturerdata", 0, "570102", "&", "manufacturerdata", 10, "!", "f"],
|
||||
"decoder":["value_from_hex_data", "manufacturerdata", 10, 2, false, false]
|
||||
},
|
||||
"device":{
|
||||
"decoder":["static_value", "Xiaomi/Amazfit Tracker"]
|
||||
},
|
||||
"mac":{
|
||||
"decoder":["mac_from_hex_data", "manufacturerdata", 40]
|
||||
}
|
||||
}
|
||||
})"""";*/
|
||||
|
||||
const char* _Miband_json_props = "{\"properties\":{\"steps\":{\"unit\":\"int\",\"name\":\"step-count\"},\"act_bpm\":{\"unit\":\"bpm\",\"name\":\"activity heart rate\"},\"device\":{\"unit\":\"string\",\"name\":\"tracker device\"},\"mac\":{\"unit\":\"string\",\"name\":\"MAC address\"}}}";
|
||||
/*R""""(
|
||||
{
|
||||
"properties":{
|
||||
"steps":{
|
||||
"unit":"int",
|
||||
"name":"step-count"
|
||||
},
|
||||
"act_bpm":{
|
||||
"unit":"bpm",
|
||||
"name":"activity heart rate"
|
||||
},
|
||||
"device":{
|
||||
"unit":"string",
|
||||
"name":"tracker device"
|
||||
},
|
||||
"mac":{
|
||||
"unit":"string",
|
||||
"name":"MAC address"
|
||||
}
|
||||
}
|
||||
})"""";*/
|
||||
49
lib/decoder/src/devices/Mokobeacon_json.h
Normal file
49
lib/decoder/src/devices/Mokobeacon_json.h
Normal file
@@ -0,0 +1,49 @@
|
||||
const char* _Mokobeacon_json = "{\"brand\":\"Mokosmart\",\"model\":\"Beacon\",\"model_id\":\"Mokobeacon\",\"tag\":\"0708\",\"condition\":[\"uuid\",\"index\",0,\"ff01\"],\"properties\":{\"batt\":{\"decoder\":[\"value_from_hex_data\",\"servicedata\",0,2,false]},\"x_axis\":{\"decoder\":[\"value_from_hex_data\",\"servicedata\",14,4,false],\"post_proc\":[\"/\",10000,\"*\",9.80665]},\"y_axis\":{\"decoder\":[\"value_from_hex_data\",\"servicedata\",18,4,false],\"post_proc\":[\"/\",10000,\"*\",9.80665]},\"z_axis\":{\"decoder\":[\"value_from_hex_data\",\"servicedata\",22,4,false],\"post_proc\":[\"/\",10000,\"*\",9.80665]}}}";
|
||||
/*R""""(
|
||||
{
|
||||
"brand":"Mokosmart",
|
||||
"model":"Beacon",
|
||||
"model_id":"Mokobeacon",
|
||||
"tag":"0708",
|
||||
"condition":["uuid", "index", 0, "ff01"],
|
||||
"properties":{
|
||||
"batt":{
|
||||
"decoder":["value_from_hex_data", "servicedata", 0, 2, false]
|
||||
},
|
||||
"x_axis":{
|
||||
"decoder":["value_from_hex_data", "servicedata", 14, 4, false],
|
||||
"post_proc":["/", 10000, "*", 9.80665]
|
||||
},
|
||||
"y_axis":{
|
||||
"decoder":["value_from_hex_data", "servicedata", 18, 4, false],
|
||||
"post_proc":["/", 10000, "*", 9.80665]
|
||||
},
|
||||
"z_axis":{
|
||||
"decoder":["value_from_hex_data", "servicedata", 22, 4, false],
|
||||
"post_proc":["/", 10000, "*", 9.80665]
|
||||
}
|
||||
}
|
||||
})"""";*/
|
||||
|
||||
const char* _Mokobeacon_json_props = "{\"properties\":{\"batt\":{\"unit\":\"%\",\"name\":\"battery\"},\"x_axis\":{\"unit\":\"m/s²\",\"name\":\"x_axis\"},\"y_axis\":{\"unit\":\"m/s²\",\"name\":\"y_axis\"},\"z_axis\":{\"unit\":\"m/s²\",\"name\":\"z_axis\"}}}";
|
||||
/*R""""(
|
||||
{
|
||||
"properties":{
|
||||
"batt":{
|
||||
"unit":"%",
|
||||
"name":"battery"
|
||||
},
|
||||
"x_axis":{
|
||||
"unit":"m/s²",
|
||||
"name":"x_axis"
|
||||
},
|
||||
"y_axis":{
|
||||
"unit":"m/s²",
|
||||
"name":"y_axis"
|
||||
},
|
||||
"z_axis":{
|
||||
"unit":"m/s²",
|
||||
"name":"z_axis"
|
||||
}
|
||||
}
|
||||
})"""";*/
|
||||
91
lib/decoder/src/devices/Mopeka_json.h
Normal file
91
lib/decoder/src/devices/Mopeka_json.h
Normal file
@@ -0,0 +1,91 @@
|
||||
const char* _Mopeka_json = "{\"brand\":\"Mopeka/Lippert\",\"model\":\"Pro Check (Universal)/BottleCheck Sensor\",\"model_id\":\"M1017\",\"tag\":\"ff01\",\"condition\":[\"manufacturerdata\",\"=\",24,\"index\",0,\"590003\",\"|\",\"manufacturerdata\",\"=\",24,\"index\",0,\"590006\",\"|\",\"manufacturerdata\",\"=\",24,\"index\",0,\"59000c\"],\"properties\":{\"tempc\":{\"decoder\":[\"value_from_hex_data\",\"manufacturerdata\",8,2,false,true],\"post_proc\":[\"&\",127,\"-\",40,\"min\",-40]},\".cal\":{\"decoder\":[\"value_from_hex_data\",\"manufacturerdata\",8,2,false,true],\"post_proc\":[\"&\",127]},\"_.cal\":{\"decoder\":[\"value_from_hex_data\",\"manufacturerdata\",8,2,false,true],\"post_proc\":[\"&\",127,\"*\",\".cal\",\"*\",-0.00000535]},\"__.cal\":{\"decoder\":[\"value_from_hex_data\",\"manufacturerdata\",8,2,false,true],\"post_proc\":[\"&\",127,\"*\",-0.002822,\"+\",0.573045,\"+\",\".cal\"]},\"lvl_cm\":{\"decoder\":[\"value_from_hex_data\",\"manufacturerdata\",10,4,true,false],\"post_proc\":[\"&\",16383,\"*\",\".cal\",\"/\",10]},\"sync\":{\"decoder\":[\"bit_static_value\",\"manufacturerdata\",8,3,false,true]},\"volt\":{\"decoder\":[\"value_from_hex_data\",\"manufacturerdata\",6,2,false,false],\"post_proc\":[\"&\",127,\"/\",32]},\"batt\":{\"decoder\":[\"value_from_hex_data\",\"manufacturerdata\",6,2,false,false],\"post_proc\":[\"&\",127,\"/\",32,\"-\",2.2,\"/\",0.65,\"*\",100,\"max\",100,\"min\",0]},\"quality\":{\"decoder\":[\"value_from_hex_data\",\"manufacturerdata\",12,2,false,false],\"post_proc\":[\">\",6,\"max\",3,\"min\",0]},\"accx\":{\"decoder\":[\"value_from_hex_data\",\"manufacturerdata\",20,2,false,true]},\"accy\":{\"decoder\":[\"value_from_hex_data\",\"manufacturerdata\",22,2,false,true]}}}";
|
||||
/* R""""(
|
||||
{
|
||||
"brand":"Mopeka/Lippert",
|
||||
"model":"Pro Check (Universal)/BottleCheck Sensor",
|
||||
"model_id":"M1017",
|
||||
"tag":"ff01",
|
||||
"condition":["manufacturerdata", "=", 24, "index", 0, "590003", "|", "manufacturerdata", "=", 24, "index", 0, "590006", "|", "manufacturerdata", "=", 24, "index", 0, "59000c"],
|
||||
"properties":{
|
||||
"tempc":{
|
||||
"decoder":["value_from_hex_data", "manufacturerdata", 8, 2, false, true],
|
||||
"post_proc":["&", 127, "-", 40, "min", -40]
|
||||
},
|
||||
".cal":{
|
||||
"decoder":["value_from_hex_data", "manufacturerdata", 8, 2, false, true],
|
||||
"post_proc":["&", 127]
|
||||
},
|
||||
"_.cal":{
|
||||
"decoder":["value_from_hex_data", "manufacturerdata", 8, 2, false, true],
|
||||
"post_proc":["&", 127, "*", ".cal", "*", -0.00000535]
|
||||
},
|
||||
"__.cal":{
|
||||
"decoder":["value_from_hex_data", "manufacturerdata", 8, 2, false, true],
|
||||
"post_proc":["&", 127, "*", -0.002822, "+", 0.573045, "+", ".cal"]
|
||||
},
|
||||
"lvl_cm":{
|
||||
"decoder":["value_from_hex_data", "manufacturerdata", 10, 4, true, false],
|
||||
"post_proc":["&", 16383, "*", ".cal", "/", 10]
|
||||
},
|
||||
"sync":{
|
||||
"decoder":["bit_static_value", "manufacturerdata", 8, 3, false, true]
|
||||
},
|
||||
"volt":{
|
||||
"decoder":["value_from_hex_data", "manufacturerdata", 6, 2, false, false],
|
||||
"post_proc":["&", 127, "/", 32]
|
||||
},
|
||||
"batt":{
|
||||
"decoder":["value_from_hex_data", "manufacturerdata", 6, 2, false, false],
|
||||
"post_proc":["&", 127, "/", 32, "-", 2.2, "/", 0.65, "*", 100, "max", 100, "min", 0]
|
||||
},
|
||||
"quality":{
|
||||
"decoder":["value_from_hex_data", "manufacturerdata", 12, 2, false, false],
|
||||
"post_proc":[">", 6, "max", 3, "min", 0]
|
||||
},
|
||||
"accx":{
|
||||
"decoder":["value_from_hex_data", "manufacturerdata", 20, 2, false, true]
|
||||
},
|
||||
"accy":{
|
||||
"decoder":["value_from_hex_data", "manufacturerdata", 22, 2, false, true]
|
||||
}
|
||||
}
|
||||
})"""";*/
|
||||
|
||||
const char* _Mopeka_json_props = "{\"properties\":{\"tempc\":{\"unit\":\"°C\",\"name\":\"temperature\"},\"lvl_cm\":{\"unit\":\"cm\",\"name\":\"level in cm\"},\"sync\":{\"unit\":\"status\",\"name\":\"sync pressed\"},\"volt\":{\"unit\":\"V\",\"name\":\"voltage\"},\"batt\":{\"unit\":\"%\",\"name\":\"battery\"},\"quality\":{\"unit\":\"status\",\"name\":\"reading quality\"},\"accx\":{\"unit\":\"m/s²\",\"name\":\"acceleration x\"},\"accy\":{\"unit\":\"m/s²\",\"name\":\"acceleration y\"}}}";
|
||||
/*R""""(
|
||||
{
|
||||
"properties":{
|
||||
"tempc":{
|
||||
"unit":"°C",
|
||||
"name":"temperature"
|
||||
},
|
||||
"lvl_cm":{
|
||||
"unit":"cm",
|
||||
"name":"level in cm"
|
||||
},
|
||||
"sync":{
|
||||
"unit":"status",
|
||||
"name":"sync pressed"
|
||||
},
|
||||
"volt":{
|
||||
"unit":"V",
|
||||
"name":"voltage"
|
||||
},
|
||||
"batt":{
|
||||
"unit":"%",
|
||||
"name":"battery"
|
||||
},
|
||||
"quality":{
|
||||
"unit":"status",
|
||||
"name":"reading quality"
|
||||
},
|
||||
"accx":{
|
||||
"unit":"m/s²",
|
||||
"name":"acceleration x"
|
||||
},
|
||||
"accy":{
|
||||
"unit":"m/s²",
|
||||
"name":"acceleration y"
|
||||
}
|
||||
}
|
||||
})"""";*/
|
||||
78
lib/decoder/src/devices/OralB_json.h
Normal file
78
lib/decoder/src/devices/OralB_json.h
Normal file
@@ -0,0 +1,78 @@
|
||||
const char* _OralB_json = "{\"brand\":\"Oral-B\",\"model\":\"BT Toothbrush\",\"model_id\":\"ORALB_BT\",\"tag\":\"0b\",\"condition\":[\"manufacturerdata\",\">=\",22,\"index\",0,\"dc00\"],\"properties\":{\"state\":{\"decoder\":[\"string_from_hex_data\",\"manufacturerdata\",10,2],\"lookup\":[\"01\",\"initialising\",\"02\",\"idle\",\"03\",\"running\",\"04\",\"charging\",\"73\",\"sleeping\"]},\"mode\":{\"decoder\":[\"string_from_hex_data\",\"manufacturerdata\",18,2],\"lookup\":[\"00\",\"off\",\"01\",\"daily clean\",\"02\",\"sensitive\",\"03\",\"massage\",\"04\",\"whitening\",\"05\",\"deep clean\",\"06\",\"tongue cleaning\",\"07\",\"turbo\"]},\"sector\":{\"decoder\":[\"string_from_hex_data\",\"manufacturerdata\",20,2],\"lookup\":[\"01\",\"sector 1\",\"02\",\"sector 2\",\"03\",\"sector 3\",\"04\",\"sector 4\",\"05\",\"sector 5\",\"06\",\"sector 6\",\"07\",\"sector 7\",\"08\",\"sector 8\"]},\"pressure\":{\"decoder\":[\"value_from_hex_data\",\"manufacturerdata\",12,2,false,false]},\".cal\":{\"decoder\":[\"value_from_hex_data\",\"manufacturerdata\",16,2,false,false]},\"time\":{\"decoder\":[\"value_from_hex_data\",\"manufacturerdata\",14,2,false,false],\"post_proc\":[\"*\",60,\"+\",\".cal\"]}}}";
|
||||
/*R""""(
|
||||
{
|
||||
"brand":"Oral-B",
|
||||
"model":"BT Toothbrush",
|
||||
"model_id":"ORALB_BT",
|
||||
"tag":"0b",
|
||||
"condition":["manufacturerdata", ">=", 22, "index", 0, "dc00"],
|
||||
"properties":{
|
||||
"state":{
|
||||
"decoder":["string_from_hex_data", "manufacturerdata", 10, 2],
|
||||
"lookup":["01", "initialising",
|
||||
"02", "idle",
|
||||
"03", "running",
|
||||
"04", "charging",
|
||||
"73", "sleeping"]
|
||||
},
|
||||
"mode":{
|
||||
"decoder":["string_from_hex_data", "manufacturerdata", 18, 2],
|
||||
"lookup":["00", "off",
|
||||
"01", "daily clean",
|
||||
"02", "sensitive",
|
||||
"03", "massage",
|
||||
"04", "whitening",
|
||||
"05", "deep clean",
|
||||
"06", "tongue cleaning",
|
||||
"07", "turbo"]
|
||||
},
|
||||
"sector":{
|
||||
"decoder":["string_from_hex_data", "manufacturerdata", 20, 2],
|
||||
"lookup":["01", "sector 1",
|
||||
"02", "sector 2",
|
||||
"03", "sector 3",
|
||||
"04", "sector 4",
|
||||
"05", "sector 5",
|
||||
"06", "sector 6",
|
||||
"07", "sector 7",
|
||||
"08", "sector 8"]
|
||||
},
|
||||
"pressure":{
|
||||
"decoder":["value_from_hex_data", "manufacturerdata", 12, 2, false, false]
|
||||
},
|
||||
".cal":{
|
||||
"decoder":["value_from_hex_data", "manufacturerdata", 16, 2, false, false]
|
||||
},
|
||||
"time":{
|
||||
"decoder":["value_from_hex_data", "manufacturerdata", 14, 2, false, false],
|
||||
"post_proc":["*", 60, "+", ".cal"]
|
||||
}
|
||||
}
|
||||
})"""";*/
|
||||
|
||||
const char* _OralB_json_props = "{\"properties\":{\"state\":{\"unit\":\"string\",\"name\":\"state\"},\"mode\":{\"unit\":\"string\",\"name\":\"mode\"},\"sector\":{\"unit\":\"string\",\"name\":\"sector\"},\"pressure\":{\"unit\":\"int\",\"name\":\"pressure\"},\"time\":{\"unit\":\"int\",\"name\":\"time\"}}}";
|
||||
/*R""""(
|
||||
{
|
||||
"properties":{
|
||||
"state":{
|
||||
"unit":"string",
|
||||
"name":"state"
|
||||
},
|
||||
"mode":{
|
||||
"unit":"string",
|
||||
"name":"mode"
|
||||
},
|
||||
"sector":{
|
||||
"unit":"string",
|
||||
"name":"sector"
|
||||
},
|
||||
"pressure":{
|
||||
"unit":"int",
|
||||
"name":"pressure"
|
||||
},
|
||||
"time":{
|
||||
"unit":"int",
|
||||
"name":"time"
|
||||
}
|
||||
}
|
||||
})"""";*/
|
||||
25
lib/decoder/src/devices/PH10_json.h
Normal file
25
lib/decoder/src/devices/PH10_json.h
Normal file
@@ -0,0 +1,25 @@
|
||||
const char* _PH10_json = "{\"brand\":\"Polar\",\"model\":\"Heart Rate Sensor\",\"model_id\":\"H10\",\"tag\":\"0b00\",\"condition\":[\"manufacturerdata\",\"=\",12,\"index\",0,\"6b00\"],\"properties\":{\"bpm\":{\"decoder\":[\"value_from_hex_data\",\"manufacturerdata\",10,2,false,false]}}}";
|
||||
/*R""""(
|
||||
{
|
||||
"brand":"Polar",
|
||||
"model":"Heart Rate Sensor",
|
||||
"model_id":"H10",
|
||||
"tag":"0b00",
|
||||
"condition":["manufacturerdata", "=", 12, "index", 0, "6b00"],
|
||||
"properties":{
|
||||
"bpm":{
|
||||
"decoder":["value_from_hex_data", "manufacturerdata", 10, 2, false, false]
|
||||
}
|
||||
}
|
||||
})"""";*/
|
||||
|
||||
const char* _PH10_json_props = "{\"properties\":{\"bpm\":{\"unit\":\"bpm\",\"name\":\"heart rate\"}}}";
|
||||
/*R""""(
|
||||
{
|
||||
"properties":{
|
||||
"bpm":{
|
||||
"unit":"bpm",
|
||||
"name":"heart rate"
|
||||
}
|
||||
}
|
||||
})"""";*/
|
||||
154
lib/decoder/src/devices/RDL52832_json.h
Normal file
154
lib/decoder/src/devices/RDL52832_json.h
Normal file
@@ -0,0 +1,154 @@
|
||||
const char* _RDL52832_json = "{\"brand\":\"Radioland\",\"model\":\"RDL52832\",\"model_id\":\"RDL52832\",\"tag\":\"070a\",\"condition\":[\"manufacturerdata\",\"=\",50,\"&\",\"name\",\"index\",0,\"RDL52832\"],\"properties\":{\"mfid\":{\"decoder\":[\"string_from_hex_data\",\"manufacturerdata\",0,4]},\"uuid\":{\"decoder\":[\"string_from_hex_data\",\"manufacturerdata\",8,32]},\"major\":{\"decoder\":[\"value_from_hex_data\",\"manufacturerdata\",40,4,false]},\"minor\":{\"decoder\":[\"value_from_hex_data\",\"manufacturerdata\",44,4,false]},\"txpower\":{\"decoder\":[\"value_from_hex_data\",\"manufacturerdata\",48,2,false]},\"tempc\":{\"decoder\":[\"value_from_hex_data\",\"servicedata\",0,4,false,true],\"post_proc\":[\"/\",256]},\"hum\":{\"decoder\":[\"value_from_hex_data\",\"servicedata\",4,4,false,true],\"post_proc\":[\"/\",256]},\".cal\":{\"decoder\":[\"value_from_hex_data\",\"servicedata\",12,2,false,false],\"post_proc\":[\"/\",10]},\"accx\":{\"condition\":[\"servicedata\",8,\"0000\"],\"decoder\":[\"value_from_hex_data\",\"servicedata\",14,2,false,false],\"post_proc\":[\"/\",100,\"+\",\".cal\",\"*\",9.80665]},\"_accx\":{\"condition\":[\"servicedata\",8,\"0001\"],\"decoder\":[\"value_from_hex_data\",\"servicedata\",14,2,false,false],\"post_proc\":[\"/\",100,\"+\",\".cal\",\"+\",1,\"*\",9.80665]},\"__accx\":{\"condition\":[\"servicedata\",8,\"0100\"],\"decoder\":[\"value_from_hex_data\",\"servicedata\",14,2,false,false],\"post_proc\":[\"/\",100,\"+\",\".cal\",\"*\",-1,\"*\",9.80665]},\"___accx\":{\"condition\":[\"servicedata\",8,\"0101\"],\"decoder\":[\"value_from_hex_data\",\"servicedata\",14,2,false,false],\"post_proc\":[\"/\",100,\"+\",\".cal\",\"+\",1,\"*\",-1,\"*\",9.80665]},\"_.cal\":{\"decoder\":[\"value_from_hex_data\",\"servicedata\",20,2,false,false],\"post_proc\":[\"/\",10]},\"accy\":{\"condition\":[\"servicedata\",16,\"0000\"],\"decoder\":[\"value_from_hex_data\",\"servicedata\",22,2,false,false],\"post_proc\":[\"/\",100,\"+\",\".cal\",\"*\",9.80665]},\"_accy\":{\"condition\":[\"servicedata\",16,\"0001\"],\"decoder\":[\"value_from_hex_data\",\"servicedata\",22,2,false,false],\"post_proc\":[\"/\",100,\"+\",\".cal\",\"+\",1,\"*\",9.80665]},\"__accy\":{\"condition\":[\"servicedata\",16,\"0100\"],\"decoder\":[\"value_from_hex_data\",\"servicedata\",22,2,false,false],\"post_proc\":[\"/\",100,\"+\",\".cal\",\"*\",-1,\"*\",9.80665]},\"___accy\":{\"condition\":[\"servicedata\",16,\"0101\"],\"decoder\":[\"value_from_hex_data\",\"servicedata\",22,2,false,false],\"post_proc\":[\"/\",100,\"+\",\".cal\",\"+\",1,\"*\",-1,\"*\",9.80665]},\"__.cal\":{\"decoder\":[\"value_from_hex_data\",\"servicedata\",28,2,false,false],\"post_proc\":[\"/\",10]},\"accz\":{\"condition\":[\"servicedata\",24,\"0000\"],\"decoder\":[\"value_from_hex_data\",\"servicedata\",30,2,false,false],\"post_proc\":[\"/\",100,\"+\",\".cal\",\"*\",9.80665]},\"_accz\":{\"condition\":[\"servicedata\",24,\"0001\"],\"decoder\":[\"value_from_hex_data\",\"servicedata\",30,2,false,false],\"post_proc\":[\"/\",100,\"+\",\".cal\",\"+\",1,\"*\",9.80665]},\"__accz\":{\"condition\":[\"servicedata\",24,\"0100\"],\"decoder\":[\"value_from_hex_data\",\"servicedata\",30,2,false,false],\"post_proc\":[\"/\",100,\"+\",\".cal\",\"*\",-1,\"*\",9.80665]},\"___accz\":{\"condition\":[\"servicedata\",24,\"0101\"],\"decoder\":[\"value_from_hex_data\",\"servicedata\",30,2,false,false],\"post_proc\":[\"/\",100,\"+\",\".cal\",\"+\",1,\"*\",-1,\"*\",9.80665]}}}";
|
||||
|
||||
/*R""""(
|
||||
{
|
||||
"brand":"Radioland",
|
||||
"model":"RDL52832",
|
||||
"model_id":"RDL52832",
|
||||
"tag":"070a",
|
||||
"condition":["manufacturerdata", "=", 50, "&", "name", "index", 0, "RDL52832"],
|
||||
"properties":{
|
||||
"mfid":{
|
||||
"decoder":["string_from_hex_data", "manufacturerdata", 0, 4]
|
||||
},
|
||||
"uuid":{
|
||||
"decoder":["string_from_hex_data", "manufacturerdata", 8, 32]
|
||||
},
|
||||
"major":{
|
||||
"decoder":["value_from_hex_data", "manufacturerdata", 40, 4, false]
|
||||
},
|
||||
"minor":{
|
||||
"decoder":["value_from_hex_data", "manufacturerdata", 44, 4, false]
|
||||
},
|
||||
"txpower":{
|
||||
"decoder":["value_from_hex_data","manufacturerdata", 48, 2, false]
|
||||
},
|
||||
"tempc":{
|
||||
"decoder":["value_from_hex_data", "servicedata", 0, 4, false, true],
|
||||
"post_proc":["/", 256]
|
||||
},
|
||||
"hum":{
|
||||
"decoder":["value_from_hex_data", "servicedata", 4, 4, false, true],
|
||||
"post_proc":["/", 256]
|
||||
},
|
||||
".cal":{
|
||||
"decoder":["value_from_hex_data", "servicedata", 12, 2, false, false],
|
||||
"post_proc":["/", 10]
|
||||
},
|
||||
"accx":{
|
||||
"condition":["servicedata", 8, "0000"],
|
||||
"decoder":["value_from_hex_data", "servicedata", 14, 2, false, false],
|
||||
"post_proc":["/", 100, "+", ".cal", "*", 9.80665]
|
||||
},
|
||||
"_accx":{
|
||||
"condition":["servicedata", 8, "0001"],
|
||||
"decoder":["value_from_hex_data", "servicedata", 14, 2, false, false],
|
||||
"post_proc":["/", 100, "+", ".cal", "+", 1, "*", 9.80665]
|
||||
},
|
||||
"__accx":{
|
||||
"condition":["servicedata", 8, "0100"],
|
||||
"decoder":["value_from_hex_data", "servicedata", 14, 2, false, false],
|
||||
"post_proc":["/", 100, "+", ".cal", "*", -1, "*", 9.80665]
|
||||
},
|
||||
"___accx":{
|
||||
"condition":["servicedata", 8, "0101"],
|
||||
"decoder":["value_from_hex_data", "servicedata", 14, 2, false, false],
|
||||
"post_proc":["/", 100, "+", ".cal", "+", 1, "*", -1, "*", 9.80665]
|
||||
},
|
||||
"_.cal":{
|
||||
"decoder":["value_from_hex_data", "servicedata", 20, 2, false, false],
|
||||
"post_proc":["/", 10]
|
||||
},
|
||||
"accy":{
|
||||
"condition":["servicedata", 16, "0000"],
|
||||
"decoder":["value_from_hex_data", "servicedata", 22, 2, false, false],
|
||||
"post_proc":["/", 100, "+", ".cal", "*", 9.80665]
|
||||
},
|
||||
"_accy":{
|
||||
"condition":["servicedata", 16, "0001"],
|
||||
"decoder":["value_from_hex_data", "servicedata", 22, 2, false, false],
|
||||
"post_proc":["/", 100, "+", ".cal", "+", 1, "*", 9.80665]
|
||||
},
|
||||
"__accy":{
|
||||
"condition":["servicedata", 16, "0100"],
|
||||
"decoder":["value_from_hex_data", "servicedata", 22, 2, false, false],
|
||||
"post_proc":["/", 100, "+", ".cal", "*", -1, "*", 9.80665]
|
||||
},
|
||||
"___accy":{
|
||||
"condition":["servicedata", 16, "0101"],
|
||||
"decoder":["value_from_hex_data", "servicedata", 22, 2, false, false],
|
||||
"post_proc":["/", 100, "+", ".cal", "+", 1, "*", -1, "*", 9.80665]
|
||||
},
|
||||
"__.cal":{
|
||||
"decoder":["value_from_hex_data", "servicedata", 28, 2, false, false],
|
||||
"post_proc":["/", 10]
|
||||
},
|
||||
"accz":{
|
||||
"condition":["servicedata", 24, "0000"],
|
||||
"decoder":["value_from_hex_data", "servicedata", 30, 2, false, false],
|
||||
"post_proc":["/", 100, "+", ".cal", "*", 9.80665]
|
||||
},
|
||||
"_accz":{
|
||||
"condition":["servicedata", 24, "0001"],
|
||||
"decoder":["value_from_hex_data", "servicedata", 30, 2, false, false],
|
||||
"post_proc":["/", 100, "+", ".cal", "+", 1, "*", 9.80665]
|
||||
},
|
||||
"__accz":{
|
||||
"condition":["servicedata", 24, "0100"],
|
||||
"decoder":["value_from_hex_data", "servicedata", 30, 2, false, false],
|
||||
"post_proc":["/", 100, "+", ".cal", "*", -1, "*", 9.80665]
|
||||
},
|
||||
"___accz":{
|
||||
"condition":["servicedata", 24, "0101"],
|
||||
"decoder":["value_from_hex_data", "servicedata", 30, 2, false, false],
|
||||
"post_proc":["/", 100, "+", ".cal", "+", 1, "*", -1, "*", 9.80665]
|
||||
}
|
||||
}
|
||||
})"""";*/
|
||||
|
||||
const char* _RDL52832_json_props = "{\"properties\":{\"mfid\":{\"unit\":\"hex\",\"name\":\"manufacturer id\"},\"uuid\":{\"unit\":\"hex\",\"name\":\"service uuid\"},\"major\":{\"unit\":\"hex\",\"name\":\"major value\"},\"minor\":{\"unit\":\"hex\",\"name\":\"minor value\"},\"txpower\":{\"unit\":\"dBm\",\"name\":\"tx power @ 1 m\"},\"tempc\":{\"unit\":\"°C\",\"name\":\"temperature\"},\"hum\":{\"unit\":\"%\",\"name\":\"humidity\"},\"accx\":{\"unit\":\"m/s²\",\"name\":\"acceleration x\"},\"accy\":{\"unit\":\"m/s²\",\"name\":\"acceleration y\"},\"accz\":{\"unit\":\"m/s²\",\"name\":\"acceleration z\"}}}";
|
||||
/*R""""(
|
||||
{
|
||||
"properties":{
|
||||
"mfid":{
|
||||
"unit":"hex",
|
||||
"name":"manufacturer id"
|
||||
},
|
||||
"uuid":{
|
||||
"unit":"hex",
|
||||
"name":"service uuid"
|
||||
},
|
||||
"major":{
|
||||
"unit":"hex",
|
||||
"name":"major value"
|
||||
},
|
||||
"minor":{
|
||||
"unit":"hex",
|
||||
"name":"minor value"
|
||||
},
|
||||
"txpower":{
|
||||
"unit":"dBm",
|
||||
"name":"tx power @ 1 m"
|
||||
},
|
||||
"tempc":{
|
||||
"unit":"°C",
|
||||
"name":"temperature"
|
||||
},
|
||||
"hum":{
|
||||
"unit":"%",
|
||||
"name":"humidity"
|
||||
},
|
||||
"accx":{
|
||||
"unit":"m/s²",
|
||||
"name":"acceleration x"
|
||||
},
|
||||
"accy":{
|
||||
"unit":"m/s²",
|
||||
"name":"acceleration y"
|
||||
},
|
||||
"accz":{
|
||||
"unit":"m/s²",
|
||||
"name":"acceleration z"
|
||||
}
|
||||
}
|
||||
})"""";*/
|
||||
73
lib/decoder/src/devices/RuuviTag_RAWv1_json.h
Normal file
73
lib/decoder/src/devices/RuuviTag_RAWv1_json.h
Normal file
@@ -0,0 +1,73 @@
|
||||
const char* _RuuviTag_RAWv1_json = "{\"brand\":\"Ruuvi\",\"model\":\"RuuviTag\",\"model_id\":\"RuuviTag_RAWv1\",\"tag\":\"0708\",\"condition\":[\"manufacturerdata\",\"=\",32,\"index\",0,\"990403\"],\"properties\":{\"hum\":{\"decoder\":[\"value_from_hex_data\",\"manufacturerdata\",6,2,false,false],\"post_proc\":[\"/\",2]},\"tempc\":{\"decoder\":[\"bf_value_from_hex_data\",\"manufacturerdata\",8,4,false,true]},\"pres\":{\"decoder\":[\"value_from_hex_data\",\"manufacturerdata\",12,4,false,false],\"post_proc\":[\"+\",50000,\"/\",100]},\"accx\":{\"decoder\":[\"value_from_hex_data\",\"manufacturerdata\",16,4,false,true],\"post_proc\":[\"/\",10000,\"*\",9.80665]},\"accy\":{\"decoder\":[\"value_from_hex_data\",\"manufacturerdata\",20,4,false,true],\"post_proc\":[\"/\",10000,\"*\",9.80665]},\"accz\":{\"decoder\":[\"value_from_hex_data\",\"manufacturerdata\",24,4,false,true],\"post_proc\":[\"/\",10000,\"*\",9.80665]},\"volt\":{\"decoder\":[\"value_from_hex_data\",\"manufacturerdata\",28,4,false,false],\"post_proc\":[\"/\",1000]}}}";
|
||||
/*R""""(
|
||||
{
|
||||
"brand":"Ruuvi",
|
||||
"model":"RuuviTag",
|
||||
"model_id":"RuuviTag_RAWv1",
|
||||
"tag":"0708",
|
||||
"condition":["manufacturerdata", "=", 32, "index", 0, "990403"],
|
||||
"properties":{
|
||||
"hum":{
|
||||
"decoder":["value_from_hex_data", "manufacturerdata", 6, 2, false, false],
|
||||
"post_proc":["/", 2]
|
||||
},
|
||||
"tempc":{
|
||||
"decoder":["bf_value_from_hex_data", "manufacturerdata", 8, 4, false, true]
|
||||
},
|
||||
"pres":{
|
||||
"decoder":["value_from_hex_data", "manufacturerdata", 12, 4, false, false],
|
||||
"post_proc":["+", 50000, "/", 100]
|
||||
},
|
||||
"accx":{
|
||||
"decoder":["value_from_hex_data", "manufacturerdata", 16, 4, false, true],
|
||||
"post_proc":["/", 10000, "*", 9.80665]
|
||||
},
|
||||
"accy":{
|
||||
"decoder":["value_from_hex_data", "manufacturerdata", 20, 4, false, true],
|
||||
"post_proc":["/", 10000, "*", 9.80665]
|
||||
},
|
||||
"accz":{
|
||||
"decoder":["value_from_hex_data", "manufacturerdata", 24, 4, false, true],
|
||||
"post_proc":["/", 10000, "*", 9.80665]
|
||||
},
|
||||
"volt":{
|
||||
"decoder":["value_from_hex_data", "manufacturerdata", 28, 4, false, false],
|
||||
"post_proc":["/", 1000]
|
||||
}
|
||||
}
|
||||
})"""";*/
|
||||
|
||||
const char* _RuuviTag_RAWv1_json_props = "{\"properties\":{\"hum\":{\"unit\":\"%\",\"name\":\"humidity\"},\"tempc\":{\"unit\":\"°C\",\"name\":\"temperature\"},\"pres\":{\"unit\":\"hPa\",\"name\":\"pressure\"},\"accx\":{\"unit\":\"m/s²\",\"name\":\"acceleration x\"},\"accy\":{\"unit\":\"m/s²\",\"name\":\"acceleration y\"},\"accz\":{\"unit\":\"m/s²\",\"name\":\"acceleration z\"},\"volt\":{\"unit\":\"V\",\"name\":\"voltage\"}}}";
|
||||
/*R""""(
|
||||
{
|
||||
"properties":{
|
||||
"hum":{
|
||||
"unit":"%",
|
||||
"name":"humidity"
|
||||
},
|
||||
"tempc":{
|
||||
"unit":"°C",
|
||||
"name":"temperature"
|
||||
},
|
||||
"pres":{
|
||||
"unit":"hPa",
|
||||
"name":"pressure"
|
||||
},
|
||||
"accx":{
|
||||
"unit":"m/s²",
|
||||
"name":"acceleration x"
|
||||
},
|
||||
"accy":{
|
||||
"unit":"m/s²",
|
||||
"name":"acceleration y"
|
||||
},
|
||||
"accz":{
|
||||
"unit":"m/s²",
|
||||
"name":"acceleration z"
|
||||
},
|
||||
"volt":{
|
||||
"unit":"V",
|
||||
"name":"voltage"
|
||||
}
|
||||
}
|
||||
})"""";*/
|
||||
103
lib/decoder/src/devices/RuuviTag_RAWv2_json.h
Normal file
103
lib/decoder/src/devices/RuuviTag_RAWv2_json.h
Normal file
@@ -0,0 +1,103 @@
|
||||
const char* _RuuviTag_RAWv2_json = "{\"brand\":\"Ruuvi\",\"model\":\"RuuviTag\",\"model_id\":\"RuuviTag_RAWv2\",\"tag\":\"0708\",\"condition\":[\"manufacturerdata\",\"=\",52,\"index\",0,\"990405\"],\"properties\":{\"tempc\":{\"decoder\":[\"value_from_hex_data\",\"manufacturerdata\",6,4,false,true],\"post_proc\":[\"/\",200]},\"hum\":{\"decoder\":[\"value_from_hex_data\",\"manufacturerdata\",10,4,false,false],\"post_proc\":[\"/\",400]},\"pres\":{\"decoder\":[\"value_from_hex_data\",\"manufacturerdata\",14,4,false,false],\"post_proc\":[\"+\",50000,\"/\",100]},\"accx\":{\"decoder\":[\"value_from_hex_data\",\"manufacturerdata\",18,4,false,true],\"post_proc\":[\"/\",10000,\"*\",9.80665]},\"accy\":{\"decoder\":[\"value_from_hex_data\",\"manufacturerdata\",22,4,false,true],\"post_proc\":[\"/\",10000,\"*\",9.80665]},\"accz\":{\"decoder\":[\"value_from_hex_data\",\"manufacturerdata\",26,4,false,true],\"post_proc\":[\"/\",10000,\"*\",9.80665]},\"volt\":{\"decoder\":[\"value_from_hex_data\",\"manufacturerdata\",30,4,false,false],\"post_proc\":[\">\",5,\"+\",1600,\"/\",1000]},\"tx\":{\"decoder\":[\"value_from_hex_data\",\"manufacturerdata\",30,4,false,false],\"post_proc\":[\"%\",32,\"*\",2,\"-\",40]},\"mov\":{\"decoder\":[\"value_from_hex_data\",\"manufacturerdata\",34,2,false,false]},\"seq\":{\"decoder\":[\"value_from_hex_data\",\"manufacturerdata\",36,4,false,false]},\"mac\":{\"decoder\":[\"mac_from_hex_data\",\"manufacturerdata\",40]}}}";
|
||||
/*R""""(
|
||||
{
|
||||
"brand":"Ruuvi",
|
||||
"model":"RuuviTag",
|
||||
"model_id":"RuuviTag_RAWv2",
|
||||
"tag":"0708",
|
||||
"condition":["manufacturerdata", "=", 52, "index", 0, "990405"],
|
||||
"properties":{
|
||||
"tempc":{
|
||||
"decoder":["value_from_hex_data", "manufacturerdata", 6, 4, false, true],
|
||||
"post_proc":["/", 200]
|
||||
},
|
||||
"hum":{
|
||||
"decoder":["value_from_hex_data", "manufacturerdata", 10, 4, false, false],
|
||||
"post_proc":["/", 400]
|
||||
},
|
||||
"pres":{
|
||||
"decoder":["value_from_hex_data", "manufacturerdata", 14, 4, false, false],
|
||||
"post_proc":["+", 50000, "/", 100]
|
||||
},
|
||||
"accx":{
|
||||
"decoder":["value_from_hex_data", "manufacturerdata", 18, 4, false, true],
|
||||
"post_proc":["/", 10000, "*", 9.80665]
|
||||
},
|
||||
"accy":{
|
||||
"decoder":["value_from_hex_data", "manufacturerdata", 22, 4, false, true],
|
||||
"post_proc":["/", 10000, "*", 9.80665]
|
||||
},
|
||||
"accz":{
|
||||
"decoder":["value_from_hex_data", "manufacturerdata", 26, 4, false, true],
|
||||
"post_proc":["/", 10000, "*", 9.80665]
|
||||
},
|
||||
"volt":{
|
||||
"decoder":["value_from_hex_data", "manufacturerdata", 30, 4, false, false],
|
||||
"post_proc":[">", 5, "+", 1600, "/", 1000]
|
||||
},
|
||||
"tx":{
|
||||
"decoder":["value_from_hex_data", "manufacturerdata", 30, 4, false, false],
|
||||
"post_proc":["%", 32, "*", 2, "-", 40]
|
||||
},
|
||||
"mov":{
|
||||
"decoder":["value_from_hex_data", "manufacturerdata", 34, 2, false, false]
|
||||
},
|
||||
"seq":{
|
||||
"decoder":["value_from_hex_data", "manufacturerdata", 36, 4, false, false]
|
||||
},
|
||||
"mac":{
|
||||
"decoder":["mac_from_hex_data", "manufacturerdata", 40]
|
||||
}
|
||||
}
|
||||
})"""";*/
|
||||
|
||||
const char* _RuuviTag_RAWv2_json_props = "{\"properties\":{\"hum\":{\"unit\":\"%\",\"name\":\"humidity\"},\"tempc\":{\"unit\":\"°C\",\"name\":\"temperature\"},\"pres\":{\"unit\":\"hPa\",\"name\":\"pressure\"},\"accx\":{\"unit\":\"m/s²\",\"name\":\"acceleration x\"},\"accy\":{\"unit\":\"m/s²\",\"name\":\"acceleration y\"},\"accz\":{\"unit\":\"m/s²\",\"name\":\"acceleration z\"},\"volt\":{\"unit\":\"V\",\"name\":\"voltage\"},\"tx\":{\"unit\":\"dBm\",\"name\":\"tx power\"},\"mov\":{\"unit\":\"int\",\"name\":\"movement counter\"},\"seq\":{\"unit\":\"int\",\"name\":\"measurement sequence number\"},\"mac\":{\"unit\":\"string\",\"name\":\"MAC address\"}}}";
|
||||
/*R""""(
|
||||
{
|
||||
"properties":{
|
||||
"hum":{
|
||||
"unit":"%",
|
||||
"name":"humidity"
|
||||
},
|
||||
"tempc":{
|
||||
"unit":"°C",
|
||||
"name":"temperature"
|
||||
},
|
||||
"pres":{
|
||||
"unit":"hPa",
|
||||
"name":"pressure"
|
||||
},
|
||||
"accx":{
|
||||
"unit":"m/s²",
|
||||
"name":"acceleration x"
|
||||
},
|
||||
"accy":{
|
||||
"unit":"m/s²",
|
||||
"name":"acceleration y"
|
||||
},
|
||||
"accz":{
|
||||
"unit":"m/s²",
|
||||
"name":"acceleration z"
|
||||
},
|
||||
"volt":{
|
||||
"unit":"V",
|
||||
"name":"voltage"
|
||||
},
|
||||
"tx":{
|
||||
"unit":"dBm",
|
||||
"name":"tx power"
|
||||
},
|
||||
"mov":{
|
||||
"unit":"int",
|
||||
"name":"movement counter"
|
||||
},
|
||||
"seq":{
|
||||
"unit":"int",
|
||||
"name":"measurement sequence number"
|
||||
},
|
||||
"mac":{
|
||||
"unit":"string",
|
||||
"name":"MAC address"
|
||||
}
|
||||
}
|
||||
})"""";*/
|
||||
47
lib/decoder/src/devices/SBBT_002C_ENCR_json.h
Normal file
47
lib/decoder/src/devices/SBBT_002C_ENCR_json.h
Normal file
@@ -0,0 +1,47 @@
|
||||
const char* _SBBT_002C_ENCR_json = "{\"brand\":\"Shelly\",\"model\":\"ShellyBLU Button1 encrypted\",\"model_id\":\"SBBT_002C_ENCR\",\"tag\":\"110602\",\"condition\":[\"servicedata\",\"index\",0,\"41\",\"|\",\"servicedata\",\"index\",0,\"45\",\"&\",\"uuid\",\"index\",0,\"fcd2\",\"&\",\"name\",\"index\",0,\"SBBT-002C\"],\"properties\":{\"cipher\":{\"decoder\":[\"string_from_hex_data\",\"servicedata\",2,12]},\"ctr\":{\"decoder\":[\"string_from_hex_data\",\"servicedata\",14,8]},\"mic\":{\"decoder\":[\"string_from_hex_data\",\"servicedata\",22,8]},\"mac\":{\"condition\":[\"manufacturerdata\",\"=\",30],\"decoder\":[\"revmac_from_hex_data\",\"manufacturerdata\",18]}}}";
|
||||
/*R""""(
|
||||
{
|
||||
"brand":"Shelly",
|
||||
"model":"ShellyBLU Button1 encrypted",
|
||||
"model_id":"SBBT_002C_ENCR",
|
||||
"tag":"110602",
|
||||
"condition":["servicedata", "index", 0, "41", "|", "servicedata", "index", 0, "45", "&", "uuid", "index", 0, "fcd2", "&", "name", "index", 0, "SBBT-002C"],
|
||||
"properties":{
|
||||
"cipher":{
|
||||
"decoder":["string_from_hex_data", "servicedata", 2, 12]
|
||||
},
|
||||
"ctr":{
|
||||
"decoder":["string_from_hex_data", "servicedata", 14, 8]
|
||||
},
|
||||
"mic":{
|
||||
"decoder":["string_from_hex_data", "servicedata", 22, 8]
|
||||
},
|
||||
"mac":{
|
||||
"condition":["manufacturerdata", "=", 30],
|
||||
"decoder":["revmac_from_hex_data", "manufacturerdata", 18]
|
||||
}
|
||||
}
|
||||
})"""";*/
|
||||
|
||||
const char* _SBBT_002C_ENCR_json_props = "{\"properties\":{\"cipher\":{\"unit\":\"hex\",\"name\":\"ciphertext\"},\"ctr\":{\"unit\":\"hex\",\"name\":\"counter\"},\"mic\":{\"unit\":\"hex\",\"name\":\"message integrity check\"},\"mac\":{\"unit\":\"string\",\"name\":\"MAC address\"}}}";
|
||||
/*R""""(
|
||||
{
|
||||
"properties":{
|
||||
"cipher":{
|
||||
"unit":"hex",
|
||||
"name":"ciphertext"
|
||||
},
|
||||
"ctr":{
|
||||
"unit":"hex",
|
||||
"name":"counter"
|
||||
},
|
||||
"mic":{
|
||||
"unit":"hex",
|
||||
"name":"message integrity check"
|
||||
},
|
||||
"mac":{
|
||||
"unit":"string",
|
||||
"name":"MAC address"
|
||||
}
|
||||
}
|
||||
})"""";*/
|
||||
50
lib/decoder/src/devices/SBBT_002C_json.h
Normal file
50
lib/decoder/src/devices/SBBT_002C_json.h
Normal file
@@ -0,0 +1,50 @@
|
||||
const char* _SBBT_002C_json = "{\"brand\":\"Shelly\",\"model\":\"ShellyBLU Button1\",\"model_id\":\"SBBT-002C\",\"tag\":\"1106\",\"condition\":[\"servicedata\",\"=\",14,\"index\",0,\"40\",\"|\",\"servicedata\",\"=\",14,\"index\",0,\"44\",\"&\",\"uuid\",\"index\",0,\"fcd2\",\"&\",\"name\",\"index\",0,\"SBBT-002C\"],\"properties\":{\"packet\":{\"condition\":[\"servicedata\",2,\"00\"],\"decoder\":[\"value_from_hex_data\",\"servicedata\",4,2,false,false]},\"batt\":{\"condition\":[\"servicedata\",6,\"01\"],\"decoder\":[\"value_from_hex_data\",\"servicedata\",8,2,false,false]},\"press\":{\"condition\":[\"servicedata\",10,\"3a\"],\"decoder\":[\"value_from_hex_data\",\"servicedata\",12,2,false,false]},\"mac\":{\"condition\":[\"manufacturerdata\",\"=\",30],\"decoder\":[\"revmac_from_hex_data\",\"manufacturerdata\",18]}}}";
|
||||
/*R""""(
|
||||
{
|
||||
"brand":"Shelly",
|
||||
"model":"ShellyBLU Button1",
|
||||
"model_id":"SBBT-002C",
|
||||
"tag":"1106",
|
||||
"condition":["servicedata", "=", 14, "index", 0, "40", "|", "servicedata", "=", 14, "index", 0, "44", "&", "uuid", "index", 0, "fcd2", "&", "name", "index", 0, "SBBT-002C"],
|
||||
"properties":{
|
||||
"packet":{
|
||||
"condition":["servicedata", 2, "00"],
|
||||
"decoder":["value_from_hex_data", "servicedata", 4, 2, false, false]
|
||||
},
|
||||
"batt":{
|
||||
"condition":["servicedata", 6, "01"],
|
||||
"decoder":["value_from_hex_data", "servicedata", 8, 2, false, false]
|
||||
},
|
||||
"press":{
|
||||
"condition":["servicedata", 10, "3a"],
|
||||
"decoder":["value_from_hex_data", "servicedata", 12, 2, false, false]
|
||||
},
|
||||
"mac":{
|
||||
"condition":["manufacturerdata", "=", 30],
|
||||
"decoder":["revmac_from_hex_data", "manufacturerdata", 18]
|
||||
}
|
||||
}
|
||||
})"""";*/
|
||||
|
||||
const char* _SBBT_002C_json_props = "{\"properties\":{\"packet\":{\"unit\":\"int\",\"name\":\"packet id\"},\"batt\":{\"unit\":\"%\",\"name\":\"battery\"},\"press\":{\"unit\":\"int\",\"name\":\"press type\"},\"mac\":{\"unit\":\"string\",\"name\":\"MAC address\"}}}";
|
||||
/*R""""(
|
||||
{
|
||||
"properties":{
|
||||
"packet":{
|
||||
"unit":"int",
|
||||
"name":"packet id"
|
||||
},
|
||||
"batt":{
|
||||
"unit":"%",
|
||||
"name":"battery"
|
||||
},
|
||||
"press":{
|
||||
"unit":"int",
|
||||
"name":"press type"
|
||||
},
|
||||
"mac":{
|
||||
"unit":"string",
|
||||
"name":"MAC address"
|
||||
}
|
||||
}
|
||||
})"""";*/
|
||||
83
lib/decoder/src/devices/SBCS_json.h
Normal file
83
lib/decoder/src/devices/SBCS_json.h
Normal file
@@ -0,0 +1,83 @@
|
||||
const char* _SBCS_json = "{\"brand\":\"SwitchBot\",\"model\":\"Contact Sensor\",\"model_id\":\"W120150X\",\"tag\":\"0406\",\"condition\":[\"uuid\",\"index\",0,\"0d00\",\"|\",\"uuid\",\"index\",0,\"fd3d\",\"&\",\"servicedata\",\"=\",18,\"index\",0,\"64\"],\"properties\":{\"contact\":{\"condition\":[\"servicedata\",7,\"bit\",2,0],\"decoder\":[\"bit_static_value\",\"servicedata\",7,1,\"closed\",\"open\"]},\"_contact\":{\"condition\":[\"servicedata\",7,\"bit\",2,1],\"decoder\":[\"static_value\",\"timeout not closed\"]},\"motion\":{\"decoder\":[\"bit_static_value\",\"servicedata\",2,2,false,true]},\"lightlevel\":{\"decoder\":[\"bit_static_value\",\"servicedata\",7,0,\"dark\",\"bright\"]},\"scopetested\":{\"condition\":[\"servicedata\",2,\"bit\",3,0],\"decoder\":[\"static_value\",false]},\"in_ct\":{\"decoder\":[\"value_from_hex_data\",\"servicedata\",16,1,false,false],\"post_proc\":[\">\",2]},\"out_ct\":{\"decoder\":[\"value_from_hex_data\",\"servicedata\",16,1,false,false],\"post_proc\":[\"&\",3]},\"push_ct\":{\"decoder\":[\"value_from_hex_data\",\"servicedata\",17,1,false,false]},\"batt\":{\"decoder\":[\"value_from_hex_data\",\"servicedata\",4,2,false,false],\"post_proc\":[\"&\",127]}}}";
|
||||
/*R""""(
|
||||
{
|
||||
"brand":"SwitchBot",
|
||||
"model":"Contact Sensor",
|
||||
"model_id":"W120150X",
|
||||
"tag":"0406",
|
||||
"condition":["uuid", "index", 0, "0d00", "|", "uuid", "index", 0, "fd3d", "&", "servicedata", "=", 18, "index", 0, "64"],
|
||||
"properties":{
|
||||
"contact":{
|
||||
"condition":["servicedata", 7, "bit", 2, 0],
|
||||
"decoder":["bit_static_value", "servicedata", 7, 1, "closed", "open"]
|
||||
},
|
||||
"_contact":{
|
||||
"condition":["servicedata", 7, "bit", 2, 1],
|
||||
"decoder":["static_value", "timeout not closed"]
|
||||
},
|
||||
"motion":{
|
||||
"decoder":["bit_static_value", "servicedata", 2, 2, false, true]
|
||||
},
|
||||
"lightlevel":{
|
||||
"decoder":["bit_static_value", "servicedata", 7, 0, "dark", "bright"]
|
||||
},
|
||||
"scopetested":{
|
||||
"condition":["servicedata", 2, "bit", 3, 0],
|
||||
"decoder":["static_value", false]
|
||||
},
|
||||
"in_ct":{
|
||||
"decoder":["value_from_hex_data", "servicedata", 16, 1, false, false],
|
||||
"post_proc":[">", 2]
|
||||
},
|
||||
"out_ct":{
|
||||
"decoder":["value_from_hex_data", "servicedata", 16, 1, false, false],
|
||||
"post_proc":["&", 3]
|
||||
},
|
||||
"push_ct":{
|
||||
"decoder":["value_from_hex_data", "servicedata", 17, 1, false, false]
|
||||
},
|
||||
"batt":{
|
||||
"decoder":["value_from_hex_data", "servicedata", 4, 2, false, false],
|
||||
"post_proc":["&", 127]
|
||||
}
|
||||
}
|
||||
})"""";*/
|
||||
|
||||
const char* _SBCS_json_props = "{\"properties\":{\"contact\":{\"unit\":\"string\",\"name\":\"contact\"},\"motion\":{\"unit\":\"status\",\"name\":\"motion\"},\"lightlevel\":{\"unit\":\"string\",\"name\":\"light level\"},\"scopetested\":{\"unit\":\"status\",\"name\":\"scope tested\"},\"in_ct\":{\"unit\":\"int\",\"name\":\"in count\"},\"out_ct\":{\"unit\":\"int\",\"name\":\"out count\"},\"push_ct\":{\"unit\":\"int\",\"name\":\"push count\"},\"batt\":{\"unit\":\"%\",\"name\":\"battery\"}}}";
|
||||
/*R""""(
|
||||
{
|
||||
"properties":{
|
||||
"contact":{
|
||||
"unit":"string",
|
||||
"name":"contact"
|
||||
},
|
||||
"motion":{
|
||||
"unit":"status",
|
||||
"name":"motion"
|
||||
},
|
||||
"lightlevel":{
|
||||
"unit":"string",
|
||||
"name":"light level"
|
||||
},
|
||||
"scopetested":{
|
||||
"unit":"status",
|
||||
"name":"scope tested"
|
||||
},
|
||||
"in_ct":{
|
||||
"unit":"int",
|
||||
"name":"in count"
|
||||
},
|
||||
"out_ct":{
|
||||
"unit":"int",
|
||||
"name":"out count"
|
||||
},
|
||||
"push_ct":{
|
||||
"unit":"int",
|
||||
"name":"push count"
|
||||
},
|
||||
"batt":{
|
||||
"unit":"%",
|
||||
"name":"battery"
|
||||
}
|
||||
}
|
||||
})"""";*/
|
||||
55
lib/decoder/src/devices/SBCU_json.h
Normal file
55
lib/decoder/src/devices/SBCU_json.h
Normal file
@@ -0,0 +1,55 @@
|
||||
const char* _SBCU_json = "{\"brand\":\"SwitchBot\",\"model\":\"Curtain\",\"model_id\":\"W070160X\",\"tag\":\"0d02\",\"condition\":[\"servicedata\",\"=\",10,\"index\",0,\"63\",\"|\",\"servicedata\",\"=\",12,\"index\",0,\"63\",\"&\",[\"uuid\",\"index\",0,\"0d00\",\"|\",\"uuid\",\"index\",0,\"fd3d\"]],\"properties\":{\"moving\":{\"decoder\":[\"bit_static_value\",\"servicedata\",6,3,false,true]},\"position\":{\"decoder\":[\"value_from_hex_data\",\"servicedata\",6,2,false,false],\"post_proc\":[\"&\",127]},\"calibrated\":{\"decoder\":[\"bit_static_value\",\"servicedata\",2,2,false,true]},\"lightlevel\":{\"decoder\":[\"value_from_hex_data\",\"servicedata\",8,1,false,false]},\"batt\":{\"decoder\":[\"value_from_hex_data\",\"servicedata\",4,2,false,false],\"post_proc\":[\"&\",127]}}}";
|
||||
/*R""""(
|
||||
{
|
||||
"brand":"SwitchBot",
|
||||
"model":"Curtain",
|
||||
"model_id":"W070160X",
|
||||
"tag":"0d02",
|
||||
"condition":["servicedata", "=", 10, "index", 0, "63", "|", "servicedata", "=", 12, "index", 0, "63", "&", ["uuid", "index", 0, "0d00", "|", "uuid", "index", 0, "fd3d"]],
|
||||
"properties":{
|
||||
"moving":{
|
||||
"decoder":["bit_static_value", "servicedata", 6, 3, false, true]
|
||||
},
|
||||
"position":{
|
||||
"decoder":["value_from_hex_data", "servicedata", 6, 2, false, false],
|
||||
"post_proc":["&", 127]
|
||||
},
|
||||
"calibrated":{
|
||||
"decoder":["bit_static_value", "servicedata", 2, 2, false, true]
|
||||
},
|
||||
"lightlevel":{
|
||||
"decoder":["value_from_hex_data", "servicedata", 8, 1, false, false]
|
||||
},
|
||||
"batt":{
|
||||
"decoder":["value_from_hex_data", "servicedata", 4, 2, false, false],
|
||||
"post_proc":["&", 127]
|
||||
}
|
||||
}
|
||||
})"""";*/
|
||||
|
||||
const char* _SBCU_json_props = "{\"properties\":{\"moving\":{\"unit\":\"status\",\"name\":\"moving\"},\"position\":{\"unit\":\"%\",\"name\":\"position\"},\"calibrated\":{\"unit\":\"status\",\"name\":\"calibrated\"},\"lightlevel\":{\"unit\":\"int\",\"name\":\"light level\"},\"batt\":{\"unit\":\"%\",\"name\":\"battery\"}}}";
|
||||
/*R""""(
|
||||
{
|
||||
"properties":{
|
||||
"moving":{
|
||||
"unit":"status",
|
||||
"name":"moving"
|
||||
},
|
||||
"position":{
|
||||
"unit":"%",
|
||||
"name":"position"
|
||||
},
|
||||
"calibrated":{
|
||||
"unit":"status",
|
||||
"name":"calibrated"
|
||||
},
|
||||
"lightlevel":{
|
||||
"unit":"int",
|
||||
"name":"light level"
|
||||
},
|
||||
"batt":{
|
||||
"unit":"%",
|
||||
"name":"battery"
|
||||
}
|
||||
}
|
||||
})"""";*/
|
||||
47
lib/decoder/src/devices/SBDW_002C_ENCR_json.h
Normal file
47
lib/decoder/src/devices/SBDW_002C_ENCR_json.h
Normal file
@@ -0,0 +1,47 @@
|
||||
const char* _SBDW_002C_ENCR_json = "{\"brand\":\"Shelly\",\"model\":\"ShellyBLU Door/Window encrypted\",\"model_id\":\"SBDW_002C_ENCR\",\"tag\":\"040602\",\"condition\":[\"servicedata\",\"index\",0,\"45\",\"&\",\"uuid\",\"index\",0,\"fcd2\",\"&\",\"name\",\"index\",0,\"SBDW-002C\"],\"properties\":{\"cipher\":{\"decoder\":[\"string_from_hex_data\",\"servicedata\",2,26]},\"ctr\":{\"decoder\":[\"string_from_hex_data\",\"servicedata\",28,8]},\"mic\":{\"decoder\":[\"string_from_hex_data\",\"servicedata\",36,8]},\"mac\":{\"condition\":[\"manufacturerdata\",\"=\",30],\"decoder\":[\"revmac_from_hex_data\",\"manufacturerdata\",18]}}}";
|
||||
/*R""""(
|
||||
{
|
||||
"brand":"Shelly",
|
||||
"model":"ShellyBLU Door/Window encrypted",
|
||||
"model_id":"SBDW_002C_ENCR",
|
||||
"tag":"040602",
|
||||
"condition":["servicedata", "index", 0, "45", "&", "uuid", "index", 0, "fcd2", "&", "name", "index", 0, "SBDW-002C"],
|
||||
"properties":{
|
||||
"cipher":{
|
||||
"decoder":["string_from_hex_data", "servicedata", 2, 26]
|
||||
},
|
||||
"ctr":{
|
||||
"decoder":["string_from_hex_data", "servicedata", 28, 8]
|
||||
},
|
||||
"mic":{
|
||||
"decoder":["string_from_hex_data", "servicedata", 36, 8]
|
||||
},
|
||||
"mac":{
|
||||
"condition":["manufacturerdata", "=", 30],
|
||||
"decoder":["revmac_from_hex_data", "manufacturerdata", 18]
|
||||
}
|
||||
}
|
||||
})"""";*/
|
||||
|
||||
const char* _SBDW_002C_ENCR_json_props = "{\"properties\":{\"cipher\":{\"unit\":\"hex\",\"name\":\"ciphertext\"},\"ctr\":{\"unit\":\"hex\",\"name\":\"counter\"},\"mic\":{\"unit\":\"hex\",\"name\":\"message integrity check\"},\"mac\":{\"unit\":\"string\",\"name\":\"MAC address\"}}}";
|
||||
/*R""""(
|
||||
{
|
||||
"properties":{
|
||||
"cipher":{
|
||||
"unit":"hex",
|
||||
"name":"ciphertext"
|
||||
},
|
||||
"ctr":{
|
||||
"unit":"hex",
|
||||
"name":"counter"
|
||||
},
|
||||
"mic":{
|
||||
"unit":"hex",
|
||||
"name":"message integrity check"
|
||||
},
|
||||
"mac":{
|
||||
"unit":"string",
|
||||
"name":"MAC address"
|
||||
}
|
||||
}
|
||||
})"""";*/
|
||||
68
lib/decoder/src/devices/SBDW_002C_json.h
Normal file
68
lib/decoder/src/devices/SBDW_002C_json.h
Normal file
@@ -0,0 +1,68 @@
|
||||
const char* _SBDW_002C_json = "{\"brand\":\"Shelly\",\"model\":\"ShellyBLU Door/Window\",\"model_id\":\"SBDW-002C\",\"tag\":\"0406\",\"condition\":[\"servicedata\",\"=\",28,\"index\",0,\"44\",\"&\",\"uuid\",\"index\",0,\"fcd2\",\"&\",\"name\",\"index\",0,\"SBDW-002C\"],\"properties\":{\"packet\":{\"condition\":[\"servicedata\",2,\"00\"],\"decoder\":[\"value_from_hex_data\",\"servicedata\",4,2,false,false]},\"batt\":{\"condition\":[\"servicedata\",6,\"01\"],\"decoder\":[\"value_from_hex_data\",\"servicedata\",8,2,false,false]},\"lux\":{\"condition\":[\"servicedata\",10,\"05\"],\"decoder\":[\"value_from_hex_data\",\"servicedata\",12,6,true,false],\"post_proc\":[\"/\",100]},\"open\":{\"condition\":[\"servicedata\",18,\"2d\"],\"decoder\":[\"bit_static_value\",\"servicedata\",21,0,false,true]},\"rot\":{\"condition\":[\"servicedata\",22,\"3f\"],\"decoder\":[\"value_from_hex_data\",\"servicedata\",24,4,true,true],\"post_proc\":[\"/\",10]},\"mac\":{\"condition\":[\"manufacturerdata\",\"=\",30],\"decoder\":[\"revmac_from_hex_data\",\"manufacturerdata\",18]}}}";
|
||||
/*R""""(
|
||||
{
|
||||
"brand":"Shelly",
|
||||
"model":"ShellyBLU Door/Window",
|
||||
"model_id":"SBDW-002C",
|
||||
"tag":"0406",
|
||||
"condition":["servicedata", "=", 28, "index", 0, "44", "&", "uuid", "index", 0, "fcd2", "&", "name", "index", 0, "SBDW-002C"],
|
||||
"properties":{
|
||||
"packet":{
|
||||
"condition":["servicedata", 2, "00"],
|
||||
"decoder":["value_from_hex_data", "servicedata", 4, 2, false, false]
|
||||
},
|
||||
"batt":{
|
||||
"condition":["servicedata", 6, "01"],
|
||||
"decoder":["value_from_hex_data", "servicedata", 8, 2, false, false]
|
||||
},
|
||||
"lux":{
|
||||
"condition":["servicedata", 10, "05"],
|
||||
"decoder":["value_from_hex_data", "servicedata", 12, 6, true, false],
|
||||
"post_proc":["/", 100]
|
||||
},
|
||||
"open":{
|
||||
"condition":["servicedata", 18, "2d"],
|
||||
"decoder":["bit_static_value", "servicedata", 21, 0, false, true]
|
||||
},
|
||||
"rot":{
|
||||
"condition":["servicedata", 22, "3f"],
|
||||
"decoder":["value_from_hex_data", "servicedata", 24, 4, true, true],
|
||||
"post_proc":["/", 10]
|
||||
},
|
||||
"mac":{
|
||||
"condition":["manufacturerdata", "=", 30],
|
||||
"decoder":["revmac_from_hex_data", "manufacturerdata", 18]
|
||||
}
|
||||
}
|
||||
})"""";*/
|
||||
|
||||
const char* _SBDW_002C_json_props = "{\"properties\":{\"packet\":{\"unit\":\"int\",\"name\":\"packet id\"},\"batt\":{\"unit\":\"%\",\"name\":\"battery\"},\"lux\":{\"unit\":\"lux\",\"name\":\"illuminance\"},\"open\":{\"unit\":\"status\",\"name\":\"door\"},\"rot\":{\"unit\":\"0\",\"name\":\"rotation\"},\"mac\":{\"unit\":\"string\",\"name\":\"MAC address\"}}}";
|
||||
/*R""""(
|
||||
{
|
||||
"properties":{
|
||||
"packet":{
|
||||
"unit":"int",
|
||||
"name":"packet id"
|
||||
},
|
||||
"batt":{
|
||||
"unit":"%",
|
||||
"name":"battery"
|
||||
},
|
||||
"lux":{
|
||||
"unit":"lux",
|
||||
"name":"illuminance"
|
||||
},
|
||||
"open":{
|
||||
"unit":"status",
|
||||
"name":"door"
|
||||
},
|
||||
"rot":{
|
||||
"unit":"0",
|
||||
"name":"rotation"
|
||||
},
|
||||
"mac":{
|
||||
"unit":"string",
|
||||
"name":"MAC address"
|
||||
}
|
||||
}
|
||||
})"""";*/
|
||||
47
lib/decoder/src/devices/SBMO_003Z_ENCR_json.h
Normal file
47
lib/decoder/src/devices/SBMO_003Z_ENCR_json.h
Normal file
@@ -0,0 +1,47 @@
|
||||
const char* _SBMO_003Z_ENCR_json = "{\"brand\":\"Shelly\",\"model\":\"ShellyBLU Motion encrypted\",\"model_id\":\"SBMO_003Z_ENCR\",\"tag\":\"040602\",\"condition\":[\"servicedata\",\"index\",0,\"45\",\"&\",\"uuid\",\"index\",0,\"fcd2\",\"&\",\"name\",\"index\",0,\"SBMO-003Z\"],\"properties\":{\"cipher\":{\"decoder\":[\"string_from_hex_data\",\"servicedata\",2,20]},\"ctr\":{\"decoder\":[\"string_from_hex_data\",\"servicedata\",22,8]},\"mic\":{\"decoder\":[\"string_from_hex_data\",\"servicedata\",30,8]},\"mac\":{\"condition\":[\"manufacturerdata\",\"=\",30],\"decoder\":[\"revmac_from_hex_data\",\"manufacturerdata\",18]}}}";
|
||||
/*R""""(
|
||||
{
|
||||
"brand":"Shelly",
|
||||
"model":"ShellyBLU Motion encrypted",
|
||||
"model_id":"SBMO_003Z_ENCR",
|
||||
"tag":"040602",
|
||||
"condition":["servicedata", "index", 0, "45", "&", "uuid", "index", 0, "fcd2", "&", "name", "index", 0, "SBMO-003Z"],
|
||||
"properties":{
|
||||
"cipher":{
|
||||
"decoder":["string_from_hex_data", "servicedata", 2, 20]
|
||||
},
|
||||
"ctr":{
|
||||
"decoder":["string_from_hex_data", "servicedata", 22, 8]
|
||||
},
|
||||
"mic":{
|
||||
"decoder":["string_from_hex_data", "servicedata", 30, 8]
|
||||
},
|
||||
"mac":{
|
||||
"condition":["manufacturerdata", "=", 30],
|
||||
"decoder":["revmac_from_hex_data", "manufacturerdata", 18]
|
||||
}
|
||||
}
|
||||
})"""";*/
|
||||
|
||||
const char* _SBMO_003Z_ENCR_json_props = "{\"properties\":{\"cipher\":{\"unit\":\"hex\",\"name\":\"ciphertext\"},\"ctr\":{\"unit\":\"hex\",\"name\":\"counter\"},\"mic\":{\"unit\":\"hex\",\"name\":\"message integrity check\"},\"mac\":{\"unit\":\"string\",\"name\":\"MAC address\"}}}";
|
||||
/*R""""(
|
||||
{
|
||||
"properties":{
|
||||
"cipher":{
|
||||
"unit":"hex",
|
||||
"name":"ciphertext"
|
||||
},
|
||||
"ctr":{
|
||||
"unit":"hex",
|
||||
"name":"counter"
|
||||
},
|
||||
"mic":{
|
||||
"unit":"hex",
|
||||
"name":"message integrity check"
|
||||
},
|
||||
"mac":{
|
||||
"unit":"string",
|
||||
"name":"MAC address"
|
||||
}
|
||||
}
|
||||
})"""";*/
|
||||
59
lib/decoder/src/devices/SBMO_003Z_json.h
Normal file
59
lib/decoder/src/devices/SBMO_003Z_json.h
Normal file
@@ -0,0 +1,59 @@
|
||||
const char* _SBMO_003Z_json = "{\"brand\":\"Shelly\",\"model\":\"ShellyBLU Motion\",\"model_id\":\"SBMO-003Z\",\"tag\":\"0406\",\"condition\":[\"servicedata\",\"=\",22,\"index\",0,\"44\",\"&\",\"uuid\",\"index\",0,\"fcd2\",\"&\",\"name\",\"index\",0,\"SBMO-003Z\"],\"properties\":{\"packet\":{\"condition\":[\"servicedata\",2,\"00\"],\"decoder\":[\"value_from_hex_data\",\"servicedata\",4,2,false,false]},\"batt\":{\"condition\":[\"servicedata\",6,\"01\"],\"decoder\":[\"value_from_hex_data\",\"servicedata\",8,2,false,false]},\"lux\":{\"condition\":[\"servicedata\",10,\"05\"],\"decoder\":[\"value_from_hex_data\",\"servicedata\",12,6,true,false],\"post_proc\":[\"/\",100]},\"motion\":{\"condition\":[\"servicedata\",18,\"21\"],\"decoder\":[\"bit_static_value\",\"servicedata\",21,0,false,true]},\"mac\":{\"condition\":[\"manufacturerdata\",\"=\",30],\"decoder\":[\"revmac_from_hex_data\",\"manufacturerdata\",18]}}}";
|
||||
/*R""""(
|
||||
{
|
||||
"brand":"Shelly",
|
||||
"model":"ShellyBLU Motion",
|
||||
"model_id":"SBMO-003Z",
|
||||
"tag":"0406",
|
||||
"condition":["servicedata", "=", 22, "index", 0, "44", "&", "uuid", "index", 0, "fcd2", "&", "name", "index", 0, "SBMO-003Z"],
|
||||
"properties":{
|
||||
"packet":{
|
||||
"condition":["servicedata", 2, "00"],
|
||||
"decoder":["value_from_hex_data", "servicedata", 4, 2, false, false]
|
||||
},
|
||||
"batt":{
|
||||
"condition":["servicedata", 6, "01"],
|
||||
"decoder":["value_from_hex_data", "servicedata", 8, 2, false, false]
|
||||
},
|
||||
"lux":{
|
||||
"condition":["servicedata", 10, "05"],
|
||||
"decoder":["value_from_hex_data", "servicedata", 12, 6, true, false],
|
||||
"post_proc":["/", 100]
|
||||
},
|
||||
"motion":{
|
||||
"condition":["servicedata", 18, "21"],
|
||||
"decoder":["bit_static_value", "servicedata", 21, 0, false, true]
|
||||
},
|
||||
"mac":{
|
||||
"condition":["manufacturerdata", "=", 30],
|
||||
"decoder":["revmac_from_hex_data", "manufacturerdata", 18]
|
||||
}
|
||||
}
|
||||
})"""";*/
|
||||
|
||||
const char* _SBMO_003Z_json_props = "{\"properties\":{\"packet\":{\"unit\":\"int\",\"name\":\"packet id\"},\"batt\":{\"unit\":\"%\",\"name\":\"battery\"},\"lux\":{\"unit\":\"lux\",\"name\":\"illuminance\"},\"motion\":{\"unit\":\"status\",\"name\":\"motion\"},\"mac\":{\"unit\":\"string\",\"name\":\"MAC address\"}}}";
|
||||
/*R""""(
|
||||
{
|
||||
"properties":{
|
||||
"packet":{
|
||||
"unit":"int",
|
||||
"name":"packet id"
|
||||
},
|
||||
"batt":{
|
||||
"unit":"%",
|
||||
"name":"battery"
|
||||
},
|
||||
"lux":{
|
||||
"unit":"lux",
|
||||
"name":"illuminance"
|
||||
},
|
||||
"motion":{
|
||||
"unit":"status",
|
||||
"name":"motion"
|
||||
},
|
||||
"mac":{
|
||||
"unit":"string",
|
||||
"name":"MAC address"
|
||||
}
|
||||
}
|
||||
})"""";*/
|
||||
71
lib/decoder/src/devices/SBMS_json.h
Normal file
71
lib/decoder/src/devices/SBMS_json.h
Normal file
@@ -0,0 +1,71 @@
|
||||
const char* _SBMS_json = "{\"brand\":\"SwitchBot\",\"model\":\"Motion Sensor\",\"model_id\":\"W110150X\",\"tag\":\"0406\",\"condition\":[\"uuid\",\"index\",0,\"0d00\",\"|\",\"uuid\",\"index\",0,\"fd3d\",\"&\",\"servicedata\",\"=\",12,\"index\",0,\"73\"],\"properties\":{\"motion\":{\"decoder\":[\"bit_static_value\",\"servicedata\",2,2,false,true]},\"led\":{\"decoder\":[\"bit_static_value\",\"servicedata\",10,1,false,true]},\"scopetested\":{\"condition\":[\"servicedata\",2,\"bit\",3,0],\"decoder\":[\"static_value\",false]},\"sensingdistance\":{\"condition\":[\"servicedata\",11,\"bit\",3,0,\"&\",\"servicedata\",11,\"bit\",2,0],\"decoder\":[\"static_value\",\"long\"]},\"_sensingdistance\":{\"condition\":[\"servicedata\",11,\"bit\",3,0,\"&\",\"servicedata\",11,\"bit\",2,1],\"decoder\":[\"static_value\",\"middle\"]},\"__sensingdistance\":{\"condition\":[\"servicedata\",11,\"bit\",3,1,\"&\",\"servicedata\",11,\"bit\",2,0],\"decoder\":[\"static_value\",\"short\"]},\"lightlevel\":{\"decoder\":[\"bit_static_value\",\"servicedata\",11,1,\"dark\",\"bright\"]},\"batt\":{\"decoder\":[\"value_from_hex_data\",\"servicedata\",4,2,false,false],\"post_proc\":[\"&\",127]}}}";
|
||||
/*R""""(
|
||||
{
|
||||
"brand":"SwitchBot",
|
||||
"model":"Motion Sensor",
|
||||
"model_id":"W110150X",
|
||||
"tag":"0406",
|
||||
"condition":["uuid", "index", 0, "0d00", "|", "uuid", "index", 0, "fd3d", "&", "servicedata", "=", 12, "index", 0, "73"],
|
||||
"properties":{
|
||||
"motion":{
|
||||
"decoder":["bit_static_value", "servicedata", 2, 2, false, true]
|
||||
},
|
||||
"led":{
|
||||
"decoder":["bit_static_value", "servicedata", 10, 1, false, true]
|
||||
},
|
||||
"scopetested":{
|
||||
"condition":["servicedata", 2, "bit", 3, 0],
|
||||
"decoder":["static_value", false]
|
||||
},
|
||||
"sensingdistance":{
|
||||
"condition":["servicedata", 11, "bit", 3, 0, "&","servicedata", 11, "bit", 2, 0],
|
||||
"decoder":["static_value", "long"]
|
||||
},
|
||||
"_sensingdistance":{
|
||||
"condition":["servicedata", 11, "bit", 3, 0, "&","servicedata", 11, "bit", 2, 1],
|
||||
"decoder":["static_value", "middle"]
|
||||
},
|
||||
"__sensingdistance":{
|
||||
"condition":["servicedata", 11, "bit", 3, 1, "&","servicedata", 11, "bit", 2, 0],
|
||||
"decoder":["static_value", "short"]
|
||||
},
|
||||
"lightlevel":{
|
||||
"decoder":["bit_static_value", "servicedata", 11, 1, "dark", "bright"]
|
||||
},
|
||||
"batt":{
|
||||
"decoder":["value_from_hex_data", "servicedata", 4, 2, false, false],
|
||||
"post_proc":["&", 127]
|
||||
}
|
||||
}
|
||||
})"""";*/
|
||||
|
||||
const char* _SBMS_json_props = "{\"properties\":{\"motion\":{\"unit\":\"status\",\"name\":\"motion\"},\"led\":{\"unit\":\"status\",\"name\":\"LED\"},\"scopetested\":{\"unit\":\"status\",\"name\":\"scope tested\"},\"sensingdistance\":{\"unit\":\"string\",\"name\":\"sensing distance\"},\"lightlevel\":{\"unit\":\"string\",\"name\":\"light level\"},\"batt\":{\"unit\":\"%\",\"name\":\"battery\"}}}";
|
||||
/*R""""(
|
||||
{
|
||||
"properties":{
|
||||
"motion":{
|
||||
"unit":"status",
|
||||
"name":"motion"
|
||||
},
|
||||
"led":{
|
||||
"unit":"status",
|
||||
"name":"LED"
|
||||
},
|
||||
"scopetested":{
|
||||
"unit":"status",
|
||||
"name":"scope tested"
|
||||
},
|
||||
"sensingdistance":{
|
||||
"unit":"string",
|
||||
"name":"sensing distance"
|
||||
},
|
||||
"lightlevel":{
|
||||
"unit":"string",
|
||||
"name":"light level"
|
||||
},
|
||||
"batt":{
|
||||
"unit":"%",
|
||||
"name":"battery"
|
||||
}
|
||||
}
|
||||
})"""";*/
|
||||
37
lib/decoder/src/devices/SBMT_json.h
Normal file
37
lib/decoder/src/devices/SBMT_json.h
Normal file
@@ -0,0 +1,37 @@
|
||||
#include "common_props.h"
|
||||
|
||||
const char* _SBMT_json = "{\"brand\":\"SwitchBot\",\"model\":\"Meter (Plus)\",\"model_id\":\"THX1/W230150X\",\"tag\":\"0102\",\"condition\":[\"servicedata\",\"=\",12,\"index\",0,\"54\",\"|\",\"servicedata\",\"=\",12,\"index\",0,\"69\",\"&\",[\"uuid\",\"index\",0,\"0d00\",\"|\",\"uuid\",\"index\",0,\"fd3d\"]],\"properties\":{\".cal\":{\"decoder\":[\"value_from_hex_data\",\"servicedata\",7,1,false,false],\"post_proc\":[\"/\",10]},\"tempc\":{\"condition\":[\"servicedata\",8,\"bit\",3,0],\"decoder\":[\"value_from_hex_data\",\"servicedata\",8,2,true,false],\"post_proc\":[\"+\",\".cal\",\"*\",-1]},\"_tempc\":{\"condition\":[\"servicedata\",8,\"bit\",3,1],\"decoder\":[\"value_from_hex_data\",\"servicedata\",8,2,true,false],\"post_proc\":[\"+\",\".cal\",\"-\",128]},\"hum\":{\"decoder\":[\"value_from_hex_data\",\"servicedata\",10,2,false,false],\"post_proc\":[\"&\",127]},\"batt\":{\"decoder\":[\"value_from_hex_data\",\"servicedata\",4,2,false,false],\"post_proc\":[\"&\",127]}}}";
|
||||
/*R""""(
|
||||
{
|
||||
"brand":"SwitchBot",
|
||||
"model":"Meter (Plus)",
|
||||
"model_id":"THX1/W230150X",
|
||||
"tag":"0102",
|
||||
"condition":["servicedata", "=", 12, "index", 0, "54", "|", "servicedata", "=", 12, "index", 0, "69", "&", ["uuid", "index", 0, "0d00", "|", "uuid", "index", 0, "fd3d"]],
|
||||
"properties":{
|
||||
".cal":{
|
||||
"decoder":["value_from_hex_data", "servicedata", 7, 1, false, false],
|
||||
"post_proc":["/", 10]
|
||||
},
|
||||
"tempc":{
|
||||
"condition":["servicedata", 8, "bit", 3, 0],
|
||||
"decoder":["value_from_hex_data", "servicedata", 8, 2, true, false],
|
||||
"post_proc":["+", ".cal", "*", -1]
|
||||
},
|
||||
"_tempc":{
|
||||
"condition":["servicedata", 8, "bit", 3, 1],
|
||||
"decoder":["value_from_hex_data", "servicedata", 8, 2, true, false],
|
||||
"post_proc":["+", ".cal", "-", 128]
|
||||
},
|
||||
"hum":{
|
||||
"decoder":["value_from_hex_data", "servicedata", 10, 2, false, false],
|
||||
"post_proc":["&", 127]
|
||||
},
|
||||
"batt":{
|
||||
"decoder":["value_from_hex_data", "servicedata", 4, 2, false, false],
|
||||
"post_proc":["&", 127]
|
||||
}
|
||||
}
|
||||
})"""";*/
|
||||
|
||||
const char* _SBMT_json_props = _common_BTH_props;
|
||||
40
lib/decoder/src/devices/SBOT_json.h
Normal file
40
lib/decoder/src/devices/SBOT_json.h
Normal file
@@ -0,0 +1,40 @@
|
||||
#include "common_props.h"
|
||||
|
||||
const char* _SBOT_json = "{\"brand\":\"SwitchBot\",\"model\":\"Outdoor Meter\",\"model_id\":\"W340001X\",\"tag\":\"0102\",\"condition\":[\"servicedata\",\"=\",6,\"index\",0,\"77\",\"&\",\"uuid\",\"index\",0,\"fd3d\",\"&\",\"manufacturerdata\",\"=\",28],\"properties\":{\".cal\":{\"decoder\":[\"value_from_hex_data\",\"manufacturerdata\",21,1,false,false],\"post_proc\":[\"/\",10]},\"tempc\":{\"condition\":[\"manufacturerdata\",22,\"bit\",3,0],\"decoder\":[\"value_from_hex_data\",\"manufacturerdata\",22,2,true,false],\"post_proc\":[\"+\",\".cal\",\"*\",-1]},\"_tempc\":{\"condition\":[\"manufacturerdata\",22,\"bit\",3,1],\"decoder\":[\"value_from_hex_data\",\"manufacturerdata\",22,2,true,false],\"post_proc\":[\"+\",\".cal\",\"-\",128]},\"hum\":{\"decoder\":[\"value_from_hex_data\",\"manufacturerdata\",24,2,false,false],\"post_proc\":[\"&\",127]},\"batt\":{\"decoder\":[\"value_from_hex_data\",\"servicedata\",4,2,false,false],\"post_proc\":[\"&\",127]},\"mac\":{\"decoder\":[\"mac_from_hex_data\",\"manufacturerdata\",4]}}}";
|
||||
/*R""""(
|
||||
{
|
||||
"brand":"SwitchBot",
|
||||
"model":"Outdoor Meter",
|
||||
"model_id":"W340001X",
|
||||
"tag":"0102",
|
||||
"condition":["servicedata", "=", 6, "index", 0, "77", "&", "uuid", "index", 0, "fd3d", "&", "manufacturerdata", "=", 28],
|
||||
"properties":{
|
||||
".cal":{
|
||||
"decoder":["value_from_hex_data", "manufacturerdata", 21, 1, false, false],
|
||||
"post_proc":["/", 10]
|
||||
},
|
||||
"tempc":{
|
||||
"condition":["manufacturerdata", 22, "bit", 3, 0],
|
||||
"decoder":["value_from_hex_data", "manufacturerdata", 22, 2, true, false],
|
||||
"post_proc":["+", ".cal", "*", -1]
|
||||
},
|
||||
"_tempc":{
|
||||
"condition":["manufacturerdata", 22, "bit", 3, 1],
|
||||
"decoder":["value_from_hex_data", "manufacturerdata", 22, 2, true, false],
|
||||
"post_proc":["+", ".cal", "-", 128]
|
||||
},
|
||||
"hum":{
|
||||
"decoder":["value_from_hex_data", "manufacturerdata", 24, 2, false, false],
|
||||
"post_proc":["&", 127]
|
||||
},
|
||||
"batt":{
|
||||
"decoder":["value_from_hex_data", "servicedata", 4, 2, false, false],
|
||||
"post_proc":["&", 127]
|
||||
},
|
||||
"mac":{
|
||||
"decoder":["mac_from_hex_data", "manufacturerdata", 4]
|
||||
}
|
||||
}
|
||||
})"""";*/
|
||||
|
||||
const char* _SBOT_json_props = _common_BTHM_props;
|
||||
40
lib/decoder/src/devices/SBS1_json.h
Normal file
40
lib/decoder/src/devices/SBS1_json.h
Normal file
@@ -0,0 +1,40 @@
|
||||
const char* _SBS1_json = "{\"brand\":\"SwitchBot\",\"model\":\"Bot\",\"model_id\":\"X1\",\"tag\":\"0e02\",\"condition\":[\"uuid\",\"index\",0,\"0d00\",\"|\",\"uuid\",\"index\",0,\"fd3d\",\"&\",\"servicedata\",\"=\",6,\"index\",0,\"48\"],\"properties\":{\"mode\":{\"decoder\":[\"bit_static_value\",\"servicedata\",2,3,\"onestate\",\"on/off\"]},\"state\":{\"decoder\":[\"bit_static_value\",\"servicedata\",2,2,\"on\",\"off\"]},\"batt\":{\"decoder\":[\"value_from_hex_data\",\"servicedata\",4,2,false,false],\"post_proc\":[\"&\",127]}}}";
|
||||
/*R""""(
|
||||
{
|
||||
"brand":"SwitchBot",
|
||||
"model":"Bot",
|
||||
"model_id":"X1",
|
||||
"tag":"0e02",
|
||||
"condition":["uuid", "index", 0, "0d00", "|", "uuid", "index", 0, "fd3d", "&", "servicedata", "=", 6, "index", 0, "48"],
|
||||
"properties":{
|
||||
"mode":{
|
||||
"decoder":["bit_static_value", "servicedata", 2, 3, "onestate", "on/off"]
|
||||
},
|
||||
"state":{
|
||||
"decoder":["bit_static_value", "servicedata", 2, 2, "on", "off"]
|
||||
},
|
||||
"batt":{
|
||||
"decoder":["value_from_hex_data", "servicedata", 4, 2, false, false],
|
||||
"post_proc":["&", 127]
|
||||
}
|
||||
}
|
||||
})"""";*/
|
||||
|
||||
const char* _SBS1_json_props = "{\"properties\":{\"mode\":{\"unit\":\"string\",\"name\":\"mode\"},\"state\":{\"unit\":\"string\",\"name\":\"state\"},\"batt\":{\"unit\":\"%\",\"name\":\"battery\"}}}";
|
||||
/*R""""(
|
||||
{
|
||||
"properties":{
|
||||
"mode":{
|
||||
"unit":"string",
|
||||
"name":"mode"
|
||||
},
|
||||
"state":{
|
||||
"unit":"string",
|
||||
"name":"state"
|
||||
},
|
||||
"batt":{
|
||||
"unit":"%",
|
||||
"name":"battery"
|
||||
}
|
||||
}
|
||||
})"""";*/
|
||||
43
lib/decoder/src/devices/SCD4X_json.h
Normal file
43
lib/decoder/src/devices/SCD4X_json.h
Normal file
@@ -0,0 +1,43 @@
|
||||
const char* _SCD4X_json = "{\"brand\":\"Sensirion\",\"model\":\"MyCO₂/CO₂ Gadget\",\"model_id\":\"SCD4X\",\"tag\":\"0f\",\"condition\":[\"manufacturerdata\",\">=\",24,\"index\",0,\"d5060008\",\"|\",\"manufacturerdata\",\">=\",24,\"index\",0,\"d506000a\"],\"properties\":{\"tempc\":{\"decoder\":[\"value_from_hex_data\",\"manufacturerdata\",12,4,true,true],\"post_proc\":[\"*\",175,\"/\",65535,\"-\",45]},\"hum\":{\"decoder\":[\"value_from_hex_data\",\"manufacturerdata\",16,4,true,false],\"post_proc\":[\"*\",100,\"/\",65535]},\"co2\":{\"decoder\":[\"value_from_hex_data\",\"manufacturerdata\",20,4,true,false]}}}";
|
||||
|
||||
/* R""""(
|
||||
{
|
||||
"brand":"Sensirion",
|
||||
"model":"MyCO₂/CO₂ Gadget",
|
||||
"model_id":"SCD4X",
|
||||
"tag":"0f",
|
||||
"condition":["manufacturerdata", ">=", 24, "index", 0, "d5060008", "|", "manufacturerdata", ">=", 24, "index", 0, "d506000a"],
|
||||
"properties":{
|
||||
"tempc":{
|
||||
"decoder":["value_from_hex_data", "manufacturerdata", 12, 4, true, true],
|
||||
"post_proc":["*", 175, "/", 65535, "-", 45]
|
||||
},
|
||||
"hum":{
|
||||
"decoder":["value_from_hex_data", "manufacturerdata", 16, 4, true, false],
|
||||
"post_proc":["*", 100, "/", 65535]
|
||||
},
|
||||
"co2":{
|
||||
"decoder":["value_from_hex_data", "manufacturerdata", 20, 4, true, false]
|
||||
}
|
||||
}
|
||||
})"""";*/
|
||||
|
||||
const char* _SCD4X_json_props = "{\"properties\":{\"tempc\":{\"unit\":\"°C\",\"name\":\"temperature\"},\"hum\":{\"unit\":\"%\",\"name\":\"humidity\"},\"co2\":{\"unit\":\"ppm\",\"name\":\"carbon dioxide\"}}}";
|
||||
|
||||
/* R""""(
|
||||
{
|
||||
"properties":{
|
||||
"tempc":{
|
||||
"unit":"°C",
|
||||
"name":"temperature"
|
||||
},
|
||||
"hum":{
|
||||
"unit":"%",
|
||||
"name":"humidity"
|
||||
},
|
||||
"co2":{
|
||||
"unit":"ppm",
|
||||
"name":"carbon dioxide"
|
||||
}
|
||||
}
|
||||
})"""";*/
|
||||
24
lib/decoder/src/devices/SHT4X_json.h
Normal file
24
lib/decoder/src/devices/SHT4X_json.h
Normal file
@@ -0,0 +1,24 @@
|
||||
#include "common_props.h"
|
||||
|
||||
const char* _SHT4X_json = "{\"brand\":\"Sensirion\",\"model\":\"TH Sensor\",\"model_id\":\"SHT4X\",\"tag\":\"01\",\"condition\":[\"manufacturerdata\",\">=\",20,\"index\",0,\"d5060006\"],\"properties\":{\"tempc\":{\"decoder\":[\"value_from_hex_data\",\"manufacturerdata\",12,4,true,true],\"post_proc\":[\"*\",175,\"/\",65535,\"-\",45]},\"hum\":{\"decoder\":[\"value_from_hex_data\",\"manufacturerdata\",16,4,true,false],\"post_proc\":[\"*\",125,\"/\",65535,\"-\",6]}}}";
|
||||
|
||||
/* R""""(
|
||||
{
|
||||
"brand":"Sensirion",
|
||||
"model":"TH Sensor",
|
||||
"model_id":"SHT4X",
|
||||
"tag":"01",
|
||||
"condition":["manufacturerdata", ">=", 20, "index", 0, "d5060006"],
|
||||
"properties":{
|
||||
"tempc":{
|
||||
"decoder":["value_from_hex_data", "manufacturerdata", 12, 4, true, true],
|
||||
"post_proc":["*", 175, "/", 65535, "-", 45]
|
||||
},
|
||||
"hum":{
|
||||
"decoder":["value_from_hex_data", "manufacturerdata", 16, 4, true, false],
|
||||
"post_proc":["*", 125, "/", 65535, "-", 6]
|
||||
}
|
||||
}
|
||||
})"""";*/
|
||||
|
||||
const char* _SHT4X_json_props = _common_TH_props;
|
||||
25
lib/decoder/src/devices/ServiceData_json.h
Normal file
25
lib/decoder/src/devices/ServiceData_json.h
Normal file
@@ -0,0 +1,25 @@
|
||||
const char* _ServiceData_json = "{\"brand\":\"GENERIC\",\"model\":\"Service data\",\"model_id\":\"ServiceData\",\"tag\":\"08\",\"condition\":[\"uuid\",\"index\",0,\"180f\"],\"properties\":{\"batt\":{\"decoder\":[\"value_from_hex_data\",\"servicedata\",0,2,false,false]}}}";
|
||||
/*R""""(
|
||||
{
|
||||
"brand":"GENERIC",
|
||||
"model":"Service data",
|
||||
"model_id":"ServiceData",
|
||||
"tag":"08",
|
||||
"condition":["uuid", "index", 0, "180f"],
|
||||
"properties":{
|
||||
"batt":{
|
||||
"decoder":["value_from_hex_data", "servicedata", 0, 2, false, false]
|
||||
}
|
||||
}
|
||||
})"""";*/
|
||||
|
||||
const char* _ServiceData_json_props = "{\"properties\":{\"batt\":{\"unit\":\"%\",\"name\":\"battery\"}}}";
|
||||
/*R""""(
|
||||
{
|
||||
"properties":{
|
||||
"batt":{
|
||||
"unit":"%",
|
||||
"name":"battery"
|
||||
}
|
||||
}
|
||||
})"""";*/
|
||||
26
lib/decoder/src/devices/Skale_json.h
Normal file
26
lib/decoder/src/devices/Skale_json.h
Normal file
@@ -0,0 +1,26 @@
|
||||
const char* _Skale_json = "{\"brand\":\"Atomax\",\"model\":\"Skale I/II\",\"model_id\":\"SKALE\",\"tag\":\"0501\",\"condition\":[\"manufacturerdata\",\"=\",12,\"index\",0,\"ef81\"],\"properties\":{\"weight\":{\"decoder\":[\"value_from_hex_data\",\"manufacturerdata\",4,4,true,true],\"post_proc\":[\"/\",10]}}}";
|
||||
/*R""""(
|
||||
{
|
||||
"brand":"Atomax",
|
||||
"model":"Skale I/II",
|
||||
"model_id":"SKALE",
|
||||
"tag":"0501",
|
||||
"condition":["manufacturerdata", "=", 12, "index", 0, "ef81"],
|
||||
"properties":{
|
||||
"weight":{
|
||||
"decoder":["value_from_hex_data", "manufacturerdata", 4, 4, true, true],
|
||||
"post_proc":["/", 10]
|
||||
}
|
||||
}
|
||||
})"""";*/
|
||||
|
||||
const char* _Skale_json_props = "{\"properties\":{\"weight\":{\"unit\":\"g\",\"name\":\"weight\"}}}";
|
||||
/*R""""(
|
||||
{
|
||||
"properties":{
|
||||
"weight":{
|
||||
"unit":"g",
|
||||
"name":"weight"
|
||||
}
|
||||
}
|
||||
})"""";*/
|
||||
54
lib/decoder/src/devices/SmartDry_json.h
Normal file
54
lib/decoder/src/devices/SmartDry_json.h
Normal file
@@ -0,0 +1,54 @@
|
||||
const char* _SmartDry_json = "{\"brand\":\"SmartDry\",\"model\":\"Laundry Sensor\",\"model_id\":\"SDLS\",\"tag\":\"ff01\",\"condition\":[\"manufacturerdata\",\"=\",28,\"index\",0,\"ae01\"],\"properties\":{\"tempc\":{\"decoder\":[\"value_from_hex_data\",\"manufacturerdata\",4,8,true,false,true]},\"hum\":{\"decoder\":[\"value_from_hex_data\",\"manufacturerdata\",12,8,true,false,true]},\"shake\":{\"decoder\":[\"value_from_hex_data\",\"manufacturerdata\",20,4,true,false]},\"volt\":{\"decoder\":[\"value_from_hex_data\",\"manufacturerdata\",24,2,false,false],\"post_proc\":[\"+\",\"2847\",\"/\",1000]},\"wake\":{\"decoder\":[\"bit_static_value\",\"manufacturerdata\",27,0,false,true]}}}";
|
||||
/* R""""(
|
||||
{
|
||||
"brand":"SmartDry",
|
||||
"model":"Laundry Sensor",
|
||||
"model_id":"SDLS",
|
||||
"tag":"ff01",
|
||||
"condition":["manufacturerdata", "=", 28, "index", 0, "ae01"],
|
||||
"properties":{
|
||||
"tempc":{
|
||||
"decoder":["value_from_hex_data", "manufacturerdata", 4, 8, true, false, true]
|
||||
},
|
||||
"hum":{
|
||||
"decoder":["value_from_hex_data", "manufacturerdata", 12, 8, true, false, true]
|
||||
},
|
||||
"shake":{
|
||||
"decoder":["value_from_hex_data", "manufacturerdata", 20, 4, true, false]
|
||||
},
|
||||
"volt":{
|
||||
"decoder":["value_from_hex_data", "manufacturerdata", 24, 2, false, false],
|
||||
"post_proc":["+", "2847", "/", 1000]
|
||||
},
|
||||
"wake":{
|
||||
"decoder":["bit_static_value", "manufacturerdata", 27, 0, false, true]
|
||||
}
|
||||
}
|
||||
})"""";*/
|
||||
|
||||
const char* _SmartDry_json_props = "{\"properties\":{\"tempc\":{\"unit\":\"°C\",\"name\":\"temperature\"},\"hum\":{\"unit\":\"%\",\"name\":\"humidity\"},\"shake\":{\"unit\":\"int\",\"name\":\"shake\"},\"volt\":{\"unit\":\"V\",\"name\":\"voltage\"},\"wake\":{\"unit\":\"status\",\"name\":\"wake\"}}}";
|
||||
/*R""""(
|
||||
{
|
||||
"properties":{
|
||||
"tempc":{
|
||||
"unit":"°C",
|
||||
"name":"temperature"
|
||||
},
|
||||
"hum":{
|
||||
"unit":"%",
|
||||
"name":"humidity"
|
||||
},
|
||||
"shake":{
|
||||
"unit":"int",
|
||||
"name":"shake"
|
||||
},
|
||||
"volt":{
|
||||
"unit":"V",
|
||||
"name":"voltage"
|
||||
},
|
||||
"wake":{
|
||||
"unit":"status",
|
||||
"name":"wake"
|
||||
}
|
||||
}
|
||||
})"""";*/
|
||||
29
lib/decoder/src/devices/T201_json.h
Normal file
29
lib/decoder/src/devices/T201_json.h
Normal file
@@ -0,0 +1,29 @@
|
||||
#include "common_props.h"
|
||||
|
||||
const char* _T201_json = "{\"brand\":\"Oria\",\"model\":\"TH Sensor\",\"model_id\":\"T201\",\"tag\":\"0103\",\"condition\":[\"name\",\"index\",0,\"T201\",\"&\",\"manufacturerdata\",\">=\",38],\"properties\":{\"tempc\":{\"decoder\":[\"value_from_hex_data\",\"manufacturerdata\",24,4,false,true],\"post_proc\":[\"/\",100]},\"hum\":{\"decoder\":[\"value_from_hex_data\",\"manufacturerdata\",28,4,false,false],\"post_proc\":[\"/\",100]},\"batt\":{\"decoder\":[\"value_from_hex_data\",\"manufacturerdata\",32,2,false,false]},\"mac\":{\"decoder\":[\"mac_from_hex_data\",\"manufacturerdata\",8]}}}";
|
||||
/*R""""(
|
||||
{
|
||||
"brand":"Oria",
|
||||
"model":"TH Sensor",
|
||||
"model_id":"T201",
|
||||
"tag":"0103",
|
||||
"condition":["name", "index", 0, "T201", "&", "manufacturerdata", ">=", 38],
|
||||
"properties":{
|
||||
"tempc":{
|
||||
"decoder":["value_from_hex_data", "manufacturerdata", 24, 4, false, true],
|
||||
"post_proc":["/", 100]
|
||||
},
|
||||
"hum":{
|
||||
"decoder":["value_from_hex_data", "manufacturerdata", 28, 4, false, false],
|
||||
"post_proc":["/", 100]
|
||||
},
|
||||
"batt":{
|
||||
"decoder":["value_from_hex_data", "manufacturerdata", 32, 2, false, false]
|
||||
},
|
||||
"mac":{
|
||||
"decoder":["mac_from_hex_data", "manufacturerdata", 8]
|
||||
}
|
||||
}
|
||||
})"""";*/
|
||||
|
||||
const char* _T201_json_props = _common_BTHM_props;
|
||||
29
lib/decoder/src/devices/T301_json.h
Normal file
29
lib/decoder/src/devices/T301_json.h
Normal file
@@ -0,0 +1,29 @@
|
||||
#include "common_props.h"
|
||||
|
||||
const char* _T301_json = "{\"brand\":\"Oria\",\"model\":\"TH Sensor\",\"model_id\":\"T301\",\"tag\":\"0103\",\"condition\":[\"name\",\"index\",0,\"T301\",\"&\",\"manufacturerdata\",\"=\",38],\"properties\":{\"tempc\":{\"decoder\":[\"value_from_hex_data\",\"manufacturerdata\",24,4,false,true],\"post_proc\":[\"/\",100]},\"hum\":{\"decoder\":[\"value_from_hex_data\",\"manufacturerdata\",28,4,false,false],\"post_proc\":[\"/\",100]},\"batt\":{\"decoder\":[\"value_from_hex_data\",\"manufacturerdata\",32,2,false,false]},\"mac\":{\"decoder\":[\"mac_from_hex_data\",\"manufacturerdata\",8]}}}";
|
||||
/*R""""(
|
||||
{
|
||||
"brand":"Oria",
|
||||
"model":"TH Sensor",
|
||||
"model_id":"T301",
|
||||
"tag":"0103",
|
||||
"condition":["name", "index", 0, "T301", "&", "manufacturerdata", "=", 38],
|
||||
"properties":{
|
||||
"tempc":{
|
||||
"decoder":["value_from_hex_data", "manufacturerdata", 24, 4, false, true],
|
||||
"post_proc":["/", 100]
|
||||
},
|
||||
"hum":{
|
||||
"decoder":["value_from_hex_data", "manufacturerdata", 28, 4, false, false],
|
||||
"post_proc":["/", 100]
|
||||
},
|
||||
"batt":{
|
||||
"decoder":["value_from_hex_data", "manufacturerdata", 32, 2, false, false]
|
||||
},
|
||||
"mac":{
|
||||
"decoder":["mac_from_hex_data", "manufacturerdata", 8]
|
||||
}
|
||||
}
|
||||
})"""";*/
|
||||
|
||||
const char* _T301_json_props = _common_BTHM_props;
|
||||
64
lib/decoder/src/devices/TPMS_json.h
Normal file
64
lib/decoder/src/devices/TPMS_json.h
Normal file
@@ -0,0 +1,64 @@
|
||||
const char* _TPMS_json = "{\"brand\":\"GENERIC\",\"model\":\"TPMS\",\"model_id\":\"TPMS\",\"tag\":\"0a01\",\"condition\":[\"manufacturerdata\",\"=\",36,\"index\",0,\"000\",\"&\",\"manufacturerdata\",\"mac@index\",4],\"conditionnomac\":[\"manufacturerdata\",\"=\",36,\"&\",\"name\",\"index\",0,\"TPMS\"],\"properties\":{\"count\":{\"decoder\":[\"value_from_hex_data\",\"manufacturerdata\",5,1,false],\"post_proc\":[\"+\",1]},\"pres\":{\"decoder\":[\"value_from_hex_data\",\"manufacturerdata\",16,8,true],\"post_proc\":[\"/\",100000]},\"tempc\":{\"decoder\":[\"value_from_hex_data\",\"manufacturerdata\",24,8,true],\"post_proc\":[\"/\",100]},\"batt\":{\"decoder\":[\"value_from_hex_data\",\"manufacturerdata\",32,2,true]},\"alarm\":{\"decoder\":[\"bit_static_value\",\"manufacturerdata\",35,0,false,true]},\"mac\":{\"decoder\":[\"mac_from_hex_data\",\"manufacturerdata\",4]}}}";
|
||||
/*R""""(
|
||||
{
|
||||
"brand":"GENERIC",
|
||||
"model":"TPMS",
|
||||
"model_id":"TPMS",
|
||||
"tag":"0a01",
|
||||
"condition":["manufacturerdata", "=", 36, "index", 0, "000", "&", "manufacturerdata", "mac@index", 4],
|
||||
"conditionnomac":["manufacturerdata", "=", 36, "&", "name", "index", 0, "TPMS"],
|
||||
"properties":{
|
||||
"count":{
|
||||
"decoder":["value_from_hex_data", "manufacturerdata", 5, 1, false],
|
||||
"post_proc":["+", 1]
|
||||
},
|
||||
"pres":{
|
||||
"decoder":["value_from_hex_data", "manufacturerdata", 16, 8, true],
|
||||
"post_proc":["/", 100000]
|
||||
},
|
||||
"tempc":{
|
||||
"decoder":["value_from_hex_data", "manufacturerdata", 24, 8, true],
|
||||
"post_proc":["/", 100]
|
||||
},
|
||||
"batt":{
|
||||
"decoder":["value_from_hex_data", "manufacturerdata", 32, 2, true]
|
||||
},
|
||||
"alarm":{
|
||||
"decoder":["bit_static_value", "manufacturerdata", 35, 0, false, true]
|
||||
},
|
||||
"mac":{
|
||||
"decoder":["mac_from_hex_data", "manufacturerdata", 4]
|
||||
}
|
||||
}
|
||||
})"""";*/
|
||||
|
||||
const char* _TPMS_json_props = "{\"properties\":{\"batt\":{\"unit\":\"%\",\"name\":\"battery\"},\"tempc\":{\"unit\":\"°C\",\"name\":\"temperature\"},\"pres\":{\"unit\":\"bar\",\"name\":\"pressure\"},\"count\":{\"unit\":\"int\",\"name\":\"count\"},\"alarm\":{\"unit\":\"status\",\"name\":\"alarm\"},\"mac\":{\"unit\":\"string\",\"name\":\"MAC address\"}}}";
|
||||
/*R""""(
|
||||
{
|
||||
"properties":{
|
||||
"batt":{
|
||||
"unit":"%",
|
||||
"name":"battery"
|
||||
},
|
||||
"tempc":{
|
||||
"unit":"°C",
|
||||
"name":"temperature"
|
||||
},
|
||||
"pres":{
|
||||
"unit":"bar",
|
||||
"name":"pressure"
|
||||
},
|
||||
"count":{
|
||||
"unit":"int",
|
||||
"name":"count"
|
||||
},
|
||||
"alarm":{
|
||||
"unit":"status",
|
||||
"name":"alarm"
|
||||
},
|
||||
"mac":{
|
||||
"unit":"string",
|
||||
"name":"MAC address"
|
||||
}
|
||||
}
|
||||
})"""";*/
|
||||
22
lib/decoder/src/devices/TPTH_json.h
Normal file
22
lib/decoder/src/devices/TPTH_json.h
Normal file
@@ -0,0 +1,22 @@
|
||||
#include "common_props.h"
|
||||
|
||||
const char* _TPTH_json = "{\"brand\":\"ThermoPro\",\"model\":\"TH Sensor\",\"model_id\":\"TP35X/393\",\"tag\":\"0103\",\"condition\":[\"name\",\"index\",0,\"TP357\",\"|\",\"name\",\"index\",0,\"TP358\",\"|\",\"name\",\"index\",0,\"TP359\",\"|\",\"name\",\"index\",0,\"TP393\",\"&\",\"manufacturerdata\",\">=\",12,\"index\",0,\"c2\"],\"properties\":{\"tempc\":{\"decoder\":[\"value_from_hex_data\",\"manufacturerdata\",2,4,true,true],\"post_proc\":[\"/\",10]},\"hum\":{\"decoder\":[\"value_from_hex_data\",\"manufacturerdata\",6,2,false,false]}}}";
|
||||
/*R""""(
|
||||
{
|
||||
"brand":"ThermoPro",
|
||||
"model":"TH Sensor",
|
||||
"model_id":"TP35X/393",
|
||||
"tag":"0103",
|
||||
"condition":["name", "index", 0, "TP357", "|", "name", "index", 0, "TP358", "|", "name", "index", 0, "TP359", "|", "name", "index", 0, "TP393", "&", "manufacturerdata", ">=", 12, "index", 0, "c2"],
|
||||
"properties":{
|
||||
"tempc":{
|
||||
"decoder":["value_from_hex_data", "manufacturerdata", 2, 4, true, true],
|
||||
"post_proc":["/", 10]
|
||||
},
|
||||
"hum":{
|
||||
"decoder":["value_from_hex_data", "manufacturerdata", 6, 2, false, false]
|
||||
}
|
||||
}
|
||||
})"""";*/
|
||||
|
||||
const char* _TPTH_json_props = _common_TH_props;
|
||||
94
lib/decoder/src/devices/ThermoBeacon_json.h
Normal file
94
lib/decoder/src/devices/ThermoBeacon_json.h
Normal file
@@ -0,0 +1,94 @@
|
||||
const char* _ThermoBeacon_json = "{\"brand\":\"GENERIC\",\"model\":\"ThermoBeacon\",\"model_id\":\"WS02/WS08\",\"tag\":\"0101\",\"condition\":[\"manufacturerdata\",\"index\",0,\"1000\",\"|\",\"manufacturerdata\",\"index\",0,\"1100\",\"|\",\"manufacturerdata\",\"index\",0,\"1500\",\"|\",\"manufacturerdata\",\"index\",0,\"1800\",\"|\",\"manufacturerdata\",\"index\",0,\"1b00\",\"&\",\"manufacturerdata\",\">=\",40],\"properties\":{\"tempc\":{\"condition\":[\"manufacturerdata\",\"=\",40],\"decoder\":[\"value_from_hex_data\",\"manufacturerdata\",24,4,true],\"post_proc\":[\"/\",16]},\"hum\":{\"condition\":[\"manufacturerdata\",\"=\",40],\"decoder\":[\"value_from_hex_data\",\"manufacturerdata\",28,4,true],\"post_proc\":[\"/\",16]},\"volt\":{\"condition\":[\"manufacturerdata\",\"=\",40],\"decoder\":[\"value_from_hex_data\",\"manufacturerdata\",20,4,true],\"post_proc\":[\"/\",1000]},\"time\":{\"condition\":[\"manufacturerdata\",\"=\",40],\"decoder\":[\"value_from_hex_data\",\"manufacturerdata\",32,8,true,false]},\"tempc_max\":{\"condition\":[\"manufacturerdata\",\"=\",44],\"decoder\":[\"value_from_hex_data\",\"manufacturerdata\",20,4,true],\"post_proc\":[\"/\",16]},\"time_max\":{\"condition\":[\"manufacturerdata\",\"=\",44],\"decoder\":[\"value_from_hex_data\",\"manufacturerdata\",24,8,true,false]},\"tempc_min\":{\"condition\":[\"manufacturerdata\",\"=\",44],\"decoder\":[\"value_from_hex_data\",\"manufacturerdata\",32,4,true],\"post_proc\":[\"/\",16]},\"time_min\":{\"condition\":[\"manufacturerdata\",\"=\",44],\"decoder\":[\"value_from_hex_data\",\"manufacturerdata\",36,8,true,false]},\"mac\":{\"decoder\":[\"revmac_from_hex_data\",\"manufacturerdata\",8]}}}";
|
||||
/*R""""(
|
||||
{
|
||||
"brand":"GENERIC",
|
||||
"model":"ThermoBeacon",
|
||||
"model_id":"WS02/WS08",
|
||||
"tag":"0101",
|
||||
"condition":["manufacturerdata", "index", 0, "1000", "|", "manufacturerdata", "index", 0, "1100", "|", "manufacturerdata", "index", 0, "1500", "|", "manufacturerdata", "index", 0, "1800", "|", "manufacturerdata", "index", 0, "1b00", "&", "manufacturerdata", ">=", 40],
|
||||
"properties":{
|
||||
"tempc":{
|
||||
"condition":["manufacturerdata", "=", 40],
|
||||
"decoder":["value_from_hex_data", "manufacturerdata", 24, 4, true],
|
||||
"post_proc":["/", 16]
|
||||
},
|
||||
"hum":{
|
||||
"condition":["manufacturerdata", "=", 40],
|
||||
"decoder":["value_from_hex_data", "manufacturerdata", 28, 4, true],
|
||||
"post_proc":["/", 16]
|
||||
},
|
||||
"volt":{
|
||||
"condition":["manufacturerdata", "=", 40],
|
||||
"decoder":["value_from_hex_data", "manufacturerdata", 20, 4, true],
|
||||
"post_proc":["/", 1000]
|
||||
},
|
||||
"time":{
|
||||
"condition":["manufacturerdata", "=", 40],
|
||||
"decoder":["value_from_hex_data", "manufacturerdata", 32, 8, true, false]
|
||||
},
|
||||
"tempc_max":{
|
||||
"condition":["manufacturerdata", "=", 44],
|
||||
"decoder":["value_from_hex_data", "manufacturerdata", 20, 4, true],
|
||||
"post_proc":["/", 16]
|
||||
},
|
||||
"time_max":{
|
||||
"condition":["manufacturerdata", "=", 44],
|
||||
"decoder":["value_from_hex_data", "manufacturerdata", 24, 8, true, false]
|
||||
},
|
||||
"tempc_min":{
|
||||
"condition":["manufacturerdata", "=", 44],
|
||||
"decoder":["value_from_hex_data", "manufacturerdata", 32, 4, true],
|
||||
"post_proc":["/", 16]
|
||||
},
|
||||
"time_min":{
|
||||
"condition":["manufacturerdata", "=", 44],
|
||||
"decoder":["value_from_hex_data", "manufacturerdata", 36, 8, true, false]
|
||||
},
|
||||
"mac":{
|
||||
"decoder":["revmac_from_hex_data", "manufacturerdata", 8]
|
||||
}
|
||||
}
|
||||
})"""";*/
|
||||
|
||||
const char* _ThermoBeacon_json_props = "{\"properties\":{\"volt\":{\"unit\":\"V\",\"name\":\"voltage\"},\"tempc\":{\"unit\":\"°C\",\"name\":\"temperature\"},\"hum\":{\"unit\":\"%\",\"name\":\"humidity\"},\"time\":{\"unit\":\"int\",\"name\":\"timestamp\"},\"tempc_max\":{\"unit\":\"°C\",\"name\":\"maximum temperature\"},\"time_max\":{\"unit\":\"int\",\"name\":\"maximum temperature timestamp\"},\"tempc_min\":{\"unit\":\"°C\",\"name\":\"minimum temperature\"},\"time_min\":{\"unit\":\"int\",\"name\":\"minimum temperature timestamp\"},\"mac\":{\"unit\":\"string\",\"name\":\"MAC address\"}}}";
|
||||
/*R""""(
|
||||
{
|
||||
"properties":{
|
||||
"volt":{
|
||||
"unit":"V",
|
||||
"name":"voltage"
|
||||
},
|
||||
"tempc":{
|
||||
"unit":"°C",
|
||||
"name":"temperature"
|
||||
},
|
||||
"hum":{
|
||||
"unit":"%",
|
||||
"name":"humidity"
|
||||
},
|
||||
"time":{
|
||||
"unit":"int",
|
||||
"name":"timestamp"
|
||||
},
|
||||
"tempc_max":{
|
||||
"unit":"°C",
|
||||
"name":"maximum temperature"
|
||||
},
|
||||
"time_max":{
|
||||
"unit":"int",
|
||||
"name":"maximum temperature timestamp"
|
||||
},
|
||||
"tempc_min":{
|
||||
"unit":"°C",
|
||||
"name":"minimum temperature"
|
||||
},
|
||||
"time_min":{
|
||||
"unit":"int",
|
||||
"name":"minimum temperature timestamp"
|
||||
},
|
||||
"mac":{
|
||||
"unit":"string",
|
||||
"name":"MAC address"
|
||||
}
|
||||
}
|
||||
})"""";*/
|
||||
40
lib/decoder/src/devices/XMTZC04HMKG_json.h
Normal file
40
lib/decoder/src/devices/XMTZC04HMKG_json.h
Normal file
@@ -0,0 +1,40 @@
|
||||
const char* _XMTZC04HMKG_json = "{\"brand\":\"Xiaomi\",\"model\":\"Mi Smart Scale\",\"model_id\":\"XMTZC01HM/XMTZC04HM\",\"tag\":\"05\",\"condition\":[\"servicedata\",\"index\",0,\"22\",\"|\",\"servicedata\",\"index\",0,\"a2\",\"|\",\"servicedata\",\"index\",0,\"62\",\"|\",\"servicedata\",\"index\",0,\"e2\",\"&\",\"servicedata\",\"=\",20,\"&\",\"uuid\",\"contain\",\"181d\"],\"properties\":{\"weighing_mode\":{\"decoder\":[\"bit_static_value\",\"servicedata\",0,2,\"person\",\"object\"]},\"unit\":{\"decoder\":[\"static_value\",\"kg\"]},\"weight\":{\"decoder\":[\"value_from_hex_data\",\"servicedata\",2,4,true,false],\"post_proc\":[\"/\",200]}}}";
|
||||
/*R""""(
|
||||
{
|
||||
"brand":"Xiaomi",
|
||||
"model":"Mi Smart Scale",
|
||||
"model_id":"XMTZC01HM/XMTZC04HM",
|
||||
"tag":"05",
|
||||
"condition":["servicedata", "index", 0, "22", "|", "servicedata", "index", 0, "a2", "|", "servicedata", "index", 0, "62", "|", "servicedata", "index", 0, "e2", "&", "servicedata", "=", 20, "&", "uuid", "contain", "181d"],
|
||||
"properties":{
|
||||
"weighing_mode":{
|
||||
"decoder":["bit_static_value", "servicedata", 0, 2, "person", "object"]
|
||||
},
|
||||
"unit":{
|
||||
"decoder":["static_value", "kg"]
|
||||
},
|
||||
"weight":{
|
||||
"decoder":["value_from_hex_data", "servicedata", 2, 4, true, false],
|
||||
"post_proc":["/", 200]
|
||||
}
|
||||
}
|
||||
})"""";*/
|
||||
|
||||
const char* _XMTZC04HMKG_json_props = "{\"properties\":{\"weighing_mode\":{\"unit\":\"string\",\"name\":\"weighing_mode\"},\"unit\":{\"unit\":\"string\",\"name\":\"unit\"},\"weight\":{\"unit\":\"kg\",\"name\":\"weight\"}}}";
|
||||
/*R""""(
|
||||
{
|
||||
"properties":{
|
||||
"weighing_mode":{
|
||||
"unit":"string",
|
||||
"name":"weighing_mode"
|
||||
},
|
||||
"unit":{
|
||||
"unit":"string",
|
||||
"name":"unit"
|
||||
},
|
||||
"weight":{
|
||||
"unit":"kg",
|
||||
"name":"weight"
|
||||
}
|
||||
}
|
||||
})"""";*/
|
||||
40
lib/decoder/src/devices/XMTZC04HMLB_json.h
Normal file
40
lib/decoder/src/devices/XMTZC04HMLB_json.h
Normal file
@@ -0,0 +1,40 @@
|
||||
const char* _XMTZC04HMLB_json = "{\"brand\":\"Xiaomi\",\"model\":\"Mi Smart Scale\",\"model_id\":\"XMTZC01HM/XMTZC04HM\",\"tag\":\"05\",\"condition\":[\"servicedata\",\"index\",0,\"23\",\"|\",\"servicedata\",\"index\",0,\"a3\",\"|\",\"servicedata\",\"index\",0,\"63\",\"|\",\"servicedata\",\"index\",0,\"e3\",\"&\",\"servicedata\",\"=\",20,\"&\",\"uuid\",\"contain\",\"181d\"],\"properties\":{\"weighing_mode\":{\"decoder\":[\"bit_static_value\",\"servicedata\",0,2,\"person\",\"object\"]},\"unit\":{\"decoder\":[\"static_value\",\"lb\"]},\"weight\":{\"decoder\":[\"value_from_hex_data\",\"servicedata\",2,4,true,false],\"post_proc\":[\"/\",100]}}}";
|
||||
/*R""""(
|
||||
{
|
||||
"brand":"Xiaomi",
|
||||
"model":"Mi Smart Scale",
|
||||
"model_id":"XMTZC01HM/XMTZC04HM",
|
||||
"tag":"05",
|
||||
"condition":["servicedata", "index", 0, "23", "|", "servicedata", "index", 0, "a3", "|", "servicedata", "index", 0, "63", "|", "servicedata", "index", 0, "e3", "&", "servicedata", "=", 20, "&", "uuid", "contain", "181d"],
|
||||
"properties":{
|
||||
"weighing_mode":{
|
||||
"decoder":["bit_static_value", "servicedata", 0, 2, "person", "object"]
|
||||
},
|
||||
"unit":{
|
||||
"decoder":["static_value", "lb"]
|
||||
},
|
||||
"weight":{
|
||||
"decoder":["value_from_hex_data", "servicedata", 2, 4, true, false],
|
||||
"post_proc":["/", 100]
|
||||
}
|
||||
}
|
||||
})"""";*/
|
||||
|
||||
const char* _XMTZC04HMLB_json_props = "{\"properties\":{\"weighing_mode\":{\"unit\":\"string\",\"name\":\"weighing_mode\"},\"unit\":{\"unit\":\"string\",\"name\":\"unit\"},\"weight\":{\"unit\":\"lb\",\"name\":\"weight\"}}}";
|
||||
/*R""""(
|
||||
{
|
||||
"properties":{
|
||||
"weighing_mode":{
|
||||
"unit":"string",
|
||||
"name":"weighing_mode"
|
||||
},
|
||||
"unit":{
|
||||
"unit":"string",
|
||||
"name":"unit"
|
||||
},
|
||||
"weight":{
|
||||
"unit":"lb",
|
||||
"name":"weight"
|
||||
}
|
||||
}
|
||||
})"""";*/
|
||||
48
lib/decoder/src/devices/XMTZC05HMKG_json.h
Normal file
48
lib/decoder/src/devices/XMTZC05HMKG_json.h
Normal file
@@ -0,0 +1,48 @@
|
||||
const char* _XMTZC05HMKG_json = "{\"brand\":\"Xiaomi\",\"model\":\"Mi Body Composition Scale\",\"model_id\":\"XMTZC02HM/XMTZC05HM\",\"tag\":\"05\",\"condition\":[\"servicedata\",\"index\",1,\"22\",\"|\",\"servicedata\",\"index\",1,\"2a\",\"|\",\"servicedata\",\"index\",1,\"62\",\"|\",\"servicedata\",\"index\",1,\"6a\",\"&\",\"servicedata\",\"=\",26,\"&\",\"uuid\",\"contain\",\"181b\"],\"properties\":{\"weighing_mode\":{\"decoder\":[\"bit_static_value\",\"servicedata\",1,2,\"person\",\"object\"]},\"unit\":{\"decoder\":[\"static_value\",\"kg\"]},\"weight\":{\"decoder\":[\"value_from_hex_data\",\"servicedata\",22,4,true,false],\"post_proc\":[\"/\",200]},\"impedance\":{\"condition\":[\"servicedata\",3,\"6\"],\"decoder\":[\"value_from_hex_data\",\"servicedata\",18,4,true,false]}}}";
|
||||
/*R""""(
|
||||
{
|
||||
"brand":"Xiaomi",
|
||||
"model":"Mi Body Composition Scale",
|
||||
"model_id":"XMTZC02HM/XMTZC05HM",
|
||||
"tag":"05",
|
||||
"condition":["servicedata", "index", 1, "22", "|", "servicedata", "index", 1, "2a", "|", "servicedata", "index", 1, "62", "|", "servicedata", "index", 1, "6a", "&", "servicedata", "=", 26, "&", "uuid", "contain", "181b"],
|
||||
"properties":{
|
||||
"weighing_mode":{
|
||||
"decoder":["bit_static_value", "servicedata", 1, 2, "person", "object"]
|
||||
},
|
||||
"unit":{
|
||||
"decoder":["static_value", "kg"]
|
||||
},
|
||||
"weight":{
|
||||
"decoder":["value_from_hex_data", "servicedata", 22, 4, true, false],
|
||||
"post_proc":["/", 200]
|
||||
},
|
||||
"impedance":{
|
||||
"condition":["servicedata", 3, "6"],
|
||||
"decoder":["value_from_hex_data", "servicedata", 18, 4, true, false]
|
||||
}
|
||||
}
|
||||
})"""";*/
|
||||
|
||||
const char* _XMTZC05HMKG_json_props = "{\"properties\":{\"weighing_mode\":{\"unit\":\"string\",\"name\":\"weighing_mode\"},\"unit\":{\"unit\":\"string\",\"name\":\"unit\"},\"weight\":{\"unit\":\"kg\",\"name\":\"weight\"},\"impedance\":{\"unit\":\"Ω\",\"name\":\"impedance\"}}}";
|
||||
/*R""""(
|
||||
{
|
||||
"properties":{
|
||||
"weighing_mode":{
|
||||
"unit":"string",
|
||||
"name":"weighing_mode"
|
||||
},
|
||||
"unit":{
|
||||
"unit":"string",
|
||||
"name":"unit"
|
||||
},
|
||||
"weight":{
|
||||
"unit":"kg",
|
||||
"name":"weight"
|
||||
},
|
||||
"impedance":{
|
||||
"unit":"Ω",
|
||||
"name":"impedance"
|
||||
}
|
||||
}
|
||||
})"""";*/
|
||||
48
lib/decoder/src/devices/XMTZC05HMLB_json.h
Normal file
48
lib/decoder/src/devices/XMTZC05HMLB_json.h
Normal file
@@ -0,0 +1,48 @@
|
||||
const char* _XMTZC05HMLB_json = "{\"brand\":\"Xiaomi\",\"model\":\"Mi Body Composition Scale\",\"model_id\":\"XMTZC02HM/XMTZC05HM\",\"tag\":\"05\",\"condition\":[\"servicedata\",\"index\",1,\"32\",\"|\",\"servicedata\",\"index\",1,\"3a\",\"|\",\"servicedata\",\"index\",1,\"72\",\"|\",\"servicedata\",\"index\",1,\"7a\",\"&\",\"servicedata\",\"=\",26,\"&\",\"uuid\",\"contain\",\"181b\"],\"properties\":{\"weighing_mode\":{\"decoder\":[\"bit_static_value\",\"servicedata\",1,2,\"person\",\"object\"]},\"unit\":{\"decoder\":[\"static_value\",\"lb\"]},\"weight\":{\"decoder\":[\"value_from_hex_data\",\"servicedata\",22,4,true,false],\"post_proc\":[\"/\",100]},\"impedance\":{\"condition\":[\"servicedata\",3,\"6\"],\"decoder\":[\"value_from_hex_data\",\"servicedata\",18,4,true,false]}}}";
|
||||
/*R""""(
|
||||
{
|
||||
"brand":"Xiaomi",
|
||||
"model":"Mi Body Composition Scale",
|
||||
"model_id":"XMTZC02HM/XMTZC05HM",
|
||||
"tag":"05",
|
||||
"condition":["servicedata", "index", 1, "32", "|", "servicedata", "index", 1, "3a", "|", "servicedata", "index", 1, "72", "|", "servicedata", "index", 1, "7a", "&", "servicedata", "=", 26, "&", "uuid", "contain", "181b"],
|
||||
"properties":{
|
||||
"weighing_mode":{
|
||||
"decoder":["bit_static_value", "servicedata", 1, 2, "person", "object"]
|
||||
},
|
||||
"unit":{
|
||||
"decoder":["static_value", "lb"]
|
||||
},
|
||||
"weight":{
|
||||
"decoder":["value_from_hex_data", "servicedata", 22, 4, true, false],
|
||||
"post_proc":["/", 100]
|
||||
},
|
||||
"impedance":{
|
||||
"condition":["servicedata", 3, "6"],
|
||||
"decoder":["value_from_hex_data", "servicedata", 18, 4, true, false]
|
||||
}
|
||||
}
|
||||
})"""";*/
|
||||
|
||||
const char* _XMTZC05HMLB_json_props = "{\"properties\":{\"weighing_mode\":{\"unit\":\"string\",\"name\":\"weighing_mode\"},\"unit\":{\"unit\":\"string\",\"name\":\"unit\"},\"weight\":{\"unit\":\"lb\",\"name\":\"weight\"},\"impedance\":{\"unit\":\"Ω\",\"name\":\"impedance\"}}}";
|
||||
/*R""""(
|
||||
{
|
||||
"properties":{
|
||||
"weighing_mode":{
|
||||
"unit":"string",
|
||||
"name":"weighing_mode"
|
||||
},
|
||||
"unit":{
|
||||
"unit":"string",
|
||||
"name":"unit"
|
||||
},
|
||||
"weight":{
|
||||
"unit":"lb",
|
||||
"name":"weight"
|
||||
},
|
||||
"impedance":{
|
||||
"unit":"Ω",
|
||||
"name":"impedance"
|
||||
}
|
||||
}
|
||||
})"""";*/
|
||||
90
lib/decoder/src/devices/common_props.h
Normal file
90
lib/decoder/src/devices/common_props.h
Normal file
@@ -0,0 +1,90 @@
|
||||
#ifndef _DECODER_COMMON_PROPS
|
||||
#define _DECODER_COMMON_PROPS
|
||||
|
||||
const char* _common_TH_props = "{\"properties\":{\"tempc\":{\"unit\":\"°C\",\"name\":\"temperature\"},\"hum\":{\"unit\":\"%\",\"name\":\"humidity\"}}}";
|
||||
/*R""""(
|
||||
{
|
||||
"properties":{
|
||||
"tempc":{
|
||||
"unit":"°C",
|
||||
"name":"temperature"
|
||||
},
|
||||
"hum":{
|
||||
"unit":"%",
|
||||
"name":"humidity"
|
||||
}
|
||||
}
|
||||
})"""";*/
|
||||
|
||||
const char* _common_BTH_props = "{\"properties\":{\"tempc\":{\"unit\":\"°C\",\"name\":\"temperature\"},\"hum\":{\"unit\":\"%\",\"name\":\"humidity\"},\"batt\":{\"unit\":\"%\",\"name\":\"battery\"}}}";
|
||||
/*
|
||||
R""""(
|
||||
{
|
||||
"properties":{
|
||||
"tempc":{
|
||||
"unit":"°C",
|
||||
"name":"temperature"
|
||||
},
|
||||
"hum":{
|
||||
"unit":"%",
|
||||
"name":"humidity"
|
||||
},
|
||||
"batt":{
|
||||
"unit":"%",
|
||||
"name":"battery"
|
||||
}
|
||||
}
|
||||
})"""";*/
|
||||
|
||||
const char* _common_BTHM_props = "{\"properties\":{\"tempc\":{\"unit\":\"°C\",\"name\":\"temperature\"},\"hum\":{\"unit\":\"%\",\"name\":\"humidity\"},\"batt\":{\"unit\":\"%\",\"name\":\"battery\"},\"mac\":{\"unit\":\"string\",\"name\":\"MAC address\"}}}";
|
||||
/*
|
||||
R""""(
|
||||
{
|
||||
"properties":{
|
||||
"tempc":{
|
||||
"unit":"°C",
|
||||
"name":"temperature"
|
||||
},
|
||||
"hum":{
|
||||
"unit":"%",
|
||||
"name":"humidity"
|
||||
},
|
||||
"batt":{
|
||||
"unit":"%",
|
||||
"name":"battery"
|
||||
},
|
||||
"mac":{
|
||||
"unit":"string",
|
||||
"name":"MAC address"
|
||||
}
|
||||
}
|
||||
})"""";*/
|
||||
|
||||
const char* _common_BVTH_props = "{\"properties\":{\"tempc\":{\"unit\":\"°C\",\"name\":\"temperature\"},\"hum\":{\"unit\":\"%\",\"name\":\"humidity\"},\"batt\":{\"unit\":\"%\",\"name\":\"battery\"},\"volt\":{\"unit\":\"V\",\"name\":\"voltage\"},\"mac\":{\"unit\":\"string\",\"name\":\"MAC address\"}}}";
|
||||
/*R""""(
|
||||
{
|
||||
"properties":{
|
||||
"tempc":{
|
||||
"unit":"°C",
|
||||
"name":"temperature"
|
||||
},
|
||||
"hum":{
|
||||
"unit":"%",
|
||||
"name":"humidity"
|
||||
},
|
||||
"batt":{
|
||||
"unit":"%",
|
||||
"name":"battery"
|
||||
},
|
||||
"volt":{
|
||||
"unit":"V",
|
||||
"name":"voltage"
|
||||
},
|
||||
"mac":{
|
||||
"unit":"string",
|
||||
"name":"MAC address"
|
||||
}
|
||||
}
|
||||
})"""";*/
|
||||
|
||||
#endif
|
||||
64
lib/decoder/src/devices/iBeacon_json.h
Normal file
64
lib/decoder/src/devices/iBeacon_json.h
Normal file
@@ -0,0 +1,64 @@
|
||||
const char* _ibeacon_json = "{\"brand\":\"GENERIC\",\"model\":\"iBeacon\",\"model_id\":\"IBEACON\",\"tag\":\"06\",\"condition\":[\"manufacturerdata\",\"=\",50,\"index\",0,\"4c00\"],\"properties\":{\"mfid\":{\"decoder\":[\"string_from_hex_data\",\"manufacturerdata\",0,4]},\"uuid\":{\"decoder\":[\"string_from_hex_data\",\"manufacturerdata\",8,32]},\"major\":{\"decoder\":[\"value_from_hex_data\",\"manufacturerdata\",40,4,false]},\"minor\":{\"decoder\":[\"value_from_hex_data\",\"manufacturerdata\",44,4,false]},\"txpower\":{\"condition\":[\"manufacturerdata\",48,\"bit\",3,1],\"decoder\":[\"value_from_hex_data\",\"manufacturerdata\",48,2,false]},\"volt\":{\"condition\":[\"manufacturerdata\",48,\"bit\",3,0],\"decoder\":[\"value_from_hex_data\",\"manufacturerdata\",48,2,false],\"post_proc\":[\"/\",10]}}}";
|
||||
|
||||
/*R""""(
|
||||
{
|
||||
"brand":"GENERIC",
|
||||
"model":"iBeacon",
|
||||
"model_id":"IBEACON",
|
||||
"tag":"06",
|
||||
"condition":["manufacturerdata", "=", 50, "index", 0, "4c00"],
|
||||
"properties":{
|
||||
"mfid":{
|
||||
"decoder":["string_from_hex_data", "manufacturerdata", 0, 4]
|
||||
},
|
||||
"uuid":{
|
||||
"decoder":["string_from_hex_data", "manufacturerdata", 8, 32]
|
||||
},
|
||||
"major":{
|
||||
"decoder":["value_from_hex_data", "manufacturerdata", 40, 4, false]
|
||||
},
|
||||
"minor":{
|
||||
"decoder":["value_from_hex_data", "manufacturerdata", 44, 4, false]
|
||||
},
|
||||
"txpower":{
|
||||
"condition":["manufacturerdata", 48, "bit", 3, 1],
|
||||
"decoder":["value_from_hex_data","manufacturerdata", 48, 2, false]
|
||||
},
|
||||
"volt":{
|
||||
"condition":["manufacturerdata", 48, "bit", 3, 0],
|
||||
"decoder":["value_from_hex_data","manufacturerdata", 48, 2, false],
|
||||
"post_proc":["/", 10]
|
||||
}
|
||||
}
|
||||
})"""";*/
|
||||
|
||||
const char* _ibeacon_json_props = "{\"properties\":{\"mfid\":{\"unit\":\"hex\",\"name\":\"manufacturer id\"},\"uuid\":{\"unit\":\"hex\",\"name\":\"service uuid\"},\"major\":{\"unit\":\"hex\",\"name\":\"major value\"},\"minor\":{\"unit\":\"hex\",\"name\":\"minor value\"},\"txpower\":{\"unit\":\"dBm\",\"name\":\"tx power @ 1 m\"},\"volt\":{\"unit\":\"V\",\"name\":\"voltage\"}}}";
|
||||
/*R""""(
|
||||
{
|
||||
"properties":{
|
||||
"mfid":{
|
||||
"unit":"hex",
|
||||
"name":"manufacturer id"
|
||||
},
|
||||
"uuid":{
|
||||
"unit":"hex",
|
||||
"name":"service uuid"
|
||||
},
|
||||
"major":{
|
||||
"unit":"hex",
|
||||
"name":"major value"
|
||||
},
|
||||
"minor":{
|
||||
"unit":"hex",
|
||||
"name":"minor value"
|
||||
},
|
||||
"txpower":{
|
||||
"unit":"dBm",
|
||||
"name":"tx power @ 1 m"
|
||||
},
|
||||
"volt":{
|
||||
"unit":"V",
|
||||
"name":"voltage"
|
||||
}
|
||||
}
|
||||
})"""";*/
|
||||
72
lib/decoder/src/devices/iNodeEM_json.h
Normal file
72
lib/decoder/src/devices/iNodeEM_json.h
Normal file
@@ -0,0 +1,72 @@
|
||||
const char* _iNodeEM_json = "{\"brand\":\"iNode\",\"model\":\"Energy Meter\",\"model_id\":\"INEM\",\"tag\":\"0c01\",\"condition\":[\"manufacturerdata\",\"index\",0,\"90\",\"|\",\"manufacturerdata\",\"index\",0,\"92\",\"|\",\"manufacturerdata\",\"index\",0,\"94\",\"|\",\"manufacturerdata\",\"index\",0,\"96\",\"&\",\"manufacturerdata\",\"=\",26,\"index\",2,\"82\"],\"properties\":{\".cal\":{\"decoder\":[\"value_from_hex_data\",\"manufacturerdata\",16,4,true,false],\"post_proc\":[\"&\",16383]},\"avg\":{\"decoder\":[\"value_from_hex_data\",\"manufacturerdata\",4,4,true,false],\"post_proc\":[\"*\",60,\"/\",\".cal\"]},\"avgu\":{\"decoder\":[\"bit_static_value\",\"manufacturerdata\",18,0,\"kW\",\"m³\"]},\"sum\":{\"decoder\":[\"value_from_hex_data\",\"manufacturerdata\",8,4,true,false],\"post_proc\":[\"/\",\".cal\"]},\"sumu\":{\"decoder\":[\"bit_static_value\",\"manufacturerdata\",18,0,\"kWh\",\"m³\"]},\"batt\":{\"decoder\":[\"value_from_hex_data\",\"manufacturerdata\",20,1,false,false],\"post_proc\":[\"-\",1,\"*\",10]},\"_batt\":{\"condition\":[\"manufacturerdata\",20,\"1\",\"|\",\"manufacturerdata\",20,\"c\",\"|\",\"manufacturerdata\",20,\"d\",\"|\",\"manufacturerdata\",20,\"e\",\"|\",\"manufacturerdata\",20,\"f\"],\"decoder\":[\"static_value\",\"100\"]},\"lowbatt\":{\"condition\":[\"manufacturerdata\",1,\"bit\",2,1],\"decoder\":[\"static_value\",true]}}}";
|
||||
/*R""""(
|
||||
{
|
||||
"brand":"iNode",
|
||||
"model":"Energy Meter",
|
||||
"model_id":"INEM",
|
||||
"tag":"0c01",
|
||||
"condition":["manufacturerdata", "index", 0, "90", "|", "manufacturerdata", "index", 0, "92", "|", "manufacturerdata", "index", 0, "94", "|", "manufacturerdata", "index", 0, "96", "&", "manufacturerdata", "=", 26, "index", 2, "82"],
|
||||
"properties":{
|
||||
".cal":{
|
||||
"decoder":["value_from_hex_data", "manufacturerdata", 16, 4, true, false],
|
||||
"post_proc":["&", 16383]
|
||||
},
|
||||
"avg":{
|
||||
"decoder":["value_from_hex_data", "manufacturerdata", 4, 4, true, false],
|
||||
"post_proc":[ "*", 60, "/", ".cal"]
|
||||
},
|
||||
"avgu":{
|
||||
"decoder":["bit_static_value", "manufacturerdata", 18, 0, "kW", "m³"]
|
||||
},
|
||||
"sum":{
|
||||
"decoder":["value_from_hex_data", "manufacturerdata", 8, 4, true, false],
|
||||
"post_proc":["/", ".cal"]
|
||||
},
|
||||
"sumu":{
|
||||
"decoder":["bit_static_value", "manufacturerdata", 18, 0, "kWh", "m³"]
|
||||
},
|
||||
"batt":{
|
||||
"decoder":["value_from_hex_data", "manufacturerdata", 20, 1, false, false],
|
||||
"post_proc":["-", 1, "*", 10]
|
||||
},
|
||||
"_batt":{
|
||||
"condition":["manufacturerdata", 20, "1", "|", "manufacturerdata", 20, "c", "|", "manufacturerdata", 20, "d", "|", "manufacturerdata", 20, "e", "|", "manufacturerdata", 20, "f"],
|
||||
"decoder":["static_value", "100"]
|
||||
},
|
||||
"lowbatt":{
|
||||
"condition":["manufacturerdata", 1, "bit", 2, 1],
|
||||
"decoder":["static_value", true]
|
||||
}
|
||||
}
|
||||
})"""";*/
|
||||
|
||||
const char* _iNodeEM_json_props = "{\"properties\":{\"avg\":{\"unit\":\"kW/m³\",\"name\":\"average\"},\"avgu\":{\"unit\":\"string\",\"name\":\"average unit\"},\"sum\":{\"unit\":\"kWh/m³\",\"name\":\"sum\"},\"sumu\":{\"unit\":\"string\",\"name\":\"sum unit\"},\"batt\":{\"unit\":\"%\",\"name\":\"battery\"},\"lowbatt\":{\"unit\":\"status\",\"name\":\"low battery\"}}}";
|
||||
/*R""""(
|
||||
{
|
||||
"properties":{
|
||||
"avg":{
|
||||
"unit":"kW/m³",
|
||||
"name":"average"
|
||||
},
|
||||
"avgu":{
|
||||
"unit":"string",
|
||||
"name":"average unit"
|
||||
},
|
||||
"sum":{
|
||||
"unit":"kWh/m³",
|
||||
"name":"sum"
|
||||
},
|
||||
"sumu":{
|
||||
"unit":"string",
|
||||
"name":"sum unit"
|
||||
},
|
||||
"batt":{
|
||||
"unit":"%",
|
||||
"name":"battery"
|
||||
},
|
||||
"lowbatt":{
|
||||
"unit":"status",
|
||||
"name":"low battery"
|
||||
}
|
||||
}
|
||||
})"""";*/
|
||||
85
lib/decoder/src/devices/tracker_json.h
Normal file
85
lib/decoder/src/devices/tracker_json.h
Normal file
@@ -0,0 +1,85 @@
|
||||
const char* _tracker_json_nut = "{\"brand\":\"nut\",\"model\":\"Smart Tracker\",\"model_id\":\"NUT\",\"tag\":\"100f\",\"condition\":[\"name\",\"index\",0,\"nut\",\"&\",\"manufacturerdata\",\"=\",8,\"&\",\"uuid\",\"index\",0,\"180a\"],\"properties\":{\"device\":{\"decoder\":[\"static_value\",\"nut Tracker\"]}}}";
|
||||
/*R""""(
|
||||
{
|
||||
"brand":"nut",
|
||||
"model":"Smart Tracker",
|
||||
"model_id":"NUT",
|
||||
"tag":"100f",
|
||||
"condition":["name", "index", 0, "nut", "&", "manufacturerdata", "=", 8, "&", "uuid", "index", 0, "180a"],
|
||||
"properties":{
|
||||
"device":{
|
||||
"decoder":["static_value", "nut Tracker"]
|
||||
}
|
||||
}
|
||||
})"""";*/
|
||||
|
||||
const char* _tracker_json_itag = "{\"brand\":\"iTAG\",\"model\":\"Smart Tracker\",\"model_id\":\"ITAG\",\"tag\":\"100f\",\"condition\":[\"name\",\"index\",0,\"iTAG\",\"&\",\"manufacturerdata\",\"=\",8],\"properties\":{\"device\":{\"decoder\":[\"static_value\",\"iTAG Tracker\"]}}}";
|
||||
/*R""""(
|
||||
{
|
||||
"brand":"iTAG",
|
||||
"model":"Smart Tracker",
|
||||
"model_id":"ITAG",
|
||||
"tag":"100f",
|
||||
"condition":["name", "index", 0, "iTAG", "&", "manufacturerdata", "=", 8],
|
||||
"properties":{
|
||||
"device":{
|
||||
"decoder":["static_value", "iTAG Tracker"]
|
||||
}
|
||||
}
|
||||
})"""";*/
|
||||
|
||||
const char* _tracker_json_tagit = "{\"brand\":\"Tag-It\",\"model\":\"Smart Tracker\",\"model_id\":\"TAGIT\",\"tag\":\"100f\",\"condition\":[\"name\",\"index\",0,\"Tag-It\",\"&\",\"manufacturerdata\",\"=\",26],\"properties\":{\"device\":{\"decoder\":[\"static_value\",\"Tag-It Tracker\"]}}}";
|
||||
/*R""""(
|
||||
{
|
||||
"brand":"Tag-It",
|
||||
"model":"Smart Tracker",
|
||||
"model_id":"TAGIT",
|
||||
"tag":"100f",
|
||||
"condition":["name", "index", 0, "Tag-It", "&", "manufacturerdata", "=", 26],
|
||||
"properties":{
|
||||
"device":{
|
||||
"decoder":["static_value", "Tag-It Tracker"]
|
||||
}
|
||||
}
|
||||
})"""";*/
|
||||
|
||||
const char* _tracker_json_tile = "{\"brand\":\"Tile\",\"model\":\"Smart Tracker\",\"model_id\":\"TILE\",\"tag\":\"100f\",\"condition\":[\"uuid\",\"index\",0,\"feed\",\"|\",\"uuid\",\"index\",0,\"feec\",\"|\",\"uuid\",\"index\",0,\"fd84\"],\"properties\":{\"device\":{\"decoder\":[\"static_value\",\"Tile Tracker\"]}}}";
|
||||
/*R""""(
|
||||
{
|
||||
"brand":"Tile",
|
||||
"model":"Smart Tracker",
|
||||
"model_id":"TILE",
|
||||
"tag":"100f",
|
||||
"condition":["uuid", "index", 0, "feed", "|", "uuid", "index", 0, "feec", "|", "uuid", "index", 0, "fd84"],
|
||||
"properties":{
|
||||
"device":{
|
||||
"decoder":["static_value", "Tile Tracker"]
|
||||
}
|
||||
}
|
||||
})"""";*/
|
||||
|
||||
const char* _tracker_json_tilename = "{\"brand\":\"Tile\",\"model\":\"Smart Tracker\",\"model_id\":\"TILE\",\"tag\":\"100f\",\"condition\":[\"name\",\"index\",0,\"Tile\"],\"properties\":{\"device\":{\"decoder\":[\"static_value\",\"Tile Tracker\"]}}}";
|
||||
/*R""""(
|
||||
{
|
||||
"brand":"Tile",
|
||||
"model":"Smart Tracker",
|
||||
"model_id":"TILE",
|
||||
"tag":"100f",
|
||||
"condition":["name", "index", 0, "Tile"],
|
||||
"properties":{
|
||||
"device":{
|
||||
"decoder":["static_value", "Tile Tracker"]
|
||||
}
|
||||
}
|
||||
})"""";*/
|
||||
|
||||
const char* _tracker_json_props = "{\"properties\":{\"device\":{\"unit\":\"string\",\"name\":\"tracker device\"}}}";
|
||||
/*R""""(
|
||||
{
|
||||
"properties":{
|
||||
"device":{
|
||||
"unit":"string",
|
||||
"name":"tracker device"
|
||||
}
|
||||
}
|
||||
})"""";*/
|
||||
@@ -2,6 +2,8 @@
|
||||
#include "classes/IoTItem.h"
|
||||
#include <Arduino.h>
|
||||
#include <NimBLEDevice.h>
|
||||
#define BLE_PART1
|
||||
#define BLE_PART2
|
||||
#include <decoder.h>
|
||||
#include <vector>
|
||||
|
||||
@@ -234,23 +236,25 @@ public:
|
||||
|
||||
if (decoder.decodeBLEJson(BLEdata))
|
||||
{
|
||||
String mac_address = BLEdata["MAC"].as<const char *>();
|
||||
String mac_address = BLEdata["mac"].as<const char *>();
|
||||
if (mac_address == "")
|
||||
{
|
||||
BLEdata["MAC"] = BLEdata["id"];
|
||||
BLEdata["mac"] = BLEdata["id"];
|
||||
mac_address = BLEdata["id"].as<const char *>();
|
||||
}
|
||||
mac_address.replace(":", "");
|
||||
|
||||
BLEdata.remove("manufacturerdata");
|
||||
BLEdata.remove("servicedata");
|
||||
BLEdata.remove("type");
|
||||
BLEdata.remove("cidc");
|
||||
BLEdata.remove("acts");
|
||||
BLEdata.remove("cont");
|
||||
BLEdata.remove("track");
|
||||
BLEdata.remove("id");
|
||||
|
||||
if (_debug < 2)
|
||||
{
|
||||
BLEdata.remove("manufacturerdata");
|
||||
BLEdata.remove("servicedata");
|
||||
BLEdata.remove("type");
|
||||
BLEdata.remove("cidc");
|
||||
BLEdata.remove("acts");
|
||||
BLEdata.remove("cont");
|
||||
BLEdata.remove("track");
|
||||
BLEdata.remove("id");
|
||||
}
|
||||
// дописываем время прихода пакета данных
|
||||
BLEdata["last"] = millis();
|
||||
if (_debug)
|
||||
@@ -261,13 +265,16 @@ public:
|
||||
// {
|
||||
// String val = BLEdata.as<String>();
|
||||
String output;
|
||||
BLEdata.remove("servicedatauuid");
|
||||
if (_debug < 2)
|
||||
{
|
||||
BLEdata.remove("servicedatauuid");
|
||||
}
|
||||
serializeJson(BLEdata, output);
|
||||
SerialPrint("i", F("BLE"), mac_address + " " + output);
|
||||
//}
|
||||
}
|
||||
|
||||
SerialPrint("i", F("BLE"), "found: " + String(BLEdata["MAC"].as<const char *>()));
|
||||
SerialPrint("i", F("BLE"), "found: " + String(BLEdata["mac"].as<const char *>()));
|
||||
}
|
||||
|
||||
// Перебираем все зарегистрированные сенсоры BleSens
|
||||
|
||||
@@ -39,9 +39,9 @@
|
||||
"authorGit": "https://github.com/avaksru, https://github.com/Mit4el",
|
||||
"specialThanks": "@Serghei63",
|
||||
"moduleName": "Ble",
|
||||
"moduleVersion": "3.0",
|
||||
"moduleVersion": "3.1",
|
||||
"usedRam": {
|
||||
"esp32_4mb": 1261449,
|
||||
"esp32_4mb": 314692,
|
||||
"esp8266_4mb": 0
|
||||
},
|
||||
"subTypes": [
|
||||
@@ -49,7 +49,7 @@
|
||||
"BleScan"
|
||||
],
|
||||
"title": "Сканер Bluetooth",
|
||||
"moduleDesc": "Позволяет получить данные с Bluetooth часов и термометров Mijia, Xiaomi, Cleargrass, ...",
|
||||
"moduleDesc": "Позволяет получить данные с Bluetooth часов и термометров и.т.д. Полный список (учитывать отстование нашей версии библиотеки) https://decoder.theengs.io/devices/devices.html Наш перечень в файле lib/decoder/devices.h Здесь полный перечень датчиков, для уменьшения размера модуля рекомендуется использовать модули Ble_part1 и Ble_part2",
|
||||
"propInfo": {
|
||||
"round": "Округление после запятой.",
|
||||
"orange": "количество минут после которого окрасить виджет в оранжевый цвет",
|
||||
@@ -65,28 +65,22 @@
|
||||
"defActive": false,
|
||||
"usedLibs": {
|
||||
"esp32_4mb": [
|
||||
"https://github.com/Mit4el/NimBLE-Arduino.git",
|
||||
"https://github.com/Mit4el/decoder.git"
|
||||
"https://github.com/Mit4el/NimBLE-Arduino.git"
|
||||
],
|
||||
"esp32_16mb": [
|
||||
"https://github.com/Mit4el/NimBLE-Arduino.git",
|
||||
"https://github.com/Mit4el/decoder.git"
|
||||
"https://github.com/Mit4el/NimBLE-Arduino.git"
|
||||
],
|
||||
"esp32_4mb3f": [
|
||||
"https://github.com/Mit4el/NimBLE-Arduino.git",
|
||||
"https://github.com/Mit4el/decoder.git"
|
||||
"https://github.com/Mit4el/NimBLE-Arduino.git"
|
||||
],
|
||||
"esp32cam_4mb": [
|
||||
"https://github.com/Mit4el/NimBLE-Arduino.git",
|
||||
"https://github.com/Mit4el/decoder.git"
|
||||
"https://github.com/Mit4el/NimBLE-Arduino.git"
|
||||
],
|
||||
"esp32s3_16mb": [
|
||||
"https://github.com/Mit4el/NimBLE-Arduino.git",
|
||||
"https://github.com/Mit4el/decoder.git"
|
||||
"https://github.com/Mit4el/NimBLE-Arduino.git"
|
||||
],
|
||||
"esp32c3m_4mb": [
|
||||
"https://github.com/Mit4el/NimBLE-Arduino.git",
|
||||
"https://github.com/Mit4el/decoder.git"
|
||||
"https://github.com/Mit4el/NimBLE-Arduino.git"
|
||||
]
|
||||
}
|
||||
}
|
||||
338
src/modules/sensors/Ble_part1/Ble_p1.cpp
Normal file
338
src/modules/sensors/Ble_part1/Ble_p1.cpp
Normal file
@@ -0,0 +1,338 @@
|
||||
#include "Global.h"
|
||||
#include "classes/IoTItem.h"
|
||||
#include <Arduino.h>
|
||||
#include <NimBLEDevice.h>
|
||||
#define BLE_PART1
|
||||
// #define BLE_PART2
|
||||
#include <decoder.h>
|
||||
#include <vector>
|
||||
|
||||
// Создаем переменную для хранения данных с датчиков bluetooth
|
||||
// StaticJsonDocument<JSON_BUFFER_SIZE * 4> BLEbuffer;
|
||||
// DynamicJsonDocument extBLEdata(JSON_BUFFER_SIZE * 4);
|
||||
// JsonObject extBLEdata = BLEbuffer.to<JsonObject>();
|
||||
class BleSens;
|
||||
std::vector<BleSens *> BleSensArray;
|
||||
|
||||
class BleSens : public IoTItem
|
||||
{
|
||||
private:
|
||||
// описание параметров передаваемых из настроек датчика из веба
|
||||
String _MAC;
|
||||
String _sensor;
|
||||
int timeRecv = 0;
|
||||
int _minutesPassed = 0;
|
||||
String json = "{}";
|
||||
int orange = 0;
|
||||
int red = 0;
|
||||
int offline = 0;
|
||||
int _int;
|
||||
bool dataFromNode = false;
|
||||
|
||||
public:
|
||||
String whoIAm(/*String &mac, String &sens*/)
|
||||
{
|
||||
// mac = _MAC;
|
||||
// sens = _sensor;
|
||||
return _MAC;
|
||||
}
|
||||
|
||||
void setBLEdata(JsonObject extBLEdata)
|
||||
{
|
||||
if (_sensor == "last")
|
||||
{
|
||||
timeRecv = extBLEdata[_sensor].as<int>();
|
||||
char *s;
|
||||
s = TimeToString(millis() / 1000 - timeRecv / 1000);
|
||||
value.isDecimal = 0;
|
||||
if (timeRecv > 0)
|
||||
{
|
||||
value.valS = s;
|
||||
dataFromNode = true;
|
||||
_minutesPassed = 0;
|
||||
setNewWidgetAttributes();
|
||||
}
|
||||
else
|
||||
{
|
||||
value.valS = "";
|
||||
}
|
||||
regEvent(value.valS, _id);
|
||||
}
|
||||
else
|
||||
{
|
||||
String valStr = extBLEdata[_sensor].as<String>();
|
||||
if (valStr != "null")
|
||||
{
|
||||
if (value.isDecimal == isDigitDotCommaStr(valStr))
|
||||
{
|
||||
value.isDecimal = 1;
|
||||
value.valD = valStr.toFloat();
|
||||
regEvent(value.valD, _id);
|
||||
dataFromNode = true;
|
||||
_minutesPassed = 0;
|
||||
setNewWidgetAttributes();
|
||||
}
|
||||
else
|
||||
{
|
||||
value.isDecimal = 0;
|
||||
value.valS = valStr;
|
||||
regEvent(value.valS, _id);
|
||||
dataFromNode = true;
|
||||
_minutesPassed = 0;
|
||||
setNewWidgetAttributes();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
char *TimeToString(unsigned long t)
|
||||
{
|
||||
static char str[12];
|
||||
long h = t / 3600;
|
||||
t = t % 3600;
|
||||
int m = t / 60;
|
||||
int s = t % 60;
|
||||
sprintf(str, "%02ld:%02d:%02d", h, m, s);
|
||||
return str;
|
||||
}
|
||||
|
||||
void doByInterval()
|
||||
{
|
||||
if (_sensor == "last")
|
||||
{
|
||||
char *s;
|
||||
s = TimeToString(millis() / 1000 - timeRecv / 1000);
|
||||
value.isDecimal = 0;
|
||||
if (timeRecv > 0)
|
||||
{
|
||||
value.valS = s;
|
||||
}
|
||||
else
|
||||
{
|
||||
value.valS = "";
|
||||
}
|
||||
regEvent(value.valS, _id);
|
||||
}
|
||||
_minutesPassed++;
|
||||
setNewWidgetAttributes();
|
||||
}
|
||||
void onMqttWsAppConnectEvent()
|
||||
{
|
||||
setNewWidgetAttributes();
|
||||
}
|
||||
void setNewWidgetAttributes()
|
||||
{
|
||||
|
||||
int minutes_ = _minutesPassed * _int / 60;
|
||||
jsonWriteStr(json, F("info"), prettyMinutsTimeout(minutes_));
|
||||
if (dataFromNode)
|
||||
{
|
||||
if (orange != 0 && red != 0 && offline != 0)
|
||||
{
|
||||
if (minutes_ < orange)
|
||||
{
|
||||
jsonWriteStr(json, F("color"), "");
|
||||
}
|
||||
if (minutes_ >= orange && minutes_ < red)
|
||||
{
|
||||
jsonWriteStr(json, F("color"), F("orange")); // сделаем виджет оранжевым
|
||||
}
|
||||
if (minutes_ >= red && minutes_ < offline)
|
||||
{
|
||||
jsonWriteStr(json, F("color"), F("red")); // сделаем виджет красным
|
||||
}
|
||||
if (minutes_ >= offline)
|
||||
{
|
||||
jsonWriteStr(json, F("info"), F("offline"));
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
jsonWriteStr(json, F("info"), F("awaiting"));
|
||||
}
|
||||
sendSubWidgetsValues(_id, json);
|
||||
}
|
||||
|
||||
BleSens(String parameters) : IoTItem(parameters)
|
||||
{
|
||||
_MAC = jsonReadStr(parameters, "MAC");
|
||||
_sensor = jsonReadStr(parameters, "sensor");
|
||||
jsonRead(parameters, F("orange"), orange);
|
||||
jsonRead(parameters, F("red"), red);
|
||||
jsonRead(parameters, F("offline"), offline);
|
||||
jsonRead(parameters, F("int"), _int);
|
||||
dataFromNode = false;
|
||||
BleSensArray.push_back(this);
|
||||
}
|
||||
|
||||
~BleSens(){};
|
||||
};
|
||||
|
||||
//=======================================================================================================
|
||||
|
||||
/** Callback to process the results of the last scan or restart it */
|
||||
void scanEndedCB(NimBLEScanResults results)
|
||||
{
|
||||
int count = results.getCount();
|
||||
SerialPrint("i", F("BLE"), "Scan done! "); // +"Devices found: " + String(count));
|
||||
// pBLEScan->clearResults();
|
||||
}
|
||||
|
||||
class BleScan : public IoTItem, BLEAdvertisedDeviceCallbacks
|
||||
{
|
||||
private:
|
||||
// описание параметров передаваемых из настроек датчика из веба
|
||||
int _scanDuration;
|
||||
String _filter;
|
||||
bool _debug;
|
||||
|
||||
StaticJsonDocument<512> doc;
|
||||
BLEScan *pBLEScan;
|
||||
TheengsDecoder decoder;
|
||||
|
||||
public:
|
||||
std::string convertServiceData(std::string deviceServiceData)
|
||||
{
|
||||
int serviceDataLength = (int)deviceServiceData.length();
|
||||
char spr[2 * serviceDataLength + 1];
|
||||
for (int i = 0; i < serviceDataLength; i++)
|
||||
sprintf(spr + 2 * i, "%.2x", (unsigned char)deviceServiceData[i]);
|
||||
spr[2 * serviceDataLength] = 0;
|
||||
return spr;
|
||||
}
|
||||
|
||||
void onResult(BLEAdvertisedDevice *advertisedDevice)
|
||||
{
|
||||
JsonObject BLEdata = doc.to<JsonObject>();
|
||||
String mac_adress_ = advertisedDevice->getAddress().toString().c_str();
|
||||
mac_adress_.toUpperCase();
|
||||
BLEdata["id"] = (char *)mac_adress_.c_str();
|
||||
|
||||
if (advertisedDevice->haveName())
|
||||
{
|
||||
BLEdata["name"] = (char *)advertisedDevice->getName().c_str();
|
||||
}
|
||||
if (advertisedDevice->haveManufacturerData())
|
||||
{
|
||||
char *manufacturerdata = BLEUtils::buildHexData(NULL, (uint8_t *)advertisedDevice->getManufacturerData().data(), advertisedDevice->getManufacturerData().length());
|
||||
BLEdata["manufacturerdata"] = manufacturerdata;
|
||||
free(manufacturerdata);
|
||||
}
|
||||
if (advertisedDevice->haveRSSI())
|
||||
BLEdata["rssi"] = (int)advertisedDevice->getRSSI();
|
||||
if (advertisedDevice->haveTXPower())
|
||||
BLEdata["txpower"] = (int8_t)advertisedDevice->getTXPower();
|
||||
if (advertisedDevice->haveServiceData())
|
||||
{
|
||||
int serviceDataCount = advertisedDevice->getServiceDataCount();
|
||||
for (int j = 0; j < serviceDataCount; j++)
|
||||
{
|
||||
std::string service_data = convertServiceData(advertisedDevice->getServiceData(j));
|
||||
BLEdata["servicedata"] = (char *)service_data.c_str();
|
||||
std::string serviceDatauuid = advertisedDevice->getServiceDataUUID(j).toString();
|
||||
BLEdata["servicedatauuid"] = (char *)serviceDatauuid.c_str();
|
||||
}
|
||||
}
|
||||
|
||||
if (decoder.decodeBLEJson(BLEdata))
|
||||
{
|
||||
String mac_address = BLEdata["mac"].as<const char *>();
|
||||
if (mac_address == "")
|
||||
{
|
||||
BLEdata["mac"] = BLEdata["id"];
|
||||
mac_address = BLEdata["id"].as<const char *>();
|
||||
}
|
||||
mac_address.replace(":", "");
|
||||
if (_debug < 2)
|
||||
{
|
||||
BLEdata.remove("manufacturerdata");
|
||||
BLEdata.remove("servicedata");
|
||||
BLEdata.remove("type");
|
||||
BLEdata.remove("cidc");
|
||||
BLEdata.remove("acts");
|
||||
BLEdata.remove("cont");
|
||||
BLEdata.remove("track");
|
||||
BLEdata.remove("id");
|
||||
}
|
||||
// дописываем время прихода пакета данных
|
||||
BLEdata["last"] = millis();
|
||||
if (_debug)
|
||||
{
|
||||
if ((_filter != "" && BLEdata[_filter]) || _filter == "")
|
||||
{
|
||||
// for (JsonPair kv : BLEdata)
|
||||
// {
|
||||
// String val = BLEdata.as<String>();
|
||||
String output;
|
||||
if (_debug < 2)
|
||||
{
|
||||
BLEdata.remove("servicedatauuid");
|
||||
}
|
||||
serializeJson(BLEdata, output);
|
||||
SerialPrint("i", F("BLE"), mac_address + " " + output);
|
||||
//}
|
||||
}
|
||||
|
||||
SerialPrint("i", F("BLE"), "found: " + String(BLEdata["mac"].as<const char *>()));
|
||||
}
|
||||
|
||||
// Перебираем все зарегистрированные сенсоры BleSens
|
||||
for (std::vector<BleSens *>::iterator it = BleSensArray.begin();
|
||||
it != BleSensArray.end(); ++it)
|
||||
{
|
||||
// Если это данные для нужного сенсора (по его МАКУ)
|
||||
if ((*it)->whoIAm() == mac_address)
|
||||
// то передаем ему json, дальше он сам разберется
|
||||
(*it)->setBLEdata(BLEdata);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
BleScan(String parameters) : IoTItem(parameters)
|
||||
{
|
||||
_scanDuration = jsonReadInt(parameters, "scanDuration");
|
||||
_filter = jsonReadStr(parameters, "filter");
|
||||
jsonRead(parameters, "debug", _debug);
|
||||
|
||||
BLEDevice::init("");
|
||||
pBLEScan = BLEDevice::getScan(); // create new scan
|
||||
pBLEScan->setAdvertisedDeviceCallbacks(this);
|
||||
pBLEScan->setActiveScan(false); // active scan uses more power, but get results faster
|
||||
pBLEScan->setInterval(100);
|
||||
pBLEScan->setWindow(99); // less or equal setInterval value
|
||||
pBLEScan->setMaxResults(0); // do not store the scan results, use callback only.
|
||||
}
|
||||
|
||||
// doByInterval()
|
||||
void doByInterval()
|
||||
{
|
||||
if (pBLEScan->isScanning() == false)
|
||||
{
|
||||
if (_scanDuration > 0)
|
||||
{
|
||||
SerialPrint("i", F("BLE"), "Start Scanning...");
|
||||
pBLEScan->start(_scanDuration, scanEndedCB, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
~BleScan() { BleSensArray.clear(); };
|
||||
};
|
||||
|
||||
//=======================================================================================================
|
||||
|
||||
void *getAPI_Ble_part1(String subtype, String param)
|
||||
{
|
||||
if (subtype == F("BleScan_p1"))
|
||||
{
|
||||
return new BleScan(param);
|
||||
}
|
||||
else if (subtype == F("BleSens_p1"))
|
||||
{
|
||||
return new BleSens(param);
|
||||
}
|
||||
else
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
86
src/modules/sensors/Ble_part1/modinfo.json
Normal file
86
src/modules/sensors/Ble_part1/modinfo.json
Normal file
@@ -0,0 +1,86 @@
|
||||
{
|
||||
"menuSection": "sensors",
|
||||
"configItem": [
|
||||
{
|
||||
"name": "bluetooth сканер",
|
||||
"type": "Reading",
|
||||
"subtype": "BleScan_p1",
|
||||
"id": "BleScan",
|
||||
"widget": "na",
|
||||
"page": "",
|
||||
"descr": "",
|
||||
"int": 135,
|
||||
"scanDuration": 10,
|
||||
"filter": "servicedatauuid",
|
||||
"debug": 1
|
||||
},
|
||||
{
|
||||
"name": "bluetooth датчик",
|
||||
"type": "Reading",
|
||||
"subtype": "BleSens_p1",
|
||||
"id": "BleSens",
|
||||
"widget": "anydataDef",
|
||||
"page": "Сенсоры",
|
||||
"descr": "",
|
||||
"needSave": 0,
|
||||
"int": 30,
|
||||
"global": 0,
|
||||
"round": 1,
|
||||
"orange": 60,
|
||||
"red": 120,
|
||||
"offline": 180,
|
||||
"MAC": "",
|
||||
"sensor": ""
|
||||
}
|
||||
],
|
||||
"about": {
|
||||
"authorName": "AVAKS, v3 - Mit4bmw",
|
||||
"authorContact": "https://t.me/@avaks, https://t.me/Mit4bmw",
|
||||
"authorGit": "https://github.com/avaksru, https://github.com/Mit4el",
|
||||
"specialThanks": "@Serghei63",
|
||||
"moduleName": "Ble_part1",
|
||||
"moduleVersion": "3.1",
|
||||
"usedRam": {
|
||||
"esp32_4mb": 262796,
|
||||
"esp8266_4mb": 0
|
||||
},
|
||||
"subTypes": [
|
||||
"BleSens_p1",
|
||||
"BleScan_p1"
|
||||
],
|
||||
"title": "Сканер Bluetooth, часть 1",
|
||||
"moduleDesc": "Часть 1 популярных Bluetooth датчиков. Позволяет получить данные с Bluetooth часов и термометров Mijia, Xiaomi, Cleargrass, Qingping, Inkbird. Разделение на части сделано для уменьшения размера модуля. Обе части вместе не использовать! для всех датчиков модуль Ble! Полный список (учитывать отстование нашей версии библиотеки) https://decoder.theengs.io/devices/devices.html Наш перечень в файле lib/decoder/devices.h",
|
||||
"propInfo": {
|
||||
"round": "Округление после запятой.",
|
||||
"orange": "количество минут после которого окрасить виджет в оранжевый цвет",
|
||||
"red": "количество минут после которого окрасить виджет в красный цвет",
|
||||
"offline": "количество минут после которого отобразить что устройство offline, если все три orange red и offline поставить в ноль - то функция окраски выключится",
|
||||
"int": "Интервал сканирования BLE окружения (BleScan) / В BleSens темп обновления времнени поступления данных, сами даные обновляются по мене сканирования/поступления",
|
||||
"scanDuration": "Длительность сканирования ",
|
||||
"filter": "Позволяет установить фильтр по параметру передаваемому датчиком. Влияет только на вывод лога при debug=1, что бы было легче найти датчики, если много устройств в эфире",
|
||||
"MAC": "MAC адрес беспроводного датчика",
|
||||
"sensor": "Тип сенсора: температура / влажность / время / ... "
|
||||
}
|
||||
},
|
||||
"defActive": false,
|
||||
"usedLibs": {
|
||||
"esp32_4mb": [
|
||||
"https://github.com/Mit4el/NimBLE-Arduino.git"
|
||||
],
|
||||
"esp32_16mb": [
|
||||
"https://github.com/Mit4el/NimBLE-Arduino.git"
|
||||
],
|
||||
"esp32_4mb3f": [
|
||||
"https://github.com/Mit4el/NimBLE-Arduino.git"
|
||||
],
|
||||
"esp32cam_4mb": [
|
||||
"https://github.com/Mit4el/NimBLE-Arduino.git"
|
||||
],
|
||||
"esp32s3_16mb": [
|
||||
"https://github.com/Mit4el/NimBLE-Arduino.git"
|
||||
],
|
||||
"esp32c3m_4mb": [
|
||||
"https://github.com/Mit4el/NimBLE-Arduino.git"
|
||||
]
|
||||
}
|
||||
}
|
||||
339
src/modules/sensors/Ble_part2/Ble_p2.cpp
Normal file
339
src/modules/sensors/Ble_part2/Ble_p2.cpp
Normal file
@@ -0,0 +1,339 @@
|
||||
#include "Global.h"
|
||||
#include "classes/IoTItem.h"
|
||||
#include <Arduino.h>
|
||||
#include <NimBLEDevice.h>
|
||||
// #define BLE_PART1
|
||||
#define BLE_PART2
|
||||
#include <decoder.h>
|
||||
#include <vector>
|
||||
|
||||
// Создаем переменную для хранения данных с датчиков bluetooth
|
||||
// StaticJsonDocument<JSON_BUFFER_SIZE * 4> BLEbuffer;
|
||||
// DynamicJsonDocument extBLEdata(JSON_BUFFER_SIZE * 4);
|
||||
// JsonObject extBLEdata = BLEbuffer.to<JsonObject>();
|
||||
class BleSens;
|
||||
std::vector<BleSens *> BleSensArray;
|
||||
|
||||
class BleSens : public IoTItem
|
||||
{
|
||||
private:
|
||||
// описание параметров передаваемых из настроек датчика из веба
|
||||
String _MAC;
|
||||
String _sensor;
|
||||
int timeRecv = 0;
|
||||
int _minutesPassed = 0;
|
||||
String json = "{}";
|
||||
int orange = 0;
|
||||
int red = 0;
|
||||
int offline = 0;
|
||||
int _int;
|
||||
bool dataFromNode = false;
|
||||
|
||||
public:
|
||||
String whoIAm(/*String &mac, String &sens*/)
|
||||
{
|
||||
// mac = _MAC;
|
||||
// sens = _sensor;
|
||||
return _MAC;
|
||||
}
|
||||
|
||||
void setBLEdata(JsonObject extBLEdata)
|
||||
{
|
||||
if (_sensor == "last")
|
||||
{
|
||||
timeRecv = extBLEdata[_sensor].as<int>();
|
||||
char *s;
|
||||
s = TimeToString(millis() / 1000 - timeRecv / 1000);
|
||||
value.isDecimal = 0;
|
||||
if (timeRecv > 0)
|
||||
{
|
||||
value.valS = s;
|
||||
dataFromNode = true;
|
||||
_minutesPassed = 0;
|
||||
setNewWidgetAttributes();
|
||||
}
|
||||
else
|
||||
{
|
||||
value.valS = "";
|
||||
}
|
||||
regEvent(value.valS, _id);
|
||||
}
|
||||
else
|
||||
{
|
||||
String valStr = extBLEdata[_sensor].as<String>();
|
||||
if (valStr != "null")
|
||||
{
|
||||
if (value.isDecimal == isDigitDotCommaStr(valStr))
|
||||
{
|
||||
value.isDecimal = 1;
|
||||
value.valD = valStr.toFloat();
|
||||
regEvent(value.valD, _id);
|
||||
dataFromNode = true;
|
||||
_minutesPassed = 0;
|
||||
setNewWidgetAttributes();
|
||||
}
|
||||
else
|
||||
{
|
||||
value.isDecimal = 0;
|
||||
value.valS = valStr;
|
||||
regEvent(value.valS, _id);
|
||||
dataFromNode = true;
|
||||
_minutesPassed = 0;
|
||||
setNewWidgetAttributes();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
char *TimeToString(unsigned long t)
|
||||
{
|
||||
static char str[12];
|
||||
long h = t / 3600;
|
||||
t = t % 3600;
|
||||
int m = t / 60;
|
||||
int s = t % 60;
|
||||
sprintf(str, "%02ld:%02d:%02d", h, m, s);
|
||||
return str;
|
||||
}
|
||||
|
||||
void doByInterval()
|
||||
{
|
||||
if (_sensor == "last")
|
||||
{
|
||||
char *s;
|
||||
s = TimeToString(millis() / 1000 - timeRecv / 1000);
|
||||
value.isDecimal = 0;
|
||||
if (timeRecv > 0)
|
||||
{
|
||||
value.valS = s;
|
||||
}
|
||||
else
|
||||
{
|
||||
value.valS = "";
|
||||
}
|
||||
regEvent(value.valS, _id);
|
||||
}
|
||||
_minutesPassed++;
|
||||
setNewWidgetAttributes();
|
||||
}
|
||||
void onMqttWsAppConnectEvent()
|
||||
{
|
||||
setNewWidgetAttributes();
|
||||
}
|
||||
void setNewWidgetAttributes()
|
||||
{
|
||||
|
||||
int minutes_ = _minutesPassed * _int / 60;
|
||||
jsonWriteStr(json, F("info"), prettyMinutsTimeout(minutes_));
|
||||
if (dataFromNode)
|
||||
{
|
||||
if (orange != 0 && red != 0 && offline != 0)
|
||||
{
|
||||
if (minutes_ < orange)
|
||||
{
|
||||
jsonWriteStr(json, F("color"), "");
|
||||
}
|
||||
if (minutes_ >= orange && minutes_ < red)
|
||||
{
|
||||
jsonWriteStr(json, F("color"), F("orange")); // сделаем виджет оранжевым
|
||||
}
|
||||
if (minutes_ >= red && minutes_ < offline)
|
||||
{
|
||||
jsonWriteStr(json, F("color"), F("red")); // сделаем виджет красным
|
||||
}
|
||||
if (minutes_ >= offline)
|
||||
{
|
||||
jsonWriteStr(json, F("info"), F("offline"));
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
jsonWriteStr(json, F("info"), F("awaiting"));
|
||||
}
|
||||
sendSubWidgetsValues(_id, json);
|
||||
}
|
||||
|
||||
BleSens(String parameters) : IoTItem(parameters)
|
||||
{
|
||||
_MAC = jsonReadStr(parameters, "MAC");
|
||||
_sensor = jsonReadStr(parameters, "sensor");
|
||||
jsonRead(parameters, F("orange"), orange);
|
||||
jsonRead(parameters, F("red"), red);
|
||||
jsonRead(parameters, F("offline"), offline);
|
||||
jsonRead(parameters, F("int"), _int);
|
||||
dataFromNode = false;
|
||||
BleSensArray.push_back(this);
|
||||
}
|
||||
|
||||
~BleSens(){};
|
||||
};
|
||||
|
||||
//=======================================================================================================
|
||||
|
||||
/** Callback to process the results of the last scan or restart it */
|
||||
void scanEndedCB(NimBLEScanResults results)
|
||||
{
|
||||
int count = results.getCount();
|
||||
SerialPrint("i", F("BLE"), "Scan done! "); // +"Devices found: " + String(count));
|
||||
// pBLEScan->clearResults();
|
||||
}
|
||||
|
||||
class BleScan : public IoTItem, BLEAdvertisedDeviceCallbacks
|
||||
{
|
||||
private:
|
||||
// описание параметров передаваемых из настроек датчика из веба
|
||||
int _scanDuration;
|
||||
String _filter;
|
||||
bool _debug;
|
||||
|
||||
StaticJsonDocument<512> doc;
|
||||
BLEScan *pBLEScan;
|
||||
TheengsDecoder decoder;
|
||||
|
||||
public:
|
||||
std::string convertServiceData(std::string deviceServiceData)
|
||||
{
|
||||
int serviceDataLength = (int)deviceServiceData.length();
|
||||
char spr[2 * serviceDataLength + 1];
|
||||
for (int i = 0; i < serviceDataLength; i++)
|
||||
sprintf(spr + 2 * i, "%.2x", (unsigned char)deviceServiceData[i]);
|
||||
spr[2 * serviceDataLength] = 0;
|
||||
return spr;
|
||||
}
|
||||
|
||||
void onResult(BLEAdvertisedDevice *advertisedDevice)
|
||||
{
|
||||
JsonObject BLEdata = doc.to<JsonObject>();
|
||||
String mac_adress_ = advertisedDevice->getAddress().toString().c_str();
|
||||
mac_adress_.toUpperCase();
|
||||
BLEdata["id"] = (char *)mac_adress_.c_str();
|
||||
|
||||
if (advertisedDevice->haveName())
|
||||
{
|
||||
BLEdata["name"] = (char *)advertisedDevice->getName().c_str();
|
||||
}
|
||||
if (advertisedDevice->haveManufacturerData())
|
||||
{
|
||||
char *manufacturerdata = BLEUtils::buildHexData(NULL, (uint8_t *)advertisedDevice->getManufacturerData().data(), advertisedDevice->getManufacturerData().length());
|
||||
BLEdata["manufacturerdata"] = manufacturerdata;
|
||||
free(manufacturerdata);
|
||||
}
|
||||
if (advertisedDevice->haveRSSI())
|
||||
BLEdata["rssi"] = (int)advertisedDevice->getRSSI();
|
||||
if (advertisedDevice->haveTXPower())
|
||||
BLEdata["txpower"] = (int8_t)advertisedDevice->getTXPower();
|
||||
if (advertisedDevice->haveServiceData())
|
||||
{
|
||||
int serviceDataCount = advertisedDevice->getServiceDataCount();
|
||||
for (int j = 0; j < serviceDataCount; j++)
|
||||
{
|
||||
std::string service_data = convertServiceData(advertisedDevice->getServiceData(j));
|
||||
BLEdata["servicedata"] = (char *)service_data.c_str();
|
||||
std::string serviceDatauuid = advertisedDevice->getServiceDataUUID(j).toString();
|
||||
BLEdata["servicedatauuid"] = (char *)serviceDatauuid.c_str();
|
||||
}
|
||||
}
|
||||
|
||||
if (decoder.decodeBLEJson(BLEdata))
|
||||
{
|
||||
String mac_address = BLEdata["mac"].as<const char *>();
|
||||
if (mac_address == "")
|
||||
{
|
||||
BLEdata["mac"] = BLEdata["id"];
|
||||
mac_address = BLEdata["id"].as<const char *>();
|
||||
}
|
||||
mac_address.replace(":", "");
|
||||
if (_debug < 2)
|
||||
{
|
||||
BLEdata.remove("manufacturerdata");
|
||||
BLEdata.remove("servicedata");
|
||||
BLEdata.remove("type");
|
||||
BLEdata.remove("cidc");
|
||||
BLEdata.remove("acts");
|
||||
BLEdata.remove("cont");
|
||||
BLEdata.remove("track");
|
||||
BLEdata.remove("id");
|
||||
}
|
||||
|
||||
// дописываем время прихода пакета данных
|
||||
BLEdata["last"] = millis();
|
||||
if (_debug)
|
||||
{
|
||||
if ((_filter != "" && BLEdata[_filter]) || _filter == "")
|
||||
{
|
||||
// for (JsonPair kv : BLEdata)
|
||||
// {
|
||||
// String val = BLEdata.as<String>();
|
||||
String output;
|
||||
if (_debug < 2)
|
||||
{
|
||||
BLEdata.remove("servicedatauuid");
|
||||
}
|
||||
serializeJson(BLEdata, output);
|
||||
SerialPrint("i", F("BLE"), mac_address + " " + output);
|
||||
//}
|
||||
}
|
||||
|
||||
SerialPrint("i", F("BLE"), "found: " + String(BLEdata["mac"].as<const char *>()));
|
||||
}
|
||||
|
||||
// Перебираем все зарегистрированные сенсоры BleSens
|
||||
for (std::vector<BleSens *>::iterator it = BleSensArray.begin();
|
||||
it != BleSensArray.end(); ++it)
|
||||
{
|
||||
// Если это данные для нужного сенсора (по его МАКУ)
|
||||
if ((*it)->whoIAm() == mac_address)
|
||||
// то передаем ему json, дальше он сам разберется
|
||||
(*it)->setBLEdata(BLEdata);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
BleScan(String parameters) : IoTItem(parameters)
|
||||
{
|
||||
_scanDuration = jsonReadInt(parameters, "scanDuration");
|
||||
_filter = jsonReadStr(parameters, "filter");
|
||||
jsonRead(parameters, "debug", _debug);
|
||||
|
||||
BLEDevice::init("");
|
||||
pBLEScan = BLEDevice::getScan(); // create new scan
|
||||
pBLEScan->setAdvertisedDeviceCallbacks(this);
|
||||
pBLEScan->setActiveScan(false); // active scan uses more power, but get results faster
|
||||
pBLEScan->setInterval(100);
|
||||
pBLEScan->setWindow(99); // less or equal setInterval value
|
||||
pBLEScan->setMaxResults(0); // do not store the scan results, use callback only.
|
||||
}
|
||||
|
||||
// doByInterval()
|
||||
void doByInterval()
|
||||
{
|
||||
if (pBLEScan->isScanning() == false)
|
||||
{
|
||||
if (_scanDuration > 0)
|
||||
{
|
||||
SerialPrint("i", F("BLE"), "Start Scanning...");
|
||||
pBLEScan->start(_scanDuration, scanEndedCB, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
~BleScan() { BleSensArray.clear(); };
|
||||
};
|
||||
|
||||
//=======================================================================================================
|
||||
|
||||
void *getAPI_Ble_part2(String subtype, String param)
|
||||
{
|
||||
if (subtype == F("BleScan_p2"))
|
||||
{
|
||||
return new BleScan(param);
|
||||
}
|
||||
else if (subtype == F("BleSens_p2"))
|
||||
{
|
||||
return new BleSens(param);
|
||||
}
|
||||
else
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
86
src/modules/sensors/Ble_part2/modinfo.json
Normal file
86
src/modules/sensors/Ble_part2/modinfo.json
Normal file
@@ -0,0 +1,86 @@
|
||||
{
|
||||
"menuSection": "sensors",
|
||||
"configItem": [
|
||||
{
|
||||
"name": "bluetooth сканер",
|
||||
"type": "Reading",
|
||||
"subtype": "BleScan_p2",
|
||||
"id": "BleScan",
|
||||
"widget": "na",
|
||||
"page": "",
|
||||
"descr": "",
|
||||
"int": 135,
|
||||
"scanDuration": 10,
|
||||
"filter": "servicedatauuid",
|
||||
"debug": 1
|
||||
},
|
||||
{
|
||||
"name": "bluetooth датчик",
|
||||
"type": "Reading",
|
||||
"subtype": "BleSens_p2",
|
||||
"id": "BleSens",
|
||||
"widget": "anydataDef",
|
||||
"page": "Сенсоры",
|
||||
"descr": "",
|
||||
"needSave": 0,
|
||||
"int": 30,
|
||||
"global": 0,
|
||||
"round": 1,
|
||||
"orange": 60,
|
||||
"red": 120,
|
||||
"offline": 180,
|
||||
"MAC": "",
|
||||
"sensor": ""
|
||||
}
|
||||
],
|
||||
"about": {
|
||||
"authorName": "AVAKS, v3 - Mit4bmw",
|
||||
"authorContact": "https://t.me/@avaks, https://t.me/Mit4bmw",
|
||||
"authorGit": "https://github.com/avaksru, https://github.com/Mit4el",
|
||||
"specialThanks": "@Serghei63",
|
||||
"moduleName": "Ble_part2",
|
||||
"moduleVersion": "3.1",
|
||||
"usedRam": {
|
||||
"esp32_4mb": 288972,
|
||||
"esp8266_4mb": 0
|
||||
},
|
||||
"subTypes": [
|
||||
"BleSens_p2",
|
||||
"BleScan_p2"
|
||||
],
|
||||
"title": "Сканер Bluetooth, часть 2",
|
||||
"moduleDesc": "Часть 2 Bluetooth датчиков. Позволяет получить данные с Bluetooth датчиков, кроме Mijia, Xiaomi, Cleargrass, Qingping, Inkbird. Обе части вместе не использовать! для всех датчиков модуль Ble! Полный список (учитывать отстование нашей версии библиотеки) https://decoder.theengs.io/devices/devices.html Наш перечень в файле lib/decoder/devices.h",
|
||||
"propInfo": {
|
||||
"round": "Округление после запятой.",
|
||||
"orange": "количество минут после которого окрасить виджет в оранжевый цвет",
|
||||
"red": "количество минут после которого окрасить виджет в красный цвет",
|
||||
"offline": "количество минут после которого отобразить что устройство offline, если все три orange red и offline поставить в ноль - то функция окраски выключится",
|
||||
"int": "Интервал сканирования BLE окружения (BleScan) / В BleSens темп обновления времнени поступления данных, сами даные обновляются по мене сканирования/поступления",
|
||||
"scanDuration": "Длительность сканирования ",
|
||||
"filter": "Позволяет установить фильтр по параметру передаваемому датчиком. Влияет только на вывод лога при debug=1, что бы было легче найти датчики, если много устройств в эфире",
|
||||
"MAC": "MAC адрес беспроводного датчика",
|
||||
"sensor": "Тип сенсора: температура / влажность / время / ... "
|
||||
}
|
||||
},
|
||||
"defActive": false,
|
||||
"usedLibs": {
|
||||
"esp32_4mb": [
|
||||
"https://github.com/Mit4el/NimBLE-Arduino.git"
|
||||
],
|
||||
"esp32_16mb": [
|
||||
"https://github.com/Mit4el/NimBLE-Arduino.git"
|
||||
],
|
||||
"esp32_4mb3f": [
|
||||
"https://github.com/Mit4el/NimBLE-Arduino.git"
|
||||
],
|
||||
"esp32cam_4mb": [
|
||||
"https://github.com/Mit4el/NimBLE-Arduino.git"
|
||||
],
|
||||
"esp32s3_16mb": [
|
||||
"https://github.com/Mit4el/NimBLE-Arduino.git"
|
||||
],
|
||||
"esp32c3m_4mb": [
|
||||
"https://github.com/Mit4el/NimBLE-Arduino.git"
|
||||
]
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user