diff --git a/docs/devices/SBBT-004CEU.md b/docs/devices/SBBT-004CEU.md new file mode 100644 index 00000000..98040503 --- /dev/null +++ b/docs/devices/SBBT-004CEU.md @@ -0,0 +1,23 @@ +# ShellyBLU Wall Switcht4 + +|Model Id|[SBBT-004CEU](https://github.com/theengs/decoder/blob/development/src/devices/SBBT_004CEU_json.h)| +|-|-| +|Brand|Shelly| +|Model|ShellyBLU Wall Switch4| +|Short Description|Button| +|Communication|BLE broadcast| +|Frequency|2.4Ghz| +|Power Source|CR2032| +|Exchanged Data|button press type of each button, battery, packet ID| +|Encrypted|Yes/No - Optional| + +Currently only unencrypted devices are supported. + +The button press type for each button is encoded as: + +* 0 - None (other Button was pressed or sent every 8 seconds if beacon mode is enabled) +* 1 - Single short click +* 2 - Double click +* 3 - Triple click +* 9 - Long press +* 11 - Button hold diff --git a/docs/devices/SBBT-004CUS.md b/docs/devices/SBBT-004CUS.md new file mode 100644 index 00000000..34dc0885 --- /dev/null +++ b/docs/devices/SBBT-004CUS.md @@ -0,0 +1,23 @@ +# ShellyBLU RC Button4 + +|Model Id|[SBBT-004CUS](https://github.com/theengs/decoder/blob/development/src/devices/SBBT_004CUS_json.h)| +|-|-| +|Brand|Shelly| +|Model|ShellyBLU RC Button4| +|Short Description|Button| +|Communication|BLE broadcast| +|Frequency|2.4Ghz| +|Power Source|CR2032| +|Exchanged Data|button press type of each button, battery, packet ID| +|Encrypted|Yes/No - Optional| + +Currently only unencrypted devices are supported. + +The button press type for each button is encoded as: + +* 0 - None (other Button was pressed or sent every 8 seconds if beacon mode is enabled) +* 1 - Single short click +* 2 - Double click +* 3 - Triple click +* 9 - Long press +* 11 - Button hold diff --git a/src/decoder.h b/src/decoder.h index 4739bef6..2ebd9f32 100644 --- a/src/decoder.h +++ b/src/decoder.h @@ -162,6 +162,7 @@ class TheengsDecoder { SE_MAG, SBBT_002C, SBBT_002C_ENCR, + SBBT_004CEU_US, SBDW_002C, SBDW_002C_ENCR, SBMO_003Z, diff --git a/src/devices.h b/src/devices.h index 6a3774c8..15b26624 100644 --- a/src/devices.h +++ b/src/devices.h @@ -113,6 +113,7 @@ #include "devices/SE_MAG_json.h" #include "devices/SBBT_002C_json.h" #include "devices/SBBT_002C_ENCR_json.h" +#include "devices/SBBT_004CEU_US_json.h" #include "devices/SBDW_002C_json.h" #include "devices/SBDW_002C_ENCR_json.h" #include "devices/SBMO_003Z_json.h" @@ -238,6 +239,7 @@ const char* _devices[][2] = { {_SE_MAG_json, _SE_MAG_json_props}, {_SBBT_002C_json, _SBBT_002C_json_props}, {_SBBT_002C_ENCR_json, _SBBT_002C_ENCR_json_props}, + {_SBBT_004CEU_US_json, _SBBT_004CEU_US_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}, diff --git a/src/devices/SBBT_004CEU_US_json.h b/src/devices/SBBT_004CEU_US_json.h new file mode 100644 index 00000000..8141ad48 --- /dev/null +++ b/src/devices/SBBT_004CEU_US_json.h @@ -0,0 +1,98 @@ +const char* _SBBT_004CEU_US_json = "{\"brand\":\"Shelly\",\"model\":\"ShellyBLU Switch4\",\"model_id\":\"SBBT-004CEU/US\",\"tag\":\"1106\",\"condition\":[\"servicedata\",\"=\",26,\"index\",0,\"40\",\"|\",\"servicedata\",\"=\",26,\"index\",0,\"44\",\"&\",\"uuid\",\"index\",0,\"fcd2\",\"&\",\"name\",\"index\",0,\"SBBT-\"],\"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]},\"button1\":{\"condition\":[\"servicedata\",10,\"3a\"],\"decoder\":[\"string_from_hex_data\",\"servicedata\",12,2],\"lookup\":[\"00\",0,\"01\",1,\"02\",2,\"03\",3,\"04\",9,\"fe\",11]},\"button2\":{\"condition\":[\"servicedata\",14,\"3a\"],\"decoder\":[\"string_from_hex_data\",\"servicedata\",16,2],\"lookup\":[\"00\",0,\"01\",1,\"02\",2,\"03\",3,\"04\",9,\"fe\",11]},\"button3\":{\"condition\":[\"servicedata\",18,\"3a\"],\"decoder\":[\"string_from_hex_data\",\"servicedata\",20,2],\"lookup\":[\"00\",0,\"01\",1,\"02\",2,\"03\",3,\"04\",9,\"fe\",11]},\"button4\":{\"condition\":[\"servicedata\",22,\"3a\"],\"decoder\":[\"string_from_hex_data\",\"servicedata\",24,2],\"lookup\":[\"00\",0,\"01\",1,\"02\",2,\"03\",3,\"04\",9,\"fe\",11]},\"mac\":{\"condition\":[\"manufacturerdata\",\"=\",30],\"decoder\":[\"revmac_from_hex_data\",\"manufacturerdata\",18]}}}"; +/*R""""( +{ + "brand":"Shelly", + "model":"ShellyBLU Switch4", + "model_id":"SBBT-004CEU/US", + "tag":"1106", + "condition":["servicedata", "=", 26, "index", 0, "40", "|", "servicedata", "=", 26, "index", 0, "44", "&", "uuid", "index", 0, "fcd2", "&", "name", "index", 0, "SBBT-"], + "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] + }, + "button1":{ + "condition":["servicedata", 10, "3a"], + "decoder":["string_from_hex_data", "servicedata", 12, 2], + "lookup":["00", 0, + "01", 1, + "02", 2, + "03", 3, + "04", 9, + "fe", 11] + }, + "button2":{ + "condition":["servicedata", 14, "3a"], + "decoder":["string_from_hex_data", "servicedata", 16, 2], + "lookup":["00", 0, + "01", 1, + "02", 2, + "03", 3, + "04", 9, + "fe", 11] + }, + "button3":{ + "condition":["servicedata", 18, "3a"], + "decoder":["string_from_hex_data", "servicedata", 20, 2], + "lookup":["00", 0, + "01", 1, + "02", 2, + "03", 3, + "04", 9, + "fe", 11] + }, + "button4":{ + "condition":["servicedata", 22, "3a"], + "decoder":["string_from_hex_data", "servicedata", 24, 2], + "lookup":["00", 0, + "01", 1, + "02", 2, + "03", 3, + "04", 9, + "fe", 11] + }, + "mac":{ + "condition":["manufacturerdata", "=", 30], + "decoder":["revmac_from_hex_data", "manufacturerdata", 18] + } + } +})"""";*/ + +const char* _SBBT_004CEU_US_json_props = "{\"properties\":{\"packet\":{\"unit\":\"int\",\"name\":\"packet id\"},\"batt\":{\"unit\":\"%\",\"name\":\"battery\"},\"button1\":{\"unit\":\"int\",\"name\":\"button1 press type\"},\"button2\":{\"unit\":\"int\",\"name\":\"button2 press type\"},\"button3\":{\"unit\":\"int\",\"name\":\"button3 press type\"},\"button4\":{\"unit\":\"int\",\"name\":\"button4 press type\"},\"mac\":{\"unit\":\"string\",\"name\":\"MAC address\"}}}"; +/*R""""( +{ + "properties":{ + "packet":{ + "unit":"int", + "name":"packet id" + }, + "batt":{ + "unit":"%", + "name":"battery" + }, + "button1":{ + "unit":"int", + "name":"button1 press type" + }, + "button2":{ + "unit":"int", + "name":"button2 press type" + }, + "button3":{ + "unit":"int", + "name":"button3 press type" + }, + "button4":{ + "unit":"int", + "name":"button4 press type" + }, + "mac":{ + "unit":"string", + "name":"MAC address" + } + } +})"""";*/ diff --git a/tests/BLE/test_ble.cpp b/tests/BLE/test_ble.cpp index f1dbc125..a2f2db2c 100644 --- a/tests/BLE/test_ble.cpp +++ b/tests/BLE/test_ble.cpp @@ -202,6 +202,7 @@ const char* expected_name_uuid_mfgsvcdata[] = { const char* expected_name_mac_uuid_mfgsvcdata[] = { "{\"brand\":\"Shelly\",\"model\":\"ShellyBLU Button1\",\"model_id\":\"SBBT-002C\",\"type\":\"BTN\",\"acts\":true,\"cont\":true,\"packet\":29,\"batt\":100,\"button\":1,\"mac\":\"BC:02:6E:AA:BB:CC\"}", "{\"brand\":\"Shelly\",\"model\":\"ShellyBLU Button1 encrypted\",\"model_id\":\"SBBT_002C_ENCR\",\"type\":\"BTN\",\"acts\":true,\"cont\":true,\"encr\":2,\"cipher\":\"62511158bd25\",\"ctr\":\"b8f09364\",\"mic\":\"5b573115\",\"mac\":\"BC:02:6E:AA:BB:CC\"}", + "{\"brand\":\"Shelly\",\"model\":\"ShellyBLU Switch4\",\"model_id\":\"SBBT-004CEU/US\",\"type\":\"BTN\",\"acts\":true,\"cont\":true,\"packet\":29,\"batt\":100,\"button1\":1,\"button2\":0,\"button3\":0,\"button4\":0,\"mac\":\"38:39:8F:71:EE:FF\"}", "{\"brand\":\"Shelly\",\"model\":\"ShellyBLU Door/Window\",\"model_id\":\"SBDW-002C\",\"type\":\"CTMO\",\"acts\":true,\"cont\":true,\"packet\":93,\"batt\":100,\"lux\":87,\"open\":true,\"rot\":40.6,\"mac\":\"3C:2E:F5:AA:BB:CC\"}", "{\"brand\":\"Shelly\",\"model\":\"ShellyBLU Door/Window\",\"model_id\":\"SBDW-002C\",\"type\":\"CTMO\",\"acts\":true,\"cont\":true,\"packet\":86,\"batt\":100,\"lux\":673,\"open\":false,\"rot\":0,\"mac\":\"3C:2E:F5:AA:BB:CC\"}", "{\"brand\":\"Shelly\",\"model\":\"ShellyBLU Door/Window encrypted\",\"model_id\":\"SBDW_002C_ENCR\",\"type\":\"CTMO\",\"acts\":true,\"cont\":true,\"encr\":2,\"cipher\":\"38efaf00d122b4979064e971a7\",\"ctr\":\"ed16c164\",\"mic\":\"4dc481fd\",\"mac\":\"3C:2E:F5:AA:BB:CC\"}", @@ -243,7 +244,58 @@ const char* expected_uuid_name_svcdata[] = { "{\"brand\":\"Shelly\",\"model\":\"ShellyBLU Button1\",\"model_id\":\"SBBT-002C\",\"type\":\"BTN\",\"acts\":true,\"cont\":true,\"packet\":31,\"batt\":100,\"button\":3}", "{\"brand\":\"Shelly\",\"model\":\"ShellyBLU Button1\",\"model_id\":\"SBBT-002C\",\"type\":\"BTN\",\"acts\":true,\"cont\":true,\"packet\":32,\"batt\":100,\"button\":9}", "{\"brand\":\"Shelly\",\"model\":\"ShellyBLU Button1\",\"model_id\":\"SBBT-002C\",\"type\":\"BTN\",\"acts\":true,\"cont\":true,\"packet\":171,\"batt\":100,\"button\":1}", + "{\"brand\":\"Shelly\",\"model\":\"ShellyBLU Button1\",\"model_id\":\"SBBT-002C\",\"type\":\"BTN\",\"acts\":true,\"cont\":true,\"packet\":172,\"batt\":100,\"button\":11}", "{\"brand\":\"Shelly\",\"model\":\"ShellyBLU Button1 encrypted\",\"model_id\":\"SBBT_002C_ENCR\",\"type\":\"BTN\",\"acts\":true,\"cont\":true,\"encr\":2,\"cipher\":\"62511158bd25\",\"ctr\":\"b8f09364\",\"mic\":\"5b573115\"}", + "{\"brand\":\"Shelly\",\"model\":\"ShellyBLU Switch4\",\"model_id\":\"SBBT-004CEU/US\",\"type\":\"BTN\",\"acts\":true,\"cont\":true,\"packet\":29,\"batt\":100,\"button1\":1,\"button2\":0,\"button3\":0,\"button4\":0}", + "{\"brand\":\"Shelly\",\"model\":\"ShellyBLU Switch4\",\"model_id\":\"SBBT-004CEU/US\",\"type\":\"BTN\",\"acts\":true,\"cont\":true,\"packet\":30,\"batt\":100,\"button1\":2,\"button2\":0,\"button3\":0,\"button4\":0}", + "{\"brand\":\"Shelly\",\"model\":\"ShellyBLU Switch4\",\"model_id\":\"SBBT-004CEU/US\",\"type\":\"BTN\",\"acts\":true,\"cont\":true,\"packet\":31,\"batt\":100,\"button1\":3,\"button2\":0,\"button3\":0,\"button4\":0}", + "{\"brand\":\"Shelly\",\"model\":\"ShellyBLU Switch4\",\"model_id\":\"SBBT-004CEU/US\",\"type\":\"BTN\",\"acts\":true,\"cont\":true,\"packet\":32,\"batt\":100,\"button1\":9,\"button2\":0,\"button3\":0,\"button4\":0}", + "{\"brand\":\"Shelly\",\"model\":\"ShellyBLU Switch4\",\"model_id\":\"SBBT-004CEU/US\",\"type\":\"BTN\",\"acts\":true,\"cont\":true,\"packet\":171,\"batt\":100,\"button1\":11,\"button2\":0,\"button3\":0,\"button4\":0}", + "{\"brand\":\"Shelly\",\"model\":\"ShellyBLU Switch4\",\"model_id\":\"SBBT-004CEU/US\",\"type\":\"BTN\",\"acts\":true,\"cont\":true,\"packet\":29,\"batt\":100,\"button1\":0,\"button2\":1,\"button3\":0,\"button4\":0}", + "{\"brand\":\"Shelly\",\"model\":\"ShellyBLU Switch4\",\"model_id\":\"SBBT-004CEU/US\",\"type\":\"BTN\",\"acts\":true,\"cont\":true,\"packet\":30,\"batt\":100,\"button1\":0,\"button2\":2,\"button3\":0,\"button4\":0}", + "{\"brand\":\"Shelly\",\"model\":\"ShellyBLU Switch4\",\"model_id\":\"SBBT-004CEU/US\",\"type\":\"BTN\",\"acts\":true,\"cont\":true,\"packet\":31,\"batt\":100,\"button1\":0,\"button2\":3,\"button3\":0,\"button4\":0}", + "{\"brand\":\"Shelly\",\"model\":\"ShellyBLU Switch4\",\"model_id\":\"SBBT-004CEU/US\",\"type\":\"BTN\",\"acts\":true,\"cont\":true,\"packet\":32,\"batt\":100,\"button1\":0,\"button2\":9,\"button3\":0,\"button4\":0}", + "{\"brand\":\"Shelly\",\"model\":\"ShellyBLU Switch4\",\"model_id\":\"SBBT-004CEU/US\",\"type\":\"BTN\",\"acts\":true,\"cont\":true,\"packet\":171,\"batt\":100,\"button1\":0,\"button2\":11,\"button3\":0,\"button4\":0}", + "{\"brand\":\"Shelly\",\"model\":\"ShellyBLU Switch4\",\"model_id\":\"SBBT-004CEU/US\",\"type\":\"BTN\",\"acts\":true,\"cont\":true,\"packet\":29,\"batt\":100,\"button1\":0,\"button2\":0,\"button3\":1,\"button4\":0}", + "{\"brand\":\"Shelly\",\"model\":\"ShellyBLU Switch4\",\"model_id\":\"SBBT-004CEU/US\",\"type\":\"BTN\",\"acts\":true,\"cont\":true,\"packet\":30,\"batt\":100,\"button1\":0,\"button2\":0,\"button3\":2,\"button4\":0}", + "{\"brand\":\"Shelly\",\"model\":\"ShellyBLU Switch4\",\"model_id\":\"SBBT-004CEU/US\",\"type\":\"BTN\",\"acts\":true,\"cont\":true,\"packet\":31,\"batt\":100,\"button1\":0,\"button2\":0,\"button3\":3,\"button4\":0}", + "{\"brand\":\"Shelly\",\"model\":\"ShellyBLU Switch4\",\"model_id\":\"SBBT-004CEU/US\",\"type\":\"BTN\",\"acts\":true,\"cont\":true,\"packet\":32,\"batt\":100,\"button1\":0,\"button2\":0,\"button3\":9,\"button4\":0}", + "{\"brand\":\"Shelly\",\"model\":\"ShellyBLU Switch4\",\"model_id\":\"SBBT-004CEU/US\",\"type\":\"BTN\",\"acts\":true,\"cont\":true,\"packet\":171,\"batt\":100,\"button1\":0,\"button2\":0,\"button3\":11,\"button4\":0}", + "{\"brand\":\"Shelly\",\"model\":\"ShellyBLU Switch4\",\"model_id\":\"SBBT-004CEU/US\",\"type\":\"BTN\",\"acts\":true,\"cont\":true,\"packet\":29,\"batt\":100,\"button1\":0,\"button2\":0,\"button3\":0,\"button4\":1}", + "{\"brand\":\"Shelly\",\"model\":\"ShellyBLU Switch4\",\"model_id\":\"SBBT-004CEU/US\",\"type\":\"BTN\",\"acts\":true,\"cont\":true,\"packet\":30,\"batt\":100,\"button1\":0,\"button2\":0,\"button3\":0,\"button4\":2}", + "{\"brand\":\"Shelly\",\"model\":\"ShellyBLU Switch4\",\"model_id\":\"SBBT-004CEU/US\",\"type\":\"BTN\",\"acts\":true,\"cont\":true,\"packet\":31,\"batt\":100,\"button1\":0,\"button2\":0,\"button3\":0,\"button4\":3}", + "{\"brand\":\"Shelly\",\"model\":\"ShellyBLU Switch4\",\"model_id\":\"SBBT-004CEU/US\",\"type\":\"BTN\",\"acts\":true,\"cont\":true,\"packet\":32,\"batt\":100,\"button1\":0,\"button2\":0,\"button3\":0,\"button4\":9}", + "{\"brand\":\"Shelly\",\"model\":\"ShellyBLU Switch4\",\"model_id\":\"SBBT-004CEU/US\",\"type\":\"BTN\",\"acts\":true,\"cont\":true,\"packet\":171,\"batt\":100,\"button1\":0,\"button2\":0,\"button3\":0,\"button4\":11}", + "{\"brand\":\"Shelly\",\"model\":\"ShellyBLU Switch4\",\"model_id\":\"SBBT-004CEU/US\",\"type\":\"BTN\",\"acts\":true,\"cont\":true,\"packet\":29,\"batt\":100,\"button1\":1,\"button2\":0,\"button3\":1,\"button4\":0}", + "{\"brand\":\"Shelly\",\"model\":\"ShellyBLU Switch4\",\"model_id\":\"SBBT-004CEU/US\",\"type\":\"BTN\",\"acts\":true,\"cont\":true,\"packet\":30,\"batt\":100,\"button1\":1,\"button2\":0,\"button3\":2,\"button4\":0}", + "{\"brand\":\"Shelly\",\"model\":\"ShellyBLU Switch4\",\"model_id\":\"SBBT-004CEU/US\",\"type\":\"BTN\",\"acts\":true,\"cont\":true,\"packet\":31,\"batt\":100,\"button1\":1,\"button2\":0,\"button3\":3,\"button4\":0}", + "{\"brand\":\"Shelly\",\"model\":\"ShellyBLU Switch4\",\"model_id\":\"SBBT-004CEU/US\",\"type\":\"BTN\",\"acts\":true,\"cont\":true,\"packet\":32,\"batt\":100,\"button1\":1,\"button2\":0,\"button3\":9,\"button4\":0}", + "{\"brand\":\"Shelly\",\"model\":\"ShellyBLU Switch4\",\"model_id\":\"SBBT-004CEU/US\",\"type\":\"BTN\",\"acts\":true,\"cont\":true,\"packet\":171,\"batt\":100,\"button1\":1,\"button2\":0,\"button3\":11,\"button4\":0}", + "{\"brand\":\"Shelly\",\"model\":\"ShellyBLU Switch4\",\"model_id\":\"SBBT-004CEU/US\",\"type\":\"BTN\",\"acts\":true,\"cont\":true,\"packet\":29,\"batt\":100,\"button1\":1,\"button2\":0,\"button3\":0,\"button4\":0}", + "{\"brand\":\"Shelly\",\"model\":\"ShellyBLU Switch4\",\"model_id\":\"SBBT-004CEU/US\",\"type\":\"BTN\",\"acts\":true,\"cont\":true,\"packet\":30,\"batt\":100,\"button1\":2,\"button2\":0,\"button3\":0,\"button4\":0}", + "{\"brand\":\"Shelly\",\"model\":\"ShellyBLU Switch4\",\"model_id\":\"SBBT-004CEU/US\",\"type\":\"BTN\",\"acts\":true,\"cont\":true,\"packet\":31,\"batt\":100,\"button1\":3,\"button2\":0,\"button3\":0,\"button4\":0}", + "{\"brand\":\"Shelly\",\"model\":\"ShellyBLU Switch4\",\"model_id\":\"SBBT-004CEU/US\",\"type\":\"BTN\",\"acts\":true,\"cont\":true,\"packet\":32,\"batt\":100,\"button1\":9,\"button2\":0,\"button3\":0,\"button4\":0}", + "{\"brand\":\"Shelly\",\"model\":\"ShellyBLU Switch4\",\"model_id\":\"SBBT-004CEU/US\",\"type\":\"BTN\",\"acts\":true,\"cont\":true,\"packet\":171,\"batt\":100,\"button1\":11,\"button2\":0,\"button3\":0,\"button4\":0}", + "{\"brand\":\"Shelly\",\"model\":\"ShellyBLU Switch4\",\"model_id\":\"SBBT-004CEU/US\",\"type\":\"BTN\",\"acts\":true,\"cont\":true,\"packet\":29,\"batt\":100,\"button1\":0,\"button2\":1,\"button3\":0,\"button4\":0}", + "{\"brand\":\"Shelly\",\"model\":\"ShellyBLU Switch4\",\"model_id\":\"SBBT-004CEU/US\",\"type\":\"BTN\",\"acts\":true,\"cont\":true,\"packet\":30,\"batt\":100,\"button1\":0,\"button2\":2,\"button3\":0,\"button4\":0}", + "{\"brand\":\"Shelly\",\"model\":\"ShellyBLU Switch4\",\"model_id\":\"SBBT-004CEU/US\",\"type\":\"BTN\",\"acts\":true,\"cont\":true,\"packet\":31,\"batt\":100,\"button1\":0,\"button2\":3,\"button3\":0,\"button4\":0}", + "{\"brand\":\"Shelly\",\"model\":\"ShellyBLU Switch4\",\"model_id\":\"SBBT-004CEU/US\",\"type\":\"BTN\",\"acts\":true,\"cont\":true,\"packet\":32,\"batt\":100,\"button1\":0,\"button2\":9,\"button3\":0,\"button4\":0}", + "{\"brand\":\"Shelly\",\"model\":\"ShellyBLU Switch4\",\"model_id\":\"SBBT-004CEU/US\",\"type\":\"BTN\",\"acts\":true,\"cont\":true,\"packet\":171,\"batt\":100,\"button1\":0,\"button2\":11,\"button3\":0,\"button4\":0}", + "{\"brand\":\"Shelly\",\"model\":\"ShellyBLU Switch4\",\"model_id\":\"SBBT-004CEU/US\",\"type\":\"BTN\",\"acts\":true,\"cont\":true,\"packet\":29,\"batt\":100,\"button1\":0,\"button2\":0,\"button3\":1,\"button4\":0}", + "{\"brand\":\"Shelly\",\"model\":\"ShellyBLU Switch4\",\"model_id\":\"SBBT-004CEU/US\",\"type\":\"BTN\",\"acts\":true,\"cont\":true,\"packet\":30,\"batt\":100,\"button1\":0,\"button2\":0,\"button3\":2,\"button4\":0}", + "{\"brand\":\"Shelly\",\"model\":\"ShellyBLU Switch4\",\"model_id\":\"SBBT-004CEU/US\",\"type\":\"BTN\",\"acts\":true,\"cont\":true,\"packet\":31,\"batt\":100,\"button1\":0,\"button2\":0,\"button3\":3,\"button4\":0}", + "{\"brand\":\"Shelly\",\"model\":\"ShellyBLU Switch4\",\"model_id\":\"SBBT-004CEU/US\",\"type\":\"BTN\",\"acts\":true,\"cont\":true,\"packet\":32,\"batt\":100,\"button1\":0,\"button2\":0,\"button3\":9,\"button4\":0}", + "{\"brand\":\"Shelly\",\"model\":\"ShellyBLU Switch4\",\"model_id\":\"SBBT-004CEU/US\",\"type\":\"BTN\",\"acts\":true,\"cont\":true,\"packet\":171,\"batt\":100,\"button1\":0,\"button2\":0,\"button3\":11,\"button4\":0}", + "{\"brand\":\"Shelly\",\"model\":\"ShellyBLU Switch4\",\"model_id\":\"SBBT-004CEU/US\",\"type\":\"BTN\",\"acts\":true,\"cont\":true,\"packet\":29,\"batt\":100,\"button1\":0,\"button2\":0,\"button3\":0,\"button4\":1}", + "{\"brand\":\"Shelly\",\"model\":\"ShellyBLU Switch4\",\"model_id\":\"SBBT-004CEU/US\",\"type\":\"BTN\",\"acts\":true,\"cont\":true,\"packet\":30,\"batt\":100,\"button1\":0,\"button2\":0,\"button3\":0,\"button4\":2}", + "{\"brand\":\"Shelly\",\"model\":\"ShellyBLU Switch4\",\"model_id\":\"SBBT-004CEU/US\",\"type\":\"BTN\",\"acts\":true,\"cont\":true,\"packet\":31,\"batt\":100,\"button1\":0,\"button2\":0,\"button3\":0,\"button4\":3}", + "{\"brand\":\"Shelly\",\"model\":\"ShellyBLU Switch4\",\"model_id\":\"SBBT-004CEU/US\",\"type\":\"BTN\",\"acts\":true,\"cont\":true,\"packet\":32,\"batt\":100,\"button1\":0,\"button2\":0,\"button3\":0,\"button4\":9}", + "{\"brand\":\"Shelly\",\"model\":\"ShellyBLU Switch4\",\"model_id\":\"SBBT-004CEU/US\",\"type\":\"BTN\",\"acts\":true,\"cont\":true,\"packet\":171,\"batt\":100,\"button1\":0,\"button2\":0,\"button3\":0,\"button4\":11}", + "{\"brand\":\"Shelly\",\"model\":\"ShellyBLU Switch4\",\"model_id\":\"SBBT-004CEU/US\",\"type\":\"BTN\",\"acts\":true,\"cont\":true,\"packet\":29,\"batt\":100,\"button1\":1,\"button2\":0,\"button3\":1,\"button4\":0}", + "{\"brand\":\"Shelly\",\"model\":\"ShellyBLU Switch4\",\"model_id\":\"SBBT-004CEU/US\",\"type\":\"BTN\",\"acts\":true,\"cont\":true,\"packet\":30,\"batt\":100,\"button1\":1,\"button2\":0,\"button3\":2,\"button4\":0}", + "{\"brand\":\"Shelly\",\"model\":\"ShellyBLU Switch4\",\"model_id\":\"SBBT-004CEU/US\",\"type\":\"BTN\",\"acts\":true,\"cont\":true,\"packet\":31,\"batt\":100,\"button1\":1,\"button2\":0,\"button3\":3,\"button4\":0}", + "{\"brand\":\"Shelly\",\"model\":\"ShellyBLU Switch4\",\"model_id\":\"SBBT-004CEU/US\",\"type\":\"BTN\",\"acts\":true,\"cont\":true,\"packet\":32,\"batt\":100,\"button1\":1,\"button2\":0,\"button3\":9,\"button4\":0}", + "{\"brand\":\"Shelly\",\"model\":\"ShellyBLU Switch4\",\"model_id\":\"SBBT-004CEU/US\",\"type\":\"BTN\",\"acts\":true,\"cont\":true,\"packet\":171,\"batt\":100,\"button1\":1,\"button2\":0,\"button3\":11,\"button4\":0}", "{\"brand\":\"Xiaomi\",\"model\":\"TH Sensor\",\"model_id\":\"LYWSD03MMC/MJWSD05MMC_PVVX_ENCR\",\"type\":\"THB\",\"encr\":1,\"cipher\":\"ef56583dd420\",\"ctr\":\"23\",\"mic\":\"50fe8e4d\"}", "{\"brand\":\"Xiaomi\",\"model\":\"TH Sensor\",\"model_id\":\"LYWSD03MMC/MJWSD05MMC_PVVX_DECR\",\"type\":\"THB\",\"tempc\":24.60,\"tempf\":76.28,\"hum\":43.54,\"batt\":100}", "{\"brand\":\"April Brother\",\"model\":\"N07\",\"model_id\":\"ABN07\",\"type\":\"THB\",\"acts\":true,\"track\":true,\"batt\":100,\"tempc\":24.51,\"tempf\":76.118,\"hum\":47.42,\"packet\":16}", @@ -830,6 +882,7 @@ TheengsDecoder::BLE_ID_NUM test_name_uuid_mfgsvcdata_id_num[]{ const char* test_name_mac_uuid_mfgsvcdata[][6] = { {"SBBT-002C", "BC:02:6E:AA:BB:CC", "SBBT-002C", "0xfcd2", "a90b0109000b01000accbbaa6e02bc", "40001d01643a01"}, {"SBBT-002C encrypted", "BC:02:6E:AA:BB:CC", "SBBT-002C", "0xfcd2", "a90b0109000b01000accbbaa6e02bc", "4562511158bd25b8f093645b573115"}, + {"SBBT-004CEU/US", "38:39:8F:71:EE:FF", "SBBT-EU", "0xfcd2", "a90b0101000b07000affee718f3938", "44001d01643a013a003a003a00"}, {"SBDW-002C", "3C:2E:F5:AA:BB:CC", "SBDW-002C", "0xfcd2", "a90b0101000b02000accbbaaf52e3c", "44005d016405fc21002d013f9601"}, {"SBDW-002C", "3C:2E:F5:AA:BB:CC", "SBDW-002C", "0xfcd2", "a90b0101000b02000accbbaaf52e3c", "440056016405e406012d003f0000"}, {"SBDW-002C encrypted", "3C:2E:F5:AA:BB:CC", "SBDW-002C", "0xfcd2", "a90b0101000b02000accbbaaf52e3c", "4538efaf00d122b4979064e971a7ed16c1644dc481fd"}, @@ -848,6 +901,7 @@ const char* test_name_mac_uuid_mfgsvcdata[][6] = { TheengsDecoder::BLE_ID_NUM test_name_mac_uuid_mfgsvcdata_id_num[]{ TheengsDecoder::BLE_ID_NUM::SBBT_002C, TheengsDecoder::BLE_ID_NUM::SBBT_002C_ENCR, + TheengsDecoder::BLE_ID_NUM::SBBT_004CEU_US, TheengsDecoder::BLE_ID_NUM::SBDW_002C, TheengsDecoder::BLE_ID_NUM::SBDW_002C, TheengsDecoder::BLE_ID_NUM::SBDW_002C_ENCR, @@ -890,13 +944,64 @@ const char* test_uuid_name_svcdata[][4] = { {"SBBT-002C triple press", "0xfcd2", "SBBT-002C", "40001f01643a03"}, {"SBBT-002C long press", "0xfcd2", "SBBT-002C", "40002001643a04"}, {"SBBT-002C press", "0xfcd2", "SBBT-002C", "4400ab01643a01"}, + {"SBBT-002C hold", "0xfcd2", "SBBT-002C", "4400ac01643afe"}, {"SBBT-002C encrypted", "0xfcd2", "SBBT-002C", "4562511158bd25b8f093645b573115"}, + {"SBBT-004CUS button1 press", "0xfcd2", "SBBT-USEEFF", "44001d01643a013a003a003a00"}, + {"SBBT-004CUS button1 double press", "0xfcd2", "SBBT-USEEFF", "44001e01643a023a003a003a00"}, + {"SBBT-004CUS button1 triple press", "0xfcd2", "SBBT-USEEFF", "44001f01643a033a003a003a00"}, + {"SBBT-004CUS button1 long press", "0xfcd2", "SBBT-USEEFF", "44002001643a043a003a003a00"}, + {"SBBT-004CUS button1 hold", "0xfcd2", "SBBT-USEEFF", "4400ab01643afe3a003a003a00"}, + {"SBBT-004CUS button2 press", "0xfcd2", "SBBT-USEEFF", "44001d01643a003a013a003a00"}, + {"SBBT-004CUS button2 double press", "0xfcd2", "SBBT-USEEFF", "44001e01643a003a023a003a00"}, + {"SBBT-004CUS button2 triple press", "0xfcd2", "SBBT-USEEFF", "44001f01643a003a033a003a00"}, + {"SBBT-004CUS button2 long press", "0xfcd2", "SBBT-USEEFF", "44002001643a003a043a003a00"}, + {"SBBT-004CUS button2 hold", "0xfcd2", "SBBT-USEEFF", "4400ab01643a003afe3a003a00"}, + {"SBBT-004CUS button3 press", "0xfcd2", "SBBT-USEEFF", "44001d01643a003a003a013a00"}, + {"SBBT-004CUS button3 double press", "0xfcd2", "SBBT-USEEFF", "44001e01643a003a003a023a00"}, + {"SBBT-004CUS button3 triple press", "0xfcd2", "SBBT-USEEFF", "44001f01643a003a003a033a00"}, + {"SBBT-004CUS button3 long press", "0xfcd2", "SBBT-USEEFF", "44002001643a003a003a043a00"}, + {"SBBT-004CUS button3 hold", "0xfcd2", "SBBT-USEEFF", "4400ab01643a003a003afe3a00"}, + {"SBBT-004CUS button4 press", "0xfcd2", "SBBT-USEEFF", "44001d01643a003a003a003a01"}, + {"SBBT-004CUS button4 double press", "0xfcd2", "SBBT-USEEFF", "44001e01643a003a003a003a02"}, + {"SBBT-004CUS button4 triple press", "0xfcd2", "SBBT-USEEFF", "44001f01643a003a003a003a03"}, + {"SBBT-004CUS button4 long press", "0xfcd2", "SBBT-USEEFF", "44002001643a003a003a003a04"}, + {"SBBT-004CUS button4 hold", "0xfcd2", "SBBT-USEEFF", "4400ab01643a003a003a003afe"}, + {"SBBT-004CUS button1 press button3 press", "0xfcd2", "SBBT-USEEFF", "44001d01643a013a003a013a00"}, + {"SBBT-004CUS button1 press button3 double press", "0xfcd2", "SBBT-USEEFF", "44001e01643a013a003a023a00"}, + {"SBBT-004CUS button1 press button3 triple press", "0xfcd2", "SBBT-USEEFF", "44001f01643a013a003a033a00"}, + {"SBBT-004CUS button1 press button3 long press", "0xfcd2", "SBBT-USEEFF", "44002001643a013a003a043a00"}, + {"SBBT-004CUS button1 press button3 hold", "0xfcd2", "SBBT-USEEFF", "4400ab01643a013a003afe3a00"}, + {"SBBT-004CEU button1 press", "0xfcd2", "SBBT-EUEEFF", "44001d01643a013a003a003a00"}, + {"SBBT-004CEU button1 double press", "0xfcd2", "SBBT-EUEEFF", "44001e01643a023a003a003a00"}, + {"SBBT-004CEU button1 triple press", "0xfcd2", "SBBT-EUEEFF", "44001f01643a033a003a003a00"}, + {"SBBT-004CEU button1 long press", "0xfcd2", "SBBT-EUEEFF", "44002001643a043a003a003a00"}, + {"SBBT-004CEU button1 hold", "0xfcd2", "SBBT-EUEEFF", "4400ab01643afe3a003a003a00"}, + {"SBBT-004CEU button2 press", "0xfcd2", "SBBT-EUEEFF", "44001d01643a003a013a003a00"}, + {"SBBT-004CEU button2 double press", "0xfcd2", "SBBT-EUEEFF", "44001e01643a003a023a003a00"}, + {"SBBT-004CEU button2 triple press", "0xfcd2", "SBBT-EUEEFF", "44001f01643a003a033a003a00"}, + {"SBBT-004CEU button2 long press", "0xfcd2", "SBBT-EUEEFF", "44002001643a003a043a003a00"}, + {"SBBT-004CEU button2 hold", "0xfcd2", "SBBT-EUEEFF", "4400ab01643a003afe3a003a00"}, + {"SBBT-004CEU button3 press", "0xfcd2", "SBBT-EUEEFF", "44001d01643a003a003a013a00"}, + {"SBBT-004CEU button3 double press", "0xfcd2", "SBBT-EUEEFF", "44001e01643a003a003a023a00"}, + {"SBBT-004CEU button3 triple press", "0xfcd2", "SBBT-EUEEFF", "44001f01643a003a003a033a00"}, + {"SBBT-004CEU button3 long press", "0xfcd2", "SBBT-EUEEFF", "44002001643a003a003a043a00"}, + {"SBBT-004CEU button3 hold", "0xfcd2", "SBBT-EUEEFF", "4400ab01643a003a003afe3a00"}, + {"SBBT-004CEU button4 press", "0xfcd2", "SBBT-EUEEFF", "44001d01643a003a003a003a01"}, + {"SBBT-004CEU button4 double press", "0xfcd2", "SBBT-EUEEFF", "44001e01643a003a003a003a02"}, + {"SBBT-004CEU button4 triple press", "0xfcd2", "SBBT-EUEEFF", "44001f01643a003a003a003a03"}, + {"SBBT-004CEU button4 long press", "0xfcd2", "SBBT-EUEEFF", "44002001643a003a003a003a04"}, + {"SBBT-004CEU button4 hold", "0xfcd2", "SBBT-EUEEFF", "4400ab01643a003a003a003afe"}, + {"SBBT-004CEU button1 press button3 press", "0xfcd2", "SBBT-EUEEFF", "44001d01643a013a003a013a00"}, + {"SBBT-004CEU button1 press button3 double press", "0xfcd2", "SBBT-EUEEFF", "44001e01643a013a003a023a00"}, + {"SBBT-004CEU button1 press button3 triple press", "0xfcd2", "SBBT-EUEEFF", "44001f01643a013a003a033a00"}, + {"SBBT-004CEU button1 press button3 long press", "0xfcd2", "SBBT-EUEEFF", "44002001643a013a003a043a00"}, + {"SBBT-004CEU button1 press button3 hold", "0xfcd2", "SBBT-EUEEFF", "4400ab01643a013a003afe3a00"}, {"LYWSD03MMC_PVVX_ENCR", "0x181a", "ATC_9C58AB", "23ef56583dd42050fe8e4d"}, {"LYWSD03MMC_PVVX_DECR", "0x181a", "ATC_89DF88", "9c0902116404"}, {"ABN07", "0xfcd2", "asensor_7F7F", "4000100164029309038612"}, {"Nutale", "0x0900", "nutale", "aabbccddeeff160100010100"}, - {"SE TEMP", "0x2a6e", "C T 999999", "1301"}, - {"SE TEMP negative","0x2a6e","C T 88888E","6afc"}, + {"SE TEMP", "0x2a6e", "C T 999999", "1301"}, + {"SE TEMP negative","0x2a6e","C T 88888E","6afc"}, {"SE RHT hum","0x2a6f","P RHT 99999A","46"}, {"SE RHT temp neg","0x2a6e","P RHT 33399T","34f8"}, {"SE TEMP temp positive","0x2a6e","P T EN 888444","7008"}, @@ -933,7 +1038,58 @@ TheengsDecoder::BLE_ID_NUM test_uuid_name_svcdata_id_num[]{ TheengsDecoder::BLE_ID_NUM::SBBT_002C, TheengsDecoder::BLE_ID_NUM::SBBT_002C, TheengsDecoder::BLE_ID_NUM::SBBT_002C, + TheengsDecoder::BLE_ID_NUM::SBBT_002C, TheengsDecoder::BLE_ID_NUM::SBBT_002C_ENCR, + TheengsDecoder::BLE_ID_NUM::SBBT_004CEU_US, + TheengsDecoder::BLE_ID_NUM::SBBT_004CEU_US, + TheengsDecoder::BLE_ID_NUM::SBBT_004CEU_US, + TheengsDecoder::BLE_ID_NUM::SBBT_004CEU_US, + TheengsDecoder::BLE_ID_NUM::SBBT_004CEU_US, + TheengsDecoder::BLE_ID_NUM::SBBT_004CEU_US, + TheengsDecoder::BLE_ID_NUM::SBBT_004CEU_US, + TheengsDecoder::BLE_ID_NUM::SBBT_004CEU_US, + TheengsDecoder::BLE_ID_NUM::SBBT_004CEU_US, + TheengsDecoder::BLE_ID_NUM::SBBT_004CEU_US, + TheengsDecoder::BLE_ID_NUM::SBBT_004CEU_US, + TheengsDecoder::BLE_ID_NUM::SBBT_004CEU_US, + TheengsDecoder::BLE_ID_NUM::SBBT_004CEU_US, + TheengsDecoder::BLE_ID_NUM::SBBT_004CEU_US, + TheengsDecoder::BLE_ID_NUM::SBBT_004CEU_US, + TheengsDecoder::BLE_ID_NUM::SBBT_004CEU_US, + TheengsDecoder::BLE_ID_NUM::SBBT_004CEU_US, + TheengsDecoder::BLE_ID_NUM::SBBT_004CEU_US, + TheengsDecoder::BLE_ID_NUM::SBBT_004CEU_US, + TheengsDecoder::BLE_ID_NUM::SBBT_004CEU_US, + TheengsDecoder::BLE_ID_NUM::SBBT_004CEU_US, + TheengsDecoder::BLE_ID_NUM::SBBT_004CEU_US, + TheengsDecoder::BLE_ID_NUM::SBBT_004CEU_US, + TheengsDecoder::BLE_ID_NUM::SBBT_004CEU_US, + TheengsDecoder::BLE_ID_NUM::SBBT_004CEU_US, + TheengsDecoder::BLE_ID_NUM::SBBT_004CEU_US, + TheengsDecoder::BLE_ID_NUM::SBBT_004CEU_US, + TheengsDecoder::BLE_ID_NUM::SBBT_004CEU_US, + TheengsDecoder::BLE_ID_NUM::SBBT_004CEU_US, + TheengsDecoder::BLE_ID_NUM::SBBT_004CEU_US, + TheengsDecoder::BLE_ID_NUM::SBBT_004CEU_US, + TheengsDecoder::BLE_ID_NUM::SBBT_004CEU_US, + TheengsDecoder::BLE_ID_NUM::SBBT_004CEU_US, + TheengsDecoder::BLE_ID_NUM::SBBT_004CEU_US, + TheengsDecoder::BLE_ID_NUM::SBBT_004CEU_US, + TheengsDecoder::BLE_ID_NUM::SBBT_004CEU_US, + TheengsDecoder::BLE_ID_NUM::SBBT_004CEU_US, + TheengsDecoder::BLE_ID_NUM::SBBT_004CEU_US, + TheengsDecoder::BLE_ID_NUM::SBBT_004CEU_US, + TheengsDecoder::BLE_ID_NUM::SBBT_004CEU_US, + TheengsDecoder::BLE_ID_NUM::SBBT_004CEU_US, + TheengsDecoder::BLE_ID_NUM::SBBT_004CEU_US, + TheengsDecoder::BLE_ID_NUM::SBBT_004CEU_US, + TheengsDecoder::BLE_ID_NUM::SBBT_004CEU_US, + TheengsDecoder::BLE_ID_NUM::SBBT_004CEU_US, + TheengsDecoder::BLE_ID_NUM::SBBT_004CEU_US, + TheengsDecoder::BLE_ID_NUM::SBBT_004CEU_US, + TheengsDecoder::BLE_ID_NUM::SBBT_004CEU_US, + TheengsDecoder::BLE_ID_NUM::SBBT_004CEU_US, + TheengsDecoder::BLE_ID_NUM::SBBT_004CEU_US, TheengsDecoder::BLE_ID_NUM::LYWSD03MMC_PVVX_ENCR, TheengsDecoder::BLE_ID_NUM::LYWSD03MMC_PVVX_DECR, TheengsDecoder::BLE_ID_NUM::ABN07,