Skip to content

Commit

Permalink
Onset Hobo Water Level Sensor (#561)
Browse files Browse the repository at this point in the history
Onset Hobo Water Level Sensor - level only decoding with initial submission
  • Loading branch information
DigiH authored Sep 5, 2024
1 parent 9856916 commit 73702ba
Show file tree
Hide file tree
Showing 5 changed files with 59 additions and 0 deletions.
12 changes: 12 additions & 0 deletions docs/devices/HOBOMX2001.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Onset Hobo Water Level Sensor

|Model Id|[MX2001](https://github.com/theengs/decoder/blob/development/src/devices/HOBOMX2001_json.h)|
|-|-|
|Brand|Onset|
|Model|Hobo Water Level Sensor|
|Short Description|Water Tank level sensor|
|Communication|BLE broadcast|
|Frequency|2.4Ghz|
|Power Source|2 AA|
|Exchanged Data|level|
|Encrypted|No|
1 change: 1 addition & 0 deletions src/decoder.h
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ class TheengsDecoder {
FEASY,
GAEN,
HHCCPOT002,
HOBOMX2001,
BPARASITE,
BWBSDOO,
BM2,
Expand Down
2 changes: 2 additions & 0 deletions src/devices.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
#include "devices/HHCCJCY10_json.h"
#include "devices/HHCCJCY01HHCC_json.h"
#include "devices/HHCCPOT002_json.h"
#include "devices/HOBOMX2001_json.h"
#include "devices/IBS_THBP01B_json.h"
#include "devices/IBT_2X_json.h"
#include "devices/IBT_4XS_json.h"
Expand Down Expand Up @@ -191,6 +192,7 @@ const char* _devices[][2] = {
{_FEASY_json, _FEASY_json_props},
{_GAEN_json, _GAEN_json_props},
{_HHCCPOT002_json, _HHCCPOT002_json_props},
{_HOBOMX2001_json, _HOBOMX2001_json_props},
{_BPARASITE_json, _BPARASITE_json_props},
{_BWBSDOO_json, _BWBSDOO_json_props},
{_BM2_json, _BM2_json_props},
Expand Down
26 changes: 26 additions & 0 deletions src/devices/HOBOMX2001_json.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
const char* _HOBOMX2001_json = "{\"brand\":\"Onset\",\"model\":\"Hobo Water Level Sensor\",\"model_id\":\"HOBOMX2001\",\"tag\":\"ff\",\"condition\":[\"manufacturerdata\",\"=\",44,\"index\",0,\"c500\"],\"properties\":{\"lvl_cm\":{\"decoder\":[\"value_from_hex_data\",\"manufacturerdata\",36,8,true,false,true],\"post_proc\":[\"*\",100]}}}";
/* R""""(
{
"brand":"Onset",
"model":"Hobo Water Level Sensor",
"model_id":"HOBOMX2001",
"tag":"ff",
"condition":["manufacturerdata", "=", 44, "index", 0, "c500"],
"properties":{
"lvl_cm":{
"decoder":["value_from_hex_data", "manufacturerdata", 36, 8, true, false, true],
"post_proc":["*", 100]
}
}
})"""";*/

const char* _HOBOMX2001_json_props = "{\"properties\":{\"lvl_cm\":{\"unit\":\"cm\",\"name\":\"distance\"}}}";
/*R""""(
{
"properties":{
"lvl_cm":{
"unit":"cm",
"name":"distance"
}
}
})"""";*/
18 changes: 18 additions & 0 deletions tests/BLE/test_ble.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,12 @@ const char* expected_mfg[] = {
"{\"brand\":\"Otodata\",\"model\":\"Rotarex-compatible Monitor\",\"model_id\":\"RC1010\",\"type\":\"UNIQ\",\"serial\":56001608,\"modeltype\":67367466}",
"{\"brand\":\"Tile\",\"model\":\"Smart Tracker\",\"model_id\":\"TILE\",\"type\":\"TRACK\",\"cidc\":false,\"acts\":true,\"track\":true,\"device\":\"Tile Tracker\"}",
"{\"brand\":\"Bosch\",\"model\":\"Nyon\",\"model_id\":\"BOSCHNYON\",\"type\":\"TRACK\",\"acts\":true,\"track\":true,\"device\":\"Bosch Nyon Tracker\"}",
"{\"brand\":\"Onset\",\"model\":\"Hobo Water Level Sensor\",\"model_id\":\"HOBOMX2001\",\"type\":\"UNIQ\",\"lvl_cm\":9.913735837,\"lvl_in\":3.903045605}",
"{\"brand\":\"Onset\",\"model\":\"Hobo Water Level Sensor\",\"model_id\":\"HOBOMX2001\",\"type\":\"UNIQ\",\"lvl_cm\":29.39415574,\"lvl_in\":11.57250226}",
"{\"brand\":\"Onset\",\"model\":\"Hobo Water Level Sensor\",\"model_id\":\"HOBOMX2001\",\"type\":\"UNIQ\",\"lvl_cm\":11.21081784,\"lvl_in\":4.413707812}",
"{\"brand\":\"Onset\",\"model\":\"Hobo Water Level Sensor\",\"model_id\":\"HOBOMX2001\",\"type\":\"UNIQ\",\"lvl_cm\":6.646526605,\"lvl_in\":2.616742758}",
"{\"brand\":\"Onset\",\"model\":\"Hobo Water Level Sensor\",\"model_id\":\"HOBOMX2001\",\"type\":\"UNIQ\",\"lvl_cm\":8.46760273,\"lvl_in\":3.333701862}",
"{\"brand\":\"Onset\",\"model\":\"Hobo Water Level Sensor\",\"model_id\":\"HOBOMX2001\",\"type\":\"UNIQ\",\"lvl_cm\":9.514185786,\"lvl_in\":3.745742436}",
};

const char* expected_name_uuid_mfgsvcdata[] = {
Expand Down Expand Up @@ -599,6 +605,12 @@ const char* test_mfgdata[][3] = {
{"Otodata RC1010", "", "b1034f544f3332383148845603132111010400022af20304"},
{"Tile Name", "Tile", ""},
{"Bosch Nyon", "Nyon-XXX", "a60210eb002500"},
{"Hobo Water Level", "", "c5000740d54f01062402000008005231029e8708cb3d"},
{"Hobo Water Level", "", "c5000740d54f01062402000008001229029d827f963e"},
{"Hobo Water Level", "", "c500073fd54f0106240200000800125302a0f998e53d"},
{"Hobo Water Level", "", "c500073fd54f01062402000008005235019ff11e883d"},
{"Hobo Water Level", "", "c500073fd54f0106240000000800529501a0a06aad3d"},
{"Hobo Water Level", "", "c500073fd54f010624000000080092a901a0bcd9c23d"},
};

TheengsDecoder::BLE_ID_NUM test_mfgdata_id_num[]{
Expand Down Expand Up @@ -743,6 +755,12 @@ TheengsDecoder::BLE_ID_NUM test_mfgdata_id_num[]{
TheengsDecoder::BLE_ID_NUM::OTOD,
TheengsDecoder::BLE_ID_NUM::TILEN,
TheengsDecoder::BLE_ID_NUM::BOSCHNYON,
TheengsDecoder::BLE_ID_NUM::HOBOMX2001,
TheengsDecoder::BLE_ID_NUM::HOBOMX2001,
TheengsDecoder::BLE_ID_NUM::HOBOMX2001,
TheengsDecoder::BLE_ID_NUM::HOBOMX2001,
TheengsDecoder::BLE_ID_NUM::HOBOMX2001,
TheengsDecoder::BLE_ID_NUM::HOBOMX2001,
};

// uuid test input [test name] [device name] [uuid] [manufacturer data] [service data]
Expand Down

0 comments on commit 73702ba

Please sign in to comment.