Skip to content

Instantly share code, notes, and snippets.

@rappch1
Last active September 15, 2017 19:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rappch1/fe3bde8570801788e93e67f1bb5e87ab to your computer and use it in GitHub Desktop.
Save rappch1/fe3bde8570801788e93e67f1bb5e87ab to your computer and use it in GitHub Desktop.
WhatTheData 2017: Real SICK Data
[
{
"id": "4109d1f2.c68428",
"type": "subflow",
"name": "parseRFIDdata",
"info": "",
"in": [
{
"x": 81,
"y": 129,
"wires": [
{
"id": "2288411e.d406e6"
}
]
}
],
"out": [
{
"x": 611,
"y": 127,
"wires": [
{
"id": "c4f0cebb.267eb8",
"port": 0
}
]
},
{
"x": 612,
"y": 201,
"wires": [
{
"id": "304d0652.4eddba",
"port": 0
}
]
}
]
},
{
"id": "c4f0cebb.267eb8",
"type": "function",
"z": "4109d1f2.c68428",
"name": "sort",
"func": "msg.payload.tags.sort(function (a, b) {\n return (a.uii < b.uii) ? -1 : 1 \n})\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 363,
"y": 127,
"wires": [
[
"304d0652.4eddba"
]
]
},
{
"id": "304d0652.4eddba",
"type": "function",
"z": "4109d1f2.c68428",
"name": "prepare output for chart",
"func": "var input = msg.payload;\n\nfor (i = 0; i < input.tags.length; i++) {\n //node.send({payload: input.tags[i].rssi + 100, topic: input.tags[i].uii});\n \n var uii = input.tags[i].uii;\n node.send({payload: input.tags[i].rssi + 100, topic: uii.substr(uii.length - 3, 3)});\n}\n\nreturn",
"outputs": 1,
"noerr": 0,
"x": 423,
"y": 201,
"wires": [
[]
]
},
{
"id": "2288411e.d406e6",
"type": "json",
"z": "4109d1f2.c68428",
"name": "",
"pretty": false,
"x": 199,
"y": 129,
"wires": [
[
"c4f0cebb.267eb8"
]
]
},
{
"id": "1fe45634.0ea792",
"type": "tab",
"label": "10 - RFU620",
"disabled": false,
"info": ""
},
{
"id": "bc392feb.b910c",
"type": "ui_template",
"z": "1fe45634.0ea792",
"group": "2b907687.57655a",
"name": "",
"order": 3,
"width": "6",
"height": "10",
"format": "<div>\n <ul style=\"list-style: none; padding-left: 0px;\" ng-repeat=\"tag in msg.payload.tags\">\n <li>\n Uii: {{tag.uii}}\n <!-- <div style=\"background: rgb(0, 148, 206); padding: 2px; color: white; width: {{tag.rssi / 100 * 20}}%\">{{tag.rssi}}</div> -->\n </li>\n </ul>\n</div>",
"storeOutMessages": true,
"fwdInMessages": true,
"templateScope": "local",
"x": 527,
"y": 180,
"wires": [
[]
]
},
{
"id": "74ecd9c1.6afa68",
"type": "mqtt in",
"z": "1fe45634.0ea792",
"name": "lesung",
"topic": "io/cybus/energie-campus/sick/10/rfid/eg/treppe/lesung",
"qos": "0",
"broker": "10e889ef.451a0e",
"x": 78,
"y": 180,
"wires": [
[
"974dc2c.03b794"
]
]
},
{
"id": "b70a311f.fdeeb8",
"type": "ui_chart",
"z": "1fe45634.0ea792",
"name": "rfu_rssi_chart",
"group": "c0051ca7.b8c1f8",
"order": 0,
"width": "10",
"height": "10",
"label": "[relative]",
"chartType": "horizontalBar",
"legend": "false",
"xformat": "HH:mm:ss",
"interpolate": "linear",
"nodata": "",
"dot": false,
"ymin": "0",
"ymax": "60",
"removeOlder": 1,
"removeOlderPoints": "",
"removeOlderUnit": "3600",
"cutout": 0,
"useOneColor": false,
"colors": [
"#1f77b4",
"#aec7e8",
"#ff7f0e",
"#2ca02c",
"#98df8a",
"#d62728",
"#ff9896",
"#9467bd",
"#c5b0d5"
],
"x": 549,
"y": 263,
"wires": [
[],
[]
]
},
{
"id": "617345df.881a9c",
"type": "inject",
"z": "1fe45634.0ea792",
"name": "",
"topic": "",
"payload": "",
"payloadType": "date",
"repeat": "",
"crontab": "",
"once": false,
"x": 120,
"y": 261,
"wires": [
[
"19a687e0.c55c08"
]
]
},
{
"id": "19a687e0.c55c08",
"type": "function",
"z": "1fe45634.0ea792",
"name": "clear_chart",
"func": "msg.topic = \"Clear\";\nmsg.payload = []\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 330,
"y": 263,
"wires": [
[
"b70a311f.fdeeb8"
]
]
},
{
"id": "974dc2c.03b794",
"type": "subflow:4109d1f2.c68428",
"z": "1fe45634.0ea792",
"name": "parse RFID data",
"x": 310,
"y": 180,
"wires": [
[
"bc392feb.b910c"
],
[
"b70a311f.fdeeb8"
]
]
},
{
"id": "2b907687.57655a",
"type": "ui_group",
"z": "",
"name": "Inventory",
"tab": "bbf12edb.0bbc4",
"disp": true,
"width": "6"
},
{
"id": "10e889ef.451a0e",
"type": "mqtt-broker",
"z": "",
"broker": "energie-campus.cybus.io",
"port": "1883",
"clientid": "",
"usetls": false,
"verifyservercert": true,
"compatmode": true,
"keepalive": "15",
"cleansession": true,
"willTopic": "",
"willQos": "0",
"willRetain": "false",
"willPayload": "",
"birthTopic": "",
"birthQos": "0",
"birthRetain": "false",
"birthPayload": ""
},
{
"id": "c0051ca7.b8c1f8",
"type": "ui_group",
"z": "",
"name": "RSSI",
"tab": "bbf12edb.0bbc4",
"disp": true,
"width": "10"
},
{
"id": "bbf12edb.0bbc4",
"type": "ui_tab",
"z": "",
"name": "10 - RFU620",
"icon": "dashboard",
"order": 10
}
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment