Created
February 23, 2018 17:55
-
-
Save ralphcrutzen/84e450f2507a94ae2bb0456efed02a77 to your computer and use it in GitHub Desktop.
Tinkerlicht Node-RED flow voor PCM
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ | |
"id": "ac9cc49f.035a", | |
"type": "tab", | |
"label": "Tinkerlicht", | |
"disabled": false, | |
"info": "" | |
}, | |
{ | |
"id": "33f0c10e.a98376", | |
"type": "debug", | |
"z": "ac9cc49f.035a", | |
"name": "", | |
"active": true, | |
"tosidebar": true, | |
"console": false, | |
"tostatus": false, | |
"complete": "true", | |
"x": 210, | |
"y": 100, | |
"wires": [] | |
}, | |
{ | |
"id": "e3b3ac.42db9458", | |
"type": "camerapi-takephoto", | |
"z": "ac9cc49f.035a", | |
"filemode": "0", | |
"filename": "", | |
"filedefpath": "1", | |
"filepath": "", | |
"fileformat": "jpeg", | |
"resolution": "1", | |
"rotation": "0", | |
"fliph": "0", | |
"flipv": "0", | |
"brightness": "50", | |
"contrast": "0", | |
"sharpness": "0", | |
"imageeffect": "none", | |
"name": "", | |
"x": 490, | |
"y": 220, | |
"wires": [ | |
[ | |
"7934e802.8de82" | |
] | |
] | |
}, | |
{ | |
"id": "8e78a8c0.817e58", | |
"type": "twitter out", | |
"z": "ac9cc49f.035a", | |
"twitter": "", | |
"name": "Tweet", | |
"x": 750, | |
"y": 220, | |
"wires": [] | |
}, | |
{ | |
"id": "ee65add2.08fca8", | |
"type": "twitter in", | |
"z": "ac9cc49f.035a", | |
"twitter": "", | |
"tags": "#tinkerlicht", | |
"user": "false", | |
"name": "Zoeken", | |
"topic": "tweets", | |
"inputs": 0, | |
"x": 90, | |
"y": 160, | |
"wires": [ | |
[ | |
"33f0c10e.a98376", | |
"8bf3e9d7.b99f7" | |
] | |
] | |
}, | |
{ | |
"id": "7934e802.8de82", | |
"type": "function", | |
"z": "ac9cc49f.035a", | |
"name": "tweet opstellen", | |
"func": "// binnenkomende payload wordt de foto\nmsg.media = msg.payload;\n\n// uitgaande payload wordt de naam van de Twitteraar\nvar lengte = msg.topic.length;\nvar naam = msg.topic.substr(7, lengte);\nmsg.payload = \"@\" + naam + \" De lamp is nu \" + flow.get(\"kleur\") + \".\";\n\nreturn msg;", | |
"outputs": 1, | |
"noerr": 0, | |
"x": 640, | |
"y": 160, | |
"wires": [ | |
[ | |
"8e78a8c0.817e58" | |
] | |
] | |
}, | |
{ | |
"id": "153b54da.8e55bb", | |
"type": "function", | |
"z": "ac9cc49f.035a", | |
"name": "Lijst van kleuren", | |
"func": "flow.set(\"kleuren\", [\n \"lightgoldenrodyellow\",\n \"mediumspringgreen\",\n \"mediumaquamarine\",\n \"mediumslateblue\",\n \"mediumslateblue\",\n \"mediumturquoise\",\n \"mediumvioletred\",\n \"blanchedalmond\",\n \"cornflowerblue\",\n \"darkolivegreen\",\n \"lightslategray\",\n \"lightsteelblue\",\n \"mediumseagreen\",\n \"darkgoldenrod\",\n \"darkslateblue\",\n \"darkslategray\",\n \"darkturquoise\",\n \"lavenderblush\",\n \"lightseagreen\",\n \"palegoldenrod\",\n \"paleturquoise\",\n \"palevioletred\",\n \"antiquewhite\",\n \"darkseagreen\",\n \"lemonchiffon\",\n \"lightskyblue\",\n \"mediumorchid\",\n \"mediumpurple\",\n \"midnightblue\",\n \"blueviolet2\",\n \"darkmagenta\",\n \"deepskyblue\",\n \"floralwhite\",\n \"forestgreen\",\n \"greenyellow\",\n \"lightsalmon\",\n \"lightsalmon\",\n \"lightyellow\",\n \"navajowhite\",\n \"saddlebrown\",\n \"springgreen\",\n \"yellowgreen\",\n \"aquamarine\",\n \"chartreuse\",\n \"darkorange\",\n \"darkorchid\",\n \"darksalmon\",\n \"darkviolet\",\n \"dodgerblue\",\n \"firebrick2\",\n \"ghostwhite\",\n \"lightcoral\",\n \"lightgreen\",\n \"mediumblue\",\n \"papayawhip\",\n \"powderblue\",\n \"sandybrown\",\n \"whitesmoke\",\n \"aliceblue\",\n \"burlywood\",\n \"cadetblue\",\n \"chocolate\",\n \"darkgreen\",\n \"darkkhaki\",\n \"gainsboro\",\n \"goldenrod\",\n \"indianred\",\n \"lawngreen\",\n \"lightblue\",\n \"lightcyan\",\n \"lightgrey\",\n \"lightpink\",\n \"limegreen\",\n \"mintcream\",\n \"mistyrose\",\n \"olivedrab\",\n \"orangered\",\n \"palegreen\",\n \"peachpuff\",\n \"rosybrown\",\n \"royalblue\",\n \"slateblue\",\n \"slategray\",\n \"steelblue\",\n \"turquoise\",\n \"amethyst\",\n \"cornsilk\",\n \"darkblue\",\n \"darkcyan\",\n \"darkgray\",\n \"deeppink\",\n \"honeydew\",\n \"lavender\",\n \"moccasin\",\n \"seagreen\",\n \"seashell\",\n \"crimson\",\n \"darkred\",\n \"dimgray\",\n \"fuchsia\",\n \"hotpink\",\n \"magenta\",\n \"oldlace\",\n \"skyblue\",\n \"thistle\",\n \"bisque\",\n \"indigo\",\n \"maroon\",\n \"orange\",\n \"orchid\",\n \"purple\",\n \"salmon\",\n \"sienna\",\n \"silver\",\n \"tomato\",\n \"violet\",\n \"yellow\",\n \"azure\",\n \"beige\",\n \"brown\",\n \"coral\",\n \"green\",\n \"ivory\",\n \"khaki\",\n \"linen\",\n \"olive\",\n \"wheat\",\n \"white\",\n \"aqua\",\n \"black\",\n \"blue\",\n \"cyan\",\n \"gold\",\n \"gray\",\n \"lime\",\n \"navy\",\n \"peru\",\n \"pink\",\n \"plum\",\n \"snow\",\n \"teal\",\n \"red\",\n \"tan\"\n]);\nreturn msg;", | |
"outputs": 1, | |
"noerr": 0, | |
"x": 300, | |
"y": 40, | |
"wires": [ | |
[] | |
] | |
}, | |
{ | |
"id": "68a02ac3.5bfdb4", | |
"type": "inject", | |
"z": "ac9cc49f.035a", | |
"name": "", | |
"topic": "", | |
"payload": "", | |
"payloadType": "str", | |
"repeat": "", | |
"crontab": "", | |
"once": true, | |
"onceDelay": 0.1, | |
"x": 110, | |
"y": 40, | |
"wires": [ | |
[ | |
"153b54da.8e55bb" | |
] | |
] | |
}, | |
{ | |
"id": "8bf3e9d7.b99f7", | |
"type": "function", | |
"z": "ac9cc49f.035a", | |
"name": "filter kleur", | |
"func": "var tweet = msg.payload.toLowerCase();\nvar kleurenLijst = flow.get(\"kleuren\");\nvar kleur = \"\";\nvar i = 0;\nwhile (i < kleurenLijst.length && kleur === \"\") {\n if (tweet.search(kleurenLijst[i]) != -1) {\n kleur = kleurenLijst[i];\n }\n i++;\n}\nflow.set(\"kleur\", kleur);\nmsg.payload = kleur;\n\nreturn msg;", | |
"outputs": 1, | |
"noerr": 0, | |
"x": 160, | |
"y": 220, | |
"wires": [ | |
[ | |
"59b745e7.e897f4" | |
] | |
] | |
}, | |
{ | |
"id": "8fec9899.11eaf", | |
"type": "rpi-neopixels", | |
"z": "ac9cc49f.035a", | |
"name": "", | |
"pixels": "6", | |
"bgnd": "", | |
"fgnd": "", | |
"wipe": "40", | |
"mode": "pcent", | |
"rgb": "rgb", | |
"x": 450, | |
"y": 100, | |
"wires": [] | |
}, | |
{ | |
"id": "59b745e7.e897f4", | |
"type": "switch", | |
"z": "ac9cc49f.035a", | |
"name": "kleur in tweet?", | |
"property": "kleur", | |
"propertyType": "flow", | |
"rules": [ | |
{ | |
"t": "neq", | |
"v": "", | |
"vt": "str" | |
} | |
], | |
"checkall": "true", | |
"repair": false, | |
"outputs": 1, | |
"x": 300, | |
"y": 160, | |
"wires": [ | |
[ | |
"8fec9899.11eaf", | |
"e3b3ac.42db9458" | |
] | |
] | |
} | |
] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment