Cheerlights Ledborg Orb

This flow checks twitter for "cheerlights", extracts the colour and outputs to a ledborg node. Includes a watchdog timer and a message limiter.

Can also be used for LEDs:

Red – Pin 11 / GPIO17, Green – Pin 13 / GPIO27, Blue – Pin 15 / GPIO22

add a ping pong ball as a difuser.

[{"id":"f20eb6a2.c53588","type":"debug","z":"7e44005c.a095c","name":"","active":false,"complete":false,"x":419.89288330078125,"y":207.26187133789062,"wires":[]},{"id":"3d8c0321.24be84","type":"trigger","z":"7e44005c.a095c","op1":"1","op2":"black","op1type":"nul","op2type":"val","duration":"30","extend":true,"units":"s","name":"watchdog timer","x":422.97637939453125,"y":427.484130859375,"wires":[["eee7a6ad.61e8f","587b7b1d.689414"]]},{"id":"eee7a6ad.61e8f","type":"debug","z":"7e44005c.a095c","name":"","active":false,"complete":false,"x":554.3336181640625,"y":532.8333129882812,"wires":[]},{"id":"e07ebb0f.0a9ee","type":"inject","z":"7e44005c.a095c","name":"","topic":"","payload":"black","payloadType":"string","repeat":"","crontab":"","once":false,"x":135.33331298828125,"y":389.1665344238281,"wires":[["2305a2de.c321f6"]]},{"id":"5c8c48ea.c8c66","type":"inject","z":"7e44005c.a095c","name":"","topic":"","payload":" white","payloadType":"string","repeat":"","crontab":"","once":false,"x":130.99993896484375,"y":349.833251953125,"wires":[["2305a2de.c321f6"]]},{"id":"e7d0e04b.e6946","type":"inject","z":"7e44005c.a095c","name":"","topic":"","payload":"red","payloadType":"string","repeat":"","crontab":"","once":false,"x":130.83334350585938,"y":222.49993896484375,"wires":[["2305a2de.c321f6"]]},{"id":"4c4d819f.50c0d","type":"inject","z":"7e44005c.a095c","name":"","topic":"","payload":"green","payloadType":"string","repeat":"","crontab":"","once":false,"x":127,"y":266.16656494140625,"wires":[["2305a2de.c321f6"]]},{"id":"dcb09d78.6dd6b8","type":"inject","z":"7e44005c.a095c","name":"","topic":"","payload":"blue","payloadType":"string","repeat":"","crontab":"","once":false,"x":131.5,"y":312.4999084472656,"wires":[["2305a2de.c321f6"]]},{"id":"50c872bc.6bde74","type":"inject","z":"7e44005c.a095c","name":"Many Colours","topic":"","payload":"purple,orange,cyan,magenta","payloadType":"string","repeat":"","crontab":"","once":false,"x":129.25009155273438,"y":433.0832824707031,"wires":[["2305a2de.c321f6"]]},{"id":"2305a2de.c321f6","type":"function","z":"7e44005c.a095c","name":"Spaghetti Junction","func":"\nreturn msg;","outputs":1,"noerr":0,"x":341.2263488769531,"y":323.84521484375,"wires":[["f20eb6a2.c53588","3d8c0321.24be84","587b7b1d.689414"]]},{"id":"8ab81a7.ece50e8","type":"delay","z":"7e44005c.a095c","name":"Limit messages per minute","pauseType":"rate","timeout":"5","timeoutUnits":"seconds","rate":"4","rateUnits":"minute","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":1392.083251953125,"y":329.0396728515625,"wires":[["9a1e92f8.3af3a8","7a4f3029.b70d78"]]},{"id":"7a4f3029.b70d78","type":"ledborg","z":"7e44005c.a095c","name":"","x":1616.5081176757812,"y":330.36113834381104,"wires":[]},{"id":"587b7b1d.689414","type":"switch","z":"7e44005c.a095c","name":"Extract colour from tweet","property":"payload","rules":[{"t":"regex","v":"red","case":true},{"t":"regex","v":"green","case":true},{"t":"regex","v":"blue","case":true},{"t":"regex","v":"cyan","case":true},{"t":"regex","v":"magenta","case":true},{"t":"regex","v":"yellow","case":true},{"t":"regex","v":"pink","case":true},{"t":"regex","v":"purple","case":true},{"t":"regex","v":" white","case":true},{"t":"regex","v":"black","case":true},{"t":"regex","v":"amber","case":true},{"t":"regex","v":"orange","case":true},{"t":"regex","v":"oldlace","case":true},{"t":"regex","v":"warmwhite","case":true}],"checkall":"true","outputs":14,"x":695.2023315429688,"y":336.4046936035156,"wires":[["2c5d41e2.6b267e"],["dfaeb130.1a32b8"],["c3582f75.081af"],["fd25dac0.279a88"],["79141a23.9333ec"],["be40f657.c5e468"],["84483193.d12b7"],["6224acbf.d1721c"],["f8cb325a.465d1"],["b647a566.5a78d"],["8df80345.7a80d"],["8df80345.7a80d"],["b4b56c7e.87f2d8"],["b4b56c7e.87f2d8"]]},{"id":"dfaeb130.1a32b8","type":"change","z":"7e44005c.a095c","name":"Green","rules":[{"t":"set","p":"payload","to":"green"}],"action":"","property":"","from":"","to":"","reg":false,"x":943.2977294921875,"y":141.11911010742188,"wires":[["cb82046b.722ca"]]},{"id":"c3582f75.081af","type":"change","z":"7e44005c.a095c","name":"Blue","rules":[{"t":"set","p":"payload","to":"blue"}],"action":"","property":"","from":"","to":"","reg":false,"x":945.46435546875,"y":189.7381591796875,"wires":[["cb82046b.722ca"]]},{"id":"fd25dac0.279a88","type":"change","z":"7e44005c.a095c","name":"Cyan","rules":[{"t":"set","p":"payload","to":"cyan"}],"action":"","property":"","from":"","to":"","reg":false,"x":952.297607421875,"y":233.14288330078125,"wires":[["cb82046b.722ca"]]},{"id":"79141a23.9333ec","type":"change","z":"7e44005c.a095c","name":"Magenta","rules":[{"t":"set","p":"payload","to":"magenta"}],"action":"","property":"","from":"","to":"","reg":false,"x":958.98828125,"y":272.0714416503906,"wires":[["cb82046b.722ca"]]},{"id":"be40f657.c5e468","type":"change","z":"7e44005c.a095c","name":"Yellow","rules":[{"t":"set","p":"payload","to":"yellow"}],"action":"","property":"","from":"","to":"","reg":false,"x":954.369140625,"y":314.1904296875,"wires":[["cb82046b.722ca"]]},{"id":"84483193.d12b7","type":"change","z":"7e44005c.a095c","name":"Pink","rules":[{"t":"set","p":"payload","to":"pink"}],"action":"","property":"","from":"","to":"","reg":false,"x":960.39306640625,"y":365.5238037109375,"wires":[["cb82046b.722ca"]]},{"id":"6224acbf.d1721c","type":"change","z":"7e44005c.a095c","name":"Purple","rules":[{"t":"set","p":"payload","to":"purple"}],"action":"","property":"","from":"","to":"","reg":false,"x":957.6546630859375,"y":409.59527587890625,"wires":[["cb82046b.722ca"]]},{"id":"f8cb325a.465d1","type":"change","z":"7e44005c.a095c","name":"White","rules":[{"t":"set","p":"payload","to":"white"}],"action":"","property":"","from":"","to":"","reg":false,"x":959.0833740234375,"y":453.142822265625,"wires":[["cb82046b.722ca"]]},{"id":"b4b56c7e.87f2d8","type":"change","z":"7e44005c.a095c","name":"Warmwhite / Oldlace","rules":[{"t":"set","p":"payload","to":"oldlace"}],"action":"","property":"","from":"","to":"","reg":false,"x":984.7738037109375,"y":583.6190795898438,"wires":[["cb82046b.722ca"]]},{"id":"b647a566.5a78d","type":"change","z":"7e44005c.a095c","name":"Black","rules":[{"t":"set","p":"payload","to":"black"}],"action":"","property":"","from":"","to":"","reg":false,"x":962.89306640625,"y":497.5,"wires":[["cb82046b.722ca"]]},{"id":"8df80345.7a80d","type":"change","z":"7e44005c.a095c","name":"Amber / Orange","rules":[{"t":"set","p":"payload","to":"amber"}],"action":"","property":"","from":"","to":"","reg":false,"x":975.5595703125,"y":542.793701171875,"wires":[["cb82046b.722ca"]]},{"id":"2c5d41e2.6b267e","type":"change","z":"7e44005c.a095c","name":"Red","rules":[{"t":"set","p":"payload","to":"red"}],"action":"","property":"","from":"","to":"","reg":false,"x":942.53564453125,"y":92.5,"wires":[["cb82046b.722ca"]]},{"id":"1d018135.689adf","type":"debug","z":"7e44005c.a095c","name":"","active":true,"console":"false","complete":"false","x":1284.638671875,"y":207.3174285888672,"wires":[]},{"id":"9a1e92f8.3af3a8","type":"debug","z":"7e44005c.a095c","name":"","active":true,"console":"false","complete":"false","x":1531.5,"y":211.34523010253906,"wires":[]},{"id":"cb82046b.722ca","type":"function","z":"7e44005c.a095c","name":"Spaghetti Junction","func":"\nreturn msg;","outputs":1,"noerr":0,"x":1160,"y":335,"wires":[["1d018135.689adf","8ab81a7.ece50e8"]]},{"id":"8878145d.01e828","type":"inject","z":"7e44005c.a095c","name":"","topic":"","payload":"black","payloadType":"string","repeat":"","crontab":"","once":false,"x":1384.5,"y":591.34521484375,"wires":[["7a4f3029.b70d78"]]},{"id":"9d5d5967.9fe16","type":"inject","z":"7e44005c.a095c","name":"","topic":"","payload":"white","payloadType":"string","repeat":"","crontab":"","once":false,"x":1384.5,"y":546.34521484375,"wires":[["7a4f3029.b70d78"]]},{"id":"904c1593.78594","type":"inject","z":"7e44005c.a095c","name":"","topic":"","payload":"cyan","payloadType":"string","repeat":"","crontab":"","once":false,"x":1379.5,"y":502.34521484375,"wires":[["7a4f3029.b70d78"]]},{"id":"241b66e0.2f3522","type":"inject","z":"7e44005c.a095c","name":"","topic":"","payload":"green","payloadType":"string","repeat":"","crontab":"","once":false,"x":1385.5,"y":454.34521484375,"wires":[["7a4f3029.b70d78"]]},{"id":"fbe7b1d5.761d1","type":"inject","z":"7e44005c.a095c","name":"","topic":"","payload":"red","payloadType":"string","repeat":"","crontab":"","once":false,"x":1385.4999999999998,"y":398.3452148437499,"wires":[["7a4f3029.b70d78"]]},{"id":"bb194307.748e4","type":"twitter in","z":"7e44005c.a095c","twitter":"","tags":"cheerlights","user":"false","name":"cheerlights","topic":"tweets","x":124.99996948242188,"y":175,"wires":[["2305a2de.c321f6"]]}]
DrLucyRogers

Flow Info

created 2 years, 2 months ago

Node Types

Core
  • change (x12)
  • debug (x4)
  • delay (x1)
  • function (x2)
  • inject (x11)
  • switch (x1)
  • trigger (x1)
  • twitter in (x1)
Other

Tags

  • cheerlights
  • #cheerlights
  • ledborg
  • led
  • orb
Copy this flow JSON to your clipboard and then import into Node-RED using the Import From > Clipboard (Ctrl-I) menu option