diff --git a/src/devices/SCD4X_json.h b/src/devices/SCD4X_json.h index b7ea6799..d1921a0b 100644 --- a/src/devices/SCD4X_json.h +++ b/src/devices/SCD4X_json.h @@ -1,4 +1,4 @@ -const char* _SCD4X_json = "{\"brand\":\"Sensirion\",\"model\":\"MyCO₂/CO₂ Gadget\",\"model_id\":\"SCD4X\",\"tag\":\"0f\",\"condition\":[\"manufacturerdata\",\"=\",28,\"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 = "{\"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""""( { @@ -6,7 +6,7 @@ const char* _SCD4X_json = "{\"brand\":\"Sensirion\",\"model\":\"MyCO₂/CO₂ Ga "model":"MyCO₂/CO₂ Gadget", "model_id":"SCD4X", "tag":"0f", - "condition":["manufacturerdata", "=", 28, "index", 0, "d5060008", "|", "manufacturerdata", "=", 24, "index", 0, "d506000a"], + "condition":["manufacturerdata", ">=", 24, "index", 0, "d5060008", "|", "manufacturerdata", ">=", 24, "index", 0, "d506000a"], "properties":{ "tempc":{ "decoder":["value_from_hex_data", "manufacturerdata", 12, 4, true, true], diff --git a/src/devices/SHT4X_json.h b/src/devices/SHT4X_json.h index 35355c11..c6eed65a 100644 --- a/src/devices/SHT4X_json.h +++ b/src/devices/SHT4X_json.h @@ -1,6 +1,6 @@ #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]}}}"; +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""""( { @@ -8,7 +8,7 @@ const char* _SHT4X_json = "{\"brand\":\"Sensirion\",\"model\":\"TH Sensor\",\"mo "model":"TH Sensor", "model_id":"SHT4X", "tag":"01", - "condition":["manufacturerdata", "=", 20, "index", 0, "d5060006"], + "condition":["manufacturerdata", ">=", 20, "index", 0, "d5060006"], "properties":{ "tempc":{ "decoder":["value_from_hex_data", "manufacturerdata", 12, 4, true, true], diff --git a/tests/BLE/test_ble.cpp b/tests/BLE/test_ble.cpp index 8b2dafb3..03a9dd80 100644 --- a/tests/BLE/test_ble.cpp +++ b/tests/BLE/test_ble.cpp @@ -84,8 +84,10 @@ const char* expected_mfg[] = { "{\"brand\":\"Sensirion\",\"model\":\"TH Sensor\",\"model_id\":\"SHT4X\",\"type\":\"THB\",\"tempc\":27.47005417,\"tempf\":81.44609751,\"hum\":43.37056535}", "{\"brand\":\"Sensirion\",\"model\":\"TH Sensor\",\"model_id\":\"SHT4X\",\"type\":\"THB\",\"tempc\":-10,\"tempf\":14,\"hum\":90.00404364}", "{\"brand\":\"Sensirion\",\"model\":\"TH Sensor\",\"model_id\":\"SHT4X\",\"type\":\"THB\",\"tempc\":-2.50171664,\"tempf\":27.49691005,\"hum\":65.00022889}", + "{\"brand\":\"Sensirion\",\"model\":\"TH Sensor\",\"model_id\":\"SHT4X\",\"type\":\"THB\",\"tempc\":27.47005417,\"tempf\":81.44609751,\"hum\":43.37056535}", "{\"brand\":\"Sensirion\",\"model\":\"MyCO₂/CO₂ Gadget\",\"model_id\":\"SCD4X\",\"type\":\"AIR\",\"tempc\":-10,\"tempf\":14,\"hum\":76.80323491,\"co2\":745}", "{\"brand\":\"Sensirion\",\"model\":\"MyCO₂/CO₂ Gadget\",\"model_id\":\"SCD4X\",\"type\":\"AIR\",\"tempc\":25.63286793,\"tempf\":78.13916228,\"hum\":36.16083009,\"co2\":1035}", + "{\"brand\":\"Sensirion\",\"model\":\"MyCO₂/CO₂ Gadget\",\"model_id\":\"SCD4X\",\"type\":\"AIR\",\"tempc\":28.14831769,\"tempf\":82.66697185,\"hum\":38.09872587,\"co2\":1434}", "{\"brand\":\"Govee\",\"model\":\"Smart Thermo Hygrometer\",\"model_id\":\"H5101/02/74/77\",\"type\":\"THB\",\"cidc\":false,\"tempc\":22,\"tempf\":71.6,\"hum\":69.1,\"batt\":100}", "{\"brand\":\"Govee\",\"model\":\"Smart Thermo Hygrometer\",\"model_id\":\"H5101/02/74/77\",\"type\":\"THB\",\"cidc\":false,\"tempc\":-7.2,\"tempf\":19.04,\"hum\":90.3,\"batt\":100}", "{\"brand\":\"Govee\",\"model\":\"Thermo Hygrometer\",\"model_id\":\"H5074\",\"type\":\"THB\",\"cidc\":false,\"tempc\":22.44,\"tempf\":72.392,\"hum\":74.59,\"batt\":100}", @@ -351,8 +353,10 @@ const char* test_mfgdata[][3] = { {"Sensirion SHT4X", "SHT4X", "d5060006e2e7036a1c65"}, {"Sensirion SHT4X", "SHT4X", "d5060006e2e733339dc4"}, {"Sensirion SHT4X", "SHT4X", "d5060006e2e72b3e6891"}, + {"Sensirion SHT4X", "SHT4X", "d5060006e2e7036a1c650d09534854343020476164676574"}, {"Sensirion MyCO2", "SCD4X", "d506000ae2e733339dc4e902"}, {"Sensirion MyCO2", "SCD4X", "d506000867355367925c0b040609"}, + {"Sensirion MyCO2", "SCD4X", "d506000ac543016b88619a05000000009a05000000000000"}, {"H5174", "GVH5174_1234", "01000101035e1364"}, {"H5174", "GVH5174_1234", "01000101811a6764"}, {"H5074", "Govee_H5074_1234", "88ec00c408231d6402"}, @@ -439,6 +443,8 @@ TheengsDecoder::BLE_ID_NUM test_mfgdata_id_num[]{ TheengsDecoder::BLE_ID_NUM::SHT4X, TheengsDecoder::BLE_ID_NUM::SHT4X, TheengsDecoder::BLE_ID_NUM::SHT4X, + TheengsDecoder::BLE_ID_NUM::SHT4X, + TheengsDecoder::BLE_ID_NUM::SCD4X, TheengsDecoder::BLE_ID_NUM::SCD4X, TheengsDecoder::BLE_ID_NUM::SCD4X, TheengsDecoder::BLE_ID_NUM::H5102,