2016 AFL Grand Final Lights

This simple flow was prepared to flash a group of LIFX globes in the colours of the team who had just scored a goal during the 2016 AFL Grand Final. It exposes two HTTP endpoints /swans (red and white) and /dogs (blue and red), and triggered using the DO Button App and Maker Channel.

[{"id":"e136029e.e70b","type":"function","z":"be280fd3.08e7f","name":"RED and WHITE","func":"msg.payload = {\n  \"color\": \"red\",\n  \"from_color\": \"white\",\n  \"period\": 1,\n  \"cycles\": 5,\n  \"persist\": false,\n  \"power_on\": true\n};\nreturn msg;","outputs":1,"noerr":0,"x":283,"y":102,"wires":[["6f46396e.7c6dc8","5559f96f.a56728"]]},{"id":"47be36a7.dc95e8","type":"http in","z":"be280fd3.08e7f","name":"","url":"/swans","method":"post","swaggerDoc":"","x":88.5,"y":101,"wires":[["e136029e.e70b","b65f9a62.56ffc8"]]},{"id":"8f064fce.c209a","type":"http response","z":"be280fd3.08e7f","name":"","x":466.5,"y":175,"wires":[]},{"id":"93b0af92.f6aa7","type":"http in","z":"be280fd3.08e7f","name":"","url":"/dogs","method":"post","swaggerDoc":"","x":94.5,"y":253,"wires":[["bd68e49b.23af78","b65f9a62.56ffc8"]]},{"id":"bd68e49b.23af78","type":"function","z":"be280fd3.08e7f","name":"BLUE and RED","func":"msg.payload = {\n  \"color\": \"blue\",\n  \"from_color\": \"red\",\n  \"period\": 1,\n  \"cycles\": 5,\n  \"persist\": false,\n  \"power_on\": true\n};\nreturn msg;","outputs":1,"noerr":0,"x":289,"y":253,"wires":[["6f46396e.7c6dc8","48bb48f.92bc3b8"]]},{"id":"6f46396e.7c6dc8","type":"lifx-pulse-effect","z":"be280fd3.08e7f","api":"133b613f.8200af","selector":"group:GF","color":"","from_color":"","period":"1","cycles":"5","persist":"false","power_on":"true","x":676.5,"y":175,"wires":[]},{"id":"b65f9a62.56ffc8","type":"function","z":"be280fd3.08e7f","name":"Set statusCode","func":"msg.statusCode = 200;\nreturn msg;","outputs":1,"noerr":0,"x":286.5,"y":176,"wires":[["8f064fce.c209a"]]},{"id":"5559f96f.a56728","type":"debug","z":"be280fd3.08e7f","name":"Swans Score","active":true,"console":"false","complete":"payload","x":484.5,"y":43,"wires":[]},{"id":"48bb48f.92bc3b8","type":"debug","z":"be280fd3.08e7f","name":"Dogs Score","active":true,"console":"false","complete":"payload","x":484.5,"y":304,"wires":[]},{"id":"133b613f.8200af","type":"lifx-config","z":"be280fd3.08e7f","token":"c4078f7575d6d3ebe6ab3b44b3bfca687c24bd82718892cf90f3d24327f5bb1b"}]
alisdairjsmyth

Flow Info

created 1 year, 1 month ago

Node Types

Core
  • debug (x2)
  • function (x3)
  • http in (x2)
  • http response (x1)
Other

Tags

  • lifx
  • afl
Copy this flow JSON to your clipboard and then import into Node-RED using the Import From > Clipboard (Ctrl-I) menu option