Skip to content

Commit

Permalink
files
Browse files Browse the repository at this point in the history
  • Loading branch information
DigiH committed Feb 16, 2024
1 parent a94dadb commit 229151c
Show file tree
Hide file tree
Showing 2 changed files with 72 additions and 0 deletions.
13 changes: 13 additions & 0 deletions docs/devices/NODONNIU.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# NodOn NIU smart button

|Model Id|[NODONNIU](https://github.com/theengs/decoder/blob/development/src/devices/NODONNIU_json.h)|
|-|-|
|Brand|NodOn|
|Model|NIU smart button|
|Short Description|Bluetooth smart button|
|Communication|BLE broadcast|
|Frequency|2.4Ghz|
|Power Source|CR2032|
|Exchanged Data|button, color, battery|
|Encrypted|No|
|Device Tracker|✅|
59 changes: 59 additions & 0 deletions src/devices/NODONNIU_json.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
const char* _NODONNIU_json = "{\"brand\":\"NodOn\",\"model\":\"NIU smart button\",\"model_id\":\"NODONNIU\",\"tag\":\"110e\",\"condition\":[\"servicedata\",\"=\",32,\"&\",\"uuid\",\"index\",0,\"0000\"],\"properties\":{\"button\":{\"decoder\":[\"string_from_hex_data\",\"servicedata\",30,2],\"lookup\":[\"01\",\"short click\",\"02\",\"double click\",\"03\",\"long press\",\"04\",\"button release\",\"05\",\"triple click\",\"06\",\"quadruple click\",\"07\",\"quintuple click\"]},\"color\":{\"decoder\":[\"string_from_hex_data\",\"servicedata\",20,4],\"lookup\":[\"0002\",\"White\",\"0003\",\"TechBlue\",\"0004\",\"CozyGrey\",\"0005\",\"Wazabi\",\"0006\",\"Lagoon\",\"0007\",\"Softberry\"]},\"batt\":{\"decoder\":[\"value_from_hex_data\",\"servicedata\",24,2,false,false],\"post_proc\":[\"&\",127]}}}";

/*
R""""(
{
"brand":"NodOn",
"model":"NIU smart button",
"model_id":"NODONNIU",
"tag":"110e",
"condition":["servicedata", "=", 32, "&", "uuid", "index", 0, "0000"],
"properties":{
"button":{
"decoder":["string_from_hex_data", "servicedata", 30, 2],
"lookup":["01", "short click",
"02", "double click",
"03", "long press",
"04", "button release",
"05", "triple click",
"06", "quadruple click",
"07", "quintuple click"]
},
"color":{
"decoder":["string_from_hex_data", "servicedata", 20, 4],
"lookup":["0002", "White",
"0003", "TechBlue",
"0004", "CozyGrey",
"0005", "Wazabi",
"0006", "Lagoon",
"0007", "Softberry"]
},
"batt":{
"decoder":["value_from_hex_data", "servicedata", 24, 2, false, false],
"post_proc":["&", 127]
}
}
})"""";
*/

const char* _NODONNIU_json_props = "{\"properties\":{\"button\":{\"unit\":\"string\",\"name\":\"button\"},\"color\":{\"unit\":\"string\",\"name\":\"color\"},\"batt\":{\"unit\":\"%\",\"name\":\"battery\"}}}";

/*
R""""(
{
"properties": {
"button":{
"unit":"string",
"name":"button"
},
"color":{
"unit":"string",
"name":"color"
},
"batt":{
"unit":"%",
"name":"battery"
}
}
})"""";
*/

0 comments on commit 229151c

Please sign in to comment.