Skip to content

Instantly share code, notes, and snippets.

@rappch1 rappch1/4 - RFU630
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": "41f1c813.72a048",
"type": "tab",
"label": "4 - RFU630",
"disabled": false,
"info": ""
},
{
"id": "fe41d1c9.36ef6",
"type": "ui_template",
"z": "41f1c813.72a048",
"group": "1ee5331.f9b1fcd",
"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": 597,
"y": 199,
"wires": [
[]
]
},
{
"id": "a3a688c7.8c298",
"type": "mqtt in",
"z": "41f1c813.72a048",
"name": "lesung",
"topic": "io/cybus/energie-campus/sick/4/rfid/og/buero/lesung",
"qos": "0",
"broker": "10e889ef.451a0e",
"x": 131,
"y": 199,
"wires": [
[
"d8e18993.4785a",
"7584d9f5.bf44d8"
]
]
},
{
"id": "77446dc2.44b7e4",
"type": "ui_chart",
"z": "41f1c813.72a048",
"name": "rfu_rssi_chart",
"group": "fe09aabd.a68d1",
"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": 617,
"y": 246,
"wires": [
[],
[]
]
},
{
"id": "7f792575.a02fdc",
"type": "inject",
"z": "41f1c813.72a048",
"name": "",
"topic": "",
"payload": "",
"payloadType": "str",
"repeat": "",
"crontab": "",
"once": false,
"x": 230,
"y": 292,
"wires": [
[
"2773fa27.942d06"
]
]
},
{
"id": "2773fa27.942d06",
"type": "function",
"z": "41f1c813.72a048",
"name": "clear_chart",
"func": "msg.topic = \"Clear\";\nmsg.payload = []\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 399,
"y": 292,
"wires": [
[
"77446dc2.44b7e4"
]
]
},
{
"id": "d8e18993.4785a",
"type": "subflow:4109d1f2.c68428",
"z": "41f1c813.72a048",
"name": "parse RFID data",
"x": 380,
"y": 199,
"wires": [
[
"fe41d1c9.36ef6"
],
[
"77446dc2.44b7e4"
]
]
},
{
"id": "7584d9f5.bf44d8",
"type": "debug",
"z": "41f1c813.72a048",
"name": "",
"active": false,
"console": "false",
"complete": "false",
"x": 383,
"y": 142,
"wires": []
},
{
"id": "1ee5331.f9b1fcd",
"type": "ui_group",
"z": "",
"name": "Inventory",
"tab": "14bea08a.4ba377",
"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": "fe09aabd.a68d1",
"type": "ui_group",
"z": "",
"name": "RSSI",
"tab": "14bea08a.4ba377",
"disp": true,
"width": "10"
},
{
"id": "14bea08a.4ba377",
"type": "ui_tab",
"z": "",
"name": "4 - RFU630",
"icon": "dashboard",
"order": 4
}
]
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.