Instantly share code, notes, and snippets.

Embed
What would you like to do?
LED display flow that I used to test
[
{
"port": "1883",
"type": "mqtt-broker",
"id": "b30f9506.0d2cf",
"clientid": "",
"broker": "localhost"
},
{
"wires": [
[
"51fd6852.29f4"
]
],
"name": "Web Show Message",
"url": "/dispshow",
"id": "dced1939.06652",
"y": 115.77777099609375,
"x": 285.3889465332031,
"z": "c8955689.971af",
"type": "http in",
"method": "get"
},
{
"wires": [],
"qos": "",
"name": "Display Stuff",
"broker": "b30f9506.0d2cf",
"topic": "/leddisp1/show",
"x": 891.5554809570312,
"y": 220.66664123535156,
"retain": "",
"z": "c8955689.971af",
"type": "mqtt out",
"id": "5a1dac21.eb8ab4"
},
{
"wires": [],
"name": "Display show resp",
"y": 115.99995422363281,
"x": 912.4443969726562,
"z": "c8955689.971af",
"type": "http response",
"id": "2b3a66fb.60b23a"
},
{
"wires": [
[
"2b3a66fb.60b23a"
]
],
"name": "XForm",
"format": "handlebars",
"field": "payload",
"template": "<html>\n<body>\n<ul>\n<li>Requesting display of <strong>{{ payload.text }}</strong></li>\n<li>Time out set to {{ payload.timeout }} seconds.</li>\n<li>Option set to {{ payload.option }}.</li>\n</ul>\n</body>\n</html>",
"y": 115.99996948242188,
"x": 742.5554809570312,
"z": "c8955689.971af",
"type": "template",
"id": "601004f8.9b1b5c"
},
{
"wires": [
[
"5a1dac21.eb8ab4"
]
],
"name": "Serial",
"outputs": 1,
"valid": true,
"func": "msg.payload = msg.payload.timeout + \",\" + msg.payload.option + \",\" + msg.payload.text;\nreturn msg;",
"y": 220.55555725097656,
"x": 732.7777709960938,
"z": "c8955689.971af",
"type": "function",
"id": "fde251ec.03e728"
},
{
"wires": [
[
"2a0e1a9e.eedce6"
]
],
"name": "ShowClip",
"broker": "b30f9506.0d2cf",
"topic": "/showclip",
"y": 219.33335876464844,
"x": 169.33331298828125,
"z": "c8955689.971af",
"type": "mqtt in",
"id": "92f26d68.32c8"
},
{
"wires": [
[
"51fd6852.29f4"
]
],
"name": "",
"y": 219.1111602783203,
"x": 334.111083984375,
"z": "c8955689.971af",
"type": "json",
"id": "2a0e1a9e.eedce6"
},
{
"repeat": "60",
"name": "Ping",
"crontab": "",
"id": "47f62f7a.f7f28",
"topic": "",
"payloadType": "date",
"wires": [
[
"b4c51f08.e6be7"
]
],
"y": 384.2222595214844,
"x": 170.77780151367188,
"z": "c8955689.971af",
"type": "inject",
"payload": "",
"once": false
},
{
"wires": [
[
"51fd6852.29f4"
]
],
"name": "Showtime",
"outputs": 1,
"valid": true,
"func": "var d = new Date(Number(msg.payload) + 19800000);\nmsg.payload = { 'timeout' : 60, 'text' : d.getHours() + \":\" + d.getMinutes() };\nreturn msg;",
"y": 384.55548095703125,
"x": 324.4444580078125,
"z": "c8955689.971af",
"type": "function",
"id": "b4c51f08.e6be7"
},
{
"wires": [
[
"fde251ec.03e728",
"601004f8.9b1b5c"
]
],
"name": "Default settings.",
"outputs": 1,
"valid": true,
"func": "if (msg.payload.timeout === undefined)\n msg.payload.timeout = 5;\n \nif (msg.payload.option === undefined)\n msg.payload.option = 0;\n \nreturn msg;",
"y": 219.33333206176758,
"x": 533.111156463623,
"z": "c8955689.971af",
"type": "function",
"id": "51fd6852.29f4"
}
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment