Skip to content

Instantly share code, notes, and snippets.

@rappch1 rappch1/8 - RFU620
Last active Sep 15, 2017

Embed
What would you like to do?
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": "f3c579a1.28af18",
"type": "tab",
"label": "8 - RFU620",
"disabled": false,
"info": ""
},
{
"id": "917c30df.a06aa",
"type": "ui_template",
"z": "f3c579a1.28af18",
"group": "a662af0e.a740d",
"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": 554,
"y": 156,
"wires": [
[]
]
},
{
"id": "c3c7dc0c.ded67",
"type": "mqtt in",
"z": "f3c579a1.28af18",
"name": "lesung",
"topic": "io/cybus/energie-campus/sick/8/rfid/eg/halle/kuehlschrank/lesung",
"qos": "0",
"broker": "10e889ef.451a0e",
"x": 120,
"y": 163,
"wires": [
[
"82c41051.6ead58",
"acf237f3.341a4"
]
]
},
{
"id": "fc8e7d72.e680a",
"type": "ui_chart",
"z": "f3c579a1.28af18",
"name": "rfu_rssi_chart",
"group": "c777cd92.85a54",
"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": 554,
"y": 209,
"wires": [
[],
[]
]
},
{
"id": "bddc3824.3a94f8",
"type": "inject",
"z": "f3c579a1.28af18",
"name": "",
"topic": "",
"payload": "",
"payloadType": "date",
"repeat": "",
"crontab": "",
"once": false,
"x": 146,
"y": 255,
"wires": [
[
"610d3818.d78b1"
]
]
},
{
"id": "610d3818.d78b1",
"type": "function",
"z": "f3c579a1.28af18",
"name": "clear_chart",
"func": "msg.topic = \"Clear\";\nmsg.payload = []\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 336,
"y": 255,
"wires": [
[
"fc8e7d72.e680a"
]
]
},
{
"id": "82c41051.6ead58",
"type": "subflow:4109d1f2.c68428",
"z": "f3c579a1.28af18",
"name": "parse RFID data",
"x": 317,
"y": 162,
"wires": [
[
"917c30df.a06aa"
],
[
"fc8e7d72.e680a"
]
]
},
{
"id": "acf237f3.341a4",
"type": "debug",
"z": "f3c579a1.28af18",
"name": "",
"active": false,
"console": "false",
"complete": "false",
"x": 302.5,
"y": 80,
"wires": []
},
{
"id": "a662af0e.a740d",
"type": "ui_group",
"z": "",
"name": "Inventory",
"tab": "b3f66fb1.a066e8",
"order": 1,
"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": "c777cd92.85a54",
"type": "ui_group",
"z": "",
"name": "RSSI",
"tab": "b3f66fb1.a066e8",
"order": 2,
"disp": true,
"width": "10"
},
{
"id": "b3f66fb1.a066e8",
"type": "ui_tab",
"z": "",
"name": "8 - RFU620",
"icon": "dashboard",
"order": 8
}
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.