McLighting/clients/node_red/websocket_proxy.json

291 lines
25 KiB
JSON
Raw Permalink Normal View History

2018-01-27 22:55:45 +01:00
[
{
"id": "60b3fe49.13b14",
"type": "tab",
"label": "McLighting Proxy",
"disabled": false,
"info": ""
},
{
"id": "30663a5b.cc72c6",
"type": "http response",
"z": "60b3fe49.13b14",
"name": "",
"x": 770,
"y": 100,
"wires": []
},
{
"id": "cc64aa0d.b17bd8",
"type": "http in",
"z": "60b3fe49.13b14",
"name": "",
"url": "/mclighting",
"method": "get",
"upload": false,
"swaggerDoc": "",
"x": 140,
"y": 100,
"wires": [
[
"2f677b34.f2b934"
]
]
},
{
"id": "2f677b34.f2b934",
"type": "template",
"z": "60b3fe49.13b14",
"name": "Simple Web Page",
"field": "payload",
"fieldType": "msg",
"format": "html",
"syntax": "mustache",
"template": "\n<!DOCTYPE html>\n<html>\n\t<head>\n\t\t<!--Import Google Icon Font-->\n\t\t<link href=\"http://fonts.googleapis.com/icon?family=Material+Icons\" rel=\"stylesheet\">\n\t\t<!--Import materialize.css-->\n\t\t<link rel=\"stylesheet\" href=\"https://cdnjs.cloudflare.com/ajax/libs/materialize/0.100.2/css/materialize.min.css\" media=\"screen,projection\" />\n\n\t\t<!--Let browser know website is optimized for mobile-->\n\t\t<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0, user-scalable=no\"/>\n\t\t<meta charset=\"utf-8\"/>\n\t\t<title>McLighting v2</title>\n\t</head>\n\n\t<body>\n\t\t<nav class=\"blue light-blueXXX lighten-1XXX\" role=\"navigation\" id=\"mc-nav\">\n\t\t\t<div class=\"nav-wrapper container\">\n\t\t\t\t<a id=\"logo-container\" href=\"#\" class=\"brand-logo\">Mc Lighting v2</a>\n\n\t\t\t\t<ul class=\"right hide-on-med-and-down\">\n\t\t\t\t\t<li><a href=\"#\" class=\"mc-navlink\" data-pane=\"pane1\">Wheel</a></li>\n\t\t\t\t\t<li><a href=\"#\" class=\"mc-navlink\" data-pane=\"pane2\">Modes</a></li>\n\t\t\t\t</ul>\n\n\t\t\t\t<ul id=\"nav-mobile\" class=\"side-nav\">\n\t\t\t\t\t<li><a href=\"#\" class=\"mc-navlink\" data-pane=\"pane1\">Wheel</a></li>\n\t\t\t\t\t<li><a href=\"#\" class=\"mc-navlink\" data-pane=\"pane2\">Modes</a></li>\n\t\t\t\t</ul>\n\t\t\t\t<a href=\"#\" data-activates=\"nav-mobile\" class=\"button-collapse\"><i class=\"material-icons\">menu</i></a>\n\t\t\t</div>\n\t\t</nav>\n\t\t\n\t\t<div class=\"container mc_pane\" id=\"pane0\">\n\t\t\t<div class=\"section\">\n\t\t\t\t<div class=\"row\" id=\"mc-wsloader\">\n\t\t\t\t\t<div class=\"col\">\n\t\t\t\t\t\t<div class=\"preloader-wrapper active\">\n\t\t\t\t\t\t\t<div class=\"spinner-layer spinner-blue-only\">\n\t\t\t\t\t\t\t\t<div class=\"circle-clipper left\">\n\t\t\t\t\t\t\t\t\t<div class=\"circle\"></div>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t<div class=\"gap-patch\">\n\t\t\t\t\t\t\t\t\t<div class=\"circle\"></div>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t<div class=\"circle-clipper right\">\n\t\t\t\t\t\t\t\t\t<div class=\"circle\"></div>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t<div class=\"row hide\" id=\"mc-wserror\">\n\t\t\t\t\t<div class=\"col\">\n\t\t\t\t\t\t<div>Error on websocket connect.</div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t\t\n\t\t<div class=\"container mc_pane hide\" id=\"pane1\">\n\t\t\t<div class=\"section\">\n\t\t\t\t<div class=\"row\">\n\t\t\t\t\t<div class=\"col s12 m6\">\n\t\t\t\t\t\t<div style=\"height: 330px; width: 330px;\">\n\t\t\t\t\t\t\t<canvas id=\"myCanvas\" width=\"330\" height=\"330\" style=\"-webkit-user-select: none;-webkit-tap-highlight-color: rgba(0,0,0,0);-moz-user-select:none;\"></canvas>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class=\"col s12 m6\">\n\t\t\t\t\t\t<div class=\"card-panel\" id=\"status\">\n\t\t\t\t\t\t\t<div id=\"status_pos\">pick a color</div>\n\t\t\t\t\t\t\t<div id=\"status_color\"></div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class=\"col s12 m6\">\n\t\t\t\t\t\t<div class=\"right switch\">Auto:<br>\n\t\t\t\t\t\t\t<label>Off \n\t\t\t\t\t\t\t\t<input id=\"autoSwitch\" type=\"checkbox\"><span class=\"lever\"></span>On \n\t\t\t\t\t\t\t</label>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t\t\n\t\t<div class=\"container mc_pane hide\" id=\"pane2\">\n\t\t\t<div class=\"section\">\n\t\t\t\t<div class=\"row\">\n\t\t\t\t\t<form class=\"col s12\">\n\t\t\t\t\t\t<div class=\"row\">\n\t\t\t\t\t\t\t<div class=\"input-field col s12 l4\">\n\t\t\t\t\t\t\t\t<label for=\"txt_red\">Red</label><br/>\n\t\t\t\t\t\t\t\t<p class=\"range-field\"><input type=\"range\" id=\"rng_red\" min=\"0\" max=\"255\" class=\"update_colors\" /></p>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<div class=\"input-field col s12 l4\">\n\t\t\t\t\t\t\t\t<label for=\"txt_green\">Green</label><br/>\n\t\t\t\t\t\t\t\t<p class=\"range-field\"><input type=\"range\" id=\"rng_green\" min=\"0\" max=\"255\" class=\"update_colors\" /></p>\n\t\t\t\t\t\t\t</d
"x": 470,
"y": 100,
"wires": [
[
"30663a5b.cc72c6"
]
]
},
{
"id": "c9b17f3b.9dff8",
"type": "websocket in",
"z": "60b3fe49.13b14",
"name": "",
"server": "566e6e2.291cd9",
"client": "",
"x": 150,
"y": 320,
"wires": [
[
"269d49ad.a76b86",
"290609d3.6278b6"
]
]
},
{
"id": "269d49ad.a76b86",
"type": "debug",
"z": "60b3fe49.13b14",
"name": "",
"active": true,
"console": "false",
"complete": "true",
"x": 770,
"y": 320,
"wires": []
},
{
"id": "c919144e.a042d8",
"type": "websocket out",
"z": "60b3fe49.13b14",
"name": "McLighting MASTER",
"server": "",
"client": "76c1e2a2.260edc",
"x": 720,
"y": 360,
"wires": []
},
{
"id": "290609d3.6278b6",
"type": "change",
"z": "60b3fe49.13b14",
"name": "",
"rules": [
{
"t": "delete",
"p": "_session",
"pt": "msg"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 420,
"y": 360,
"wires": [
[
"c919144e.a042d8",
"66d9365b.ea4678"
]
]
},
{
"id": "34867cb8.1e90c4",
"type": "websocket in",
"z": "60b3fe49.13b14",
"name": "McLighting MASTER",
"server": "",
"client": "76c1e2a2.260edc",
"x": 150,
"y": 540,
"wires": [
[
"895c4072.f2c8b",
"476937ec.2e6bc8"
]
]
},
{
"id": "895c4072.f2c8b",
"type": "debug",
"z": "60b3fe49.13b14",
"name": "",
"active": false,
"console": "false",
"complete": "true",
"x": 770,
"y": 540,
"wires": []
},
{
"id": "60647cef.9d1b84",
"type": "websocket out",
"z": "60b3fe49.13b14",
"name": "",
"server": "566e6e2.291cd9",
"client": "",
"x": 730,
"y": 620,
"wires": []
},
{
"id": "476937ec.2e6bc8",
"type": "change",
"z": "60b3fe49.13b14",
"name": "",
"rules": [
{
"t": "delete",
"p": "_session",
"pt": "msg"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 440,
"y": 580,
"wires": [
[
"60647cef.9d1b84"
]
]
},
{
"id": "66d9365b.ea4678",
"type": "websocket out",
"z": "60b3fe49.13b14",
"name": "McLighting SLAVE 1",
"server": "",
"client": "a3ea760c.37e1c8",
"x": 720,
"y": 400,
"wires": []
},
{
"id": "78a93dec.7bbd84",
"type": "template",
"z": "60b3fe49.13b14",
"name": "Modes list",
"field": "payload",
"fieldType": "msg",
"format": "handlebars",
"syntax": "plain",
"template": "[{\"mode\":0, \"name\":\"Static\"},{\"mode\":1, \"name\":\"Blink\"},{\"mode\":2, \"name\":\"Breath\"},{\"mode\":3, \"name\":\"Color Wipe\"},{\"mode\":4, \"name\":\"Color Wipe Inverse\"},{\"mode\":5, \"name\":\"Color Wipe Reverse\"},{\"mode\":6, \"name\":\"Color Wipe Reverse Inverse\"},{\"mode\":7, \"name\":\"Color Wipe Random\"},{\"mode\":8, \"name\":\"Random Color\"},{\"mode\":9, \"name\":\"Single Dynamic\"},{\"mode\":10, \"name\":\"Multi Dynamic\"},{\"mode\":11, \"name\":\"Rainbow\"},{\"mode\":12, \"name\":\"Rainbow Cycle\"},{\"mode\":13, \"name\":\"Scan\"},{\"mode\":14, \"name\":\"Dual Scan\"},{\"mode\":15, \"name\":\"Fade\"},{\"mode\":16, \"name\":\"Theater Chase\"},{\"mode\":17, \"name\":\"Theater Chase Rainbow\"},{\"mode\":18, \"name\":\"Running Lights\"},{\"mode\":19, \"name\":\"Twinkle\"},{\"mode\":20, \"name\":\"Twinkle Random\"},{\"mode\":21, \"name\":\"Twinkle Fade\"},{\"mode\":22, \"name\":\"Twinkle Fade Random\"},{\"mode\":23, \"name\":\"Sparkle\"},{\"mode\":24, \"name\":\"Flash Sparkle\"},{\"mode\":25, \"name\":\"Hyper Sparkle\"},{\"mode\":26, \"name\":\"Strobe\"},{\"mode\":27, \"name\":\"Strobe Rainbow\"},{\"mode\":28, \"name\":\"Multi Strobe\"},{\"mode\":29, \"name\":\"Blink Rainbow\"},{\"mode\":30, \"name\":\"Chase White\"},{\"mode\":31, \"name\":\"Chase Color\"},{\"mode\":32, \"name\":\"Chase Random\"},{\"mode\":33, \"name\":\"Chase Rainbow\"},{\"mode\":34, \"name\":\"Chase Flash\"},{\"mode\":35, \"name\":\"Chase Flash Random\"},{\"mode\":36, \"name\":\"Chase Rainbow White\"},{\"mode\":37, \"name\":\"Chase Blackout\"},{\"mode\":38, \"name\":\"Chase Blackout Rainbow\"},{\"mode\":39, \"name\":\"Color Sweep Random\"},{\"mode\":40, \"name\":\"Running Color\"},{\"mode\":41, \"name\":\"Running Red Blue\"},{\"mode\":42, \"name\":\"Running Random\"},{\"mode\":43, \"name\":\"Larson Scanner\"},{\"mode\":44, \"name\":\"Comet\"},{\"mode\":45, \"name\":\"Fireworks\"},{\"mode\":46, \"name\":\"Fireworks Random\"},{\"mode\":47, \"name\":\"Merry Christmas\"},{\"mode\":48, \"name\":\"Fire Flicker\"},{\"mode\":49, \"name\":\"Fire Flicker (soft)\"},{\"mode\":50, \"name\":\"Fire Flicker (intense)\"},{\"mode\":51, \"name\":\"Circus Combustus\"},{\"mode\":52, \"name\":\"Halloween\"},{\"mode\":53, \"name\":\"Bicolor Chase\"},{\"mode\":54, \"name\":\"Tricolor Chase\"},{\"mode\":55, \"name\":\"ICU\"},{}]",
"output": "str",
"x": 470,
"y": 160,
"wires": [
[
"8639e406.b82e38"
]
]
},
{
"id": "7cc35600.dc2558",
"type": "http in",
"z": "60b3fe49.13b14",
"name": "",
"url": "/get_modes",
"method": "get",
"upload": false,
"swaggerDoc": "",
"x": 140,
"y": 160,
"wires": [
[
"78a93dec.7bbd84"
]
]
},
{
"id": "8639e406.b82e38",
"type": "http response",
"z": "60b3fe49.13b14",
"name": "",
"statusCode": "",
"headers": {},
"x": 770,
"y": 160,
"wires": []
},
{
"id": "e1ce7b73.d32078",
"type": "comment",
"z": "60b3fe49.13b14",
"name": "HTTP server for the McLighting web page / modes list",
"info": "These is mainly the original source code from McLighting, just the endpoint were patched so that they match with Node Red.\nWeb page listens on http://<node_red_url>/mclighting",
"x": 260,
"y": 60,
"wires": []
},
{
"id": "84c92c41.eb3a9",
"type": "comment",
"z": "60b3fe49.13b14",
"name": "Websocket Input -> split to multiple McLighting nodes",
"info": "You can output the message to multiple McLighting Nodes. \nJust add websocket output nodes for each McLighting.",
"x": 260,
"y": 280,
"wires": []
},
{
"id": "776ca012.6f1d4",
"type": "comment",
"z": "60b3fe49.13b14",
"name": "Websocket Output --> Get return value from MASTER and echo to web page",
"info": "",
"x": 330,
"y": 500,
"wires": []
},
{
"id": "566e6e2.291cd9",
"type": "websocket-listener",
"z": "60b3fe49.13b14",
"path": "/mclighting/ws",
"wholemsg": "false"
},
{
"id": "76c1e2a2.260edc",
"type": "websocket-client",
"z": "",
"path": "ws://192.168.0.49:81",
"wholemsg": "false"
},
{
"id": "a3ea760c.37e1c8",
"type": "websocket-client",
"z": "",
"path": "ws://192.168.0.64:81/",
"wholemsg": "false"
}
]