diff --git a/docs/devices/TILT.md b/docs/devices/TILT.md index d4fbd5e24..e10621a67 100644 --- a/docs/devices/TILT.md +++ b/docs/devices/TILT.md @@ -8,5 +8,5 @@ |Communication|BLE broadcast| |Frequency|2.4Ghz| |Power Source|CR123A| -|Exchanged Data|color, temperature, specific gravity| +|Exchanged Data|color, temperature, specific gravity, txpower @ 1 m| |Encrypted|No| diff --git a/src/devices/TILT_json.h b/src/devices/TILT_json.h index 9a3b28759..9251a1504 100644 --- a/src/devices/TILT_json.h +++ b/src/devices/TILT_json.h @@ -1,4 +1,4 @@ -const char* _TILT_json = "{\"brand\":\"Tilt\",\"model\":\"Brewing Hydro- Thermometer\",\"model_id\":\"TILT\",\"tag\":\"0201\",\"condition\":[\"manufacturerdata\",\"=\",50,\"index\",0,\"4c000215a495bb\",\"&\",\"manufacturerdata\",\"index\",16,\"c5b14b44b5121370f02d74de004403f8c5\"],\"properties\":{\"color\":{\"decoder\":[\"string_from_hex_data\",\"manufacturerdata\",14,2],\"lookup\":[\"10\",\"red\",\"20\",\"green\",\"30\",\"black\",\"40\",\"purple\",\"50\",\"orange\",\"60\",\"blue\",\"70\",\"yellow\",\"80\",\"pink\"]},\"tempf\":{\"decoder\":[\"value_from_hex_data\",\"manufacturerdata\",40,4,false,true]},\"gravity\":{\"decoder\":[\"value_from_hex_data\",\"manufacturerdata\",44,4,false,false],\"post_proc\":[\"/\",1000]}}}"; +const char* _TILT_json = "{\"brand\":\"Tilt\",\"model\":\"Brewing Hydro- Thermometer\",\"model_id\":\"TILT\",\"tag\":\"0201\",\"condition\":[\"manufacturerdata\",\"=\",50,\"index\",0,\"4c000215a495bb\",\"&\",\"manufacturerdata\",\"index\",16,\"c5b14b44b5121370f02d74de\"],\"properties\":{\"color\":{\"decoder\":[\"string_from_hex_data\",\"manufacturerdata\",14,2],\"lookup\":[\"10\",\"red\",\"20\",\"green\",\"30\",\"black\",\"40\",\"purple\",\"50\",\"orange\",\"60\",\"blue\",\"70\",\"yellow\",\"80\",\"pink\"]},\"tempf\":{\"decoder\":[\"value_from_hex_data\",\"manufacturerdata\",40,4,false,true]},\"gravity\":{\"decoder\":[\"value_from_hex_data\",\"manufacturerdata\",44,4,false,false],\"post_proc\":[\"/\",1000]},\"txpower\":{\"condition\":[\"manufacturerdata\",48,\"bit\",3,1],\"decoder\":[\"value_from_hex_data\",\"manufacturerdata\",48,2,false,true]}}}"; /*R""""( { @@ -6,7 +6,7 @@ const char* _TILT_json = "{\"brand\":\"Tilt\",\"model\":\"Brewing Hydro- Thermom "model":"Brewing Hydro- Thermometer", "model_id":"TILT", "tag":"0201", - "condition":["manufacturerdata", "=", 50, "index", 0, "4c000215a495bb", "&", "manufacturerdata", "index", 16, "c5b14b44b5121370f02d74de004403f8c5"], + "condition":["manufacturerdata", "=", 50, "index", 0, "4c000215a495bb", "&", "manufacturerdata", "index", 16, "c5b14b44b5121370f02d74de"], "properties":{ "color":{ "decoder":["string_from_hex_data", "manufacturerdata", 14, 2], @@ -25,11 +25,15 @@ const char* _TILT_json = "{\"brand\":\"Tilt\",\"model\":\"Brewing Hydro- Thermom "gravity":{ "decoder":["value_from_hex_data", "manufacturerdata", 44, 4, false, false], "post_proc":["/", 1000] + }, + "txpower":{ + "condition":["manufacturerdata", 48, "bit", 3, 1], + "decoder":["value_from_hex_data","manufacturerdata", 48, 2, false, true] } } })"""";*/ -const char* _TILT_json_props = "{\"properties\":{\"color\":{\"unit\":\"string\",\"name\":\"color\"},\"tempf\":{\"unit\":\"°C\",\"name\":\"temperature\"},\"gravity\":{\"unit\":\"SG\",\"name\":\"specific_gravity\"}}}"; +const char* _TILT_json_props = "{\"properties\":{\"color\":{\"unit\":\"string\",\"name\":\"color\"},\"tempf\":{\"unit\":\"°C\",\"name\":\"temperature\"},\"gravity\":{\"unit\":\"SG\",\"name\":\"specific_gravity\"},\"txpower\":{\"unit\":\"dBm\",\"name\":\"signal_strength\"}}}"; /*R""""( { "properties":{ @@ -44,6 +48,10 @@ const char* _TILT_json_props = "{\"properties\":{\"color\":{\"unit\":\"string\", "gravity":{ "unit":"SG", "name":"specific_gravity" + }, + "txpower":{ + "unit":"dBm", + "name":"signal_strength" } } })"""";*/ diff --git a/tests/BLE/test_ble.cpp b/tests/BLE/test_ble.cpp index 48043cacd..38b3e88bc 100644 --- a/tests/BLE/test_ble.cpp +++ b/tests/BLE/test_ble.cpp @@ -153,7 +153,7 @@ const char* expected_mfg[] = { "{\"brand\":\"Govee\",\"model\":\"Smart Thermo-Hygrometer\",\"model_id\":\"H5100/01/02/04/05/74/77\",\"type\":\"THB\",\"cidc\":false,\"acts\":true,\"tempc\":22.7,\"tempf\":72.86,\"hum\":44.6,\"batt\":100}", "{\"brand\":\"iTAG\",\"model\":\"Smart Tracker\",\"model_id\":\"ITAG\",\"type\":\"TRACK\",\"cidc\":false,\"acts\":true,\"cont\":true,\"track\":true,\"device\":\"iTAG Tracker\"}", "{\"brand\":\"iTAG\",\"model\":\"Smart Tracker\",\"model_id\":\"ITAG\",\"type\":\"TRACK\",\"cidc\":false,\"acts\":true,\"cont\":true,\"track\":true,\"device\":\"iTAG Tracker\"}", - "{\"brand\":\"Tilt\",\"model\":\"Brewing Hydro- Thermometer\",\"model_id\":\"TILT\",\"type\":\"THBX\",\"cidc\":false,\"color\":\"red\",\"tempf\":68,\"tempc\":20,\"gravity\":1.016}", + "{\"brand\":\"Tilt\",\"model\":\"Brewing Hydro- Thermometer\",\"model_id\":\"TILT\",\"type\":\"THBX\",\"cidc\":false,\"color\":\"red\",\"tempf\":68,\"tempc\":20,\"gravity\":1.016,\"txpower\":-59}", }; const char* expected_name_uuid_mfgsvcdata[] = {