[{"id":"d315c6d0.2cea38","type":"file in","name":"Main File","filename":"/home/pi/nrdemo/lights.html","format":"utf8","x":357,"y":55,"z":"9bdfc593.642038","wires":[["e38437a1.1c7bc8"]]},{"id":"e499c43.f1b6638","type":"http in","name":"Lights","url":"/lights","method":"get","x":187,"y":57,"z":"9bdfc593.642038","wires":[["d315c6d0.2cea38"]]},{"id":"e38437a1.1c7bc8","type":"http response","name":"Light Response","x":547,"y":56,"z":"9bdfc593.642038","wires":[]},{"id":"c5bb5128.3a44b","type":"http in","name":"Get Light Status","url":"/lightstatus","method":"get","x":158,"y":181,"z":"9bdfc593.642038","wires":[["5293946.fad6c6c"]]},{"id":"5293946.fad6c6c","type":"function","name":"Return Status Object","func":"context.global.lightstatus = context.global.lightstatus || \"0\"; \nmsg.payload = {lightstatus: context.global.lightstatus};\nreturn msg;","outputs":1,"x":381,"y":180,"z":"9bdfc593.642038","wires":[["8aab0b7e.7554f8"]]},{"id":"8aab0b7e.7554f8","type":"http response","name":"Status Response","x":597,"y":181,"z":"9bdfc593.642038","wires":[]},{"id":"6d14e1a8.92eb2","type":"http in","name":"Lights JS","url":"/lights.js","method":"get","x":191,"y":102,"z":"9bdfc593.642038","wires":[["10af4c20.ef50b4"]]},{"id":"10af4c20.ef50b4","type":"file in","name":"Javascript File","filename":"/home/pi/nrdemo/lights.js","format":"utf8","x":371,"y":100,"z":"9bdfc593.642038","wires":[["f9b9b86b.064648"]]},{"id":"f9b9b86b.064648","type":"http response","name":"Light JS Response","x":551,"y":102,"z":"9bdfc593.642038","wires":[]},{"id":"de08792b.21f788","type":"http in","name":"Light Switch","url":"/lightswitch","method":"post","x":149,"y":352,"z":"9bdfc593.642038","wires":[["42fb0491.bd04fc"]]},{"id":"91493033.6eb6d","type":"rpi-pibrella out","name":"Red Light","pin":"Red LED","set":true,"level":"0","x":675,"y":315,"z":"9bdfc593.642038","wires":[]},{"id":"72b27f0a.8d4d8","type":"rpi-pibrella out","name":"Amber Light","pin":"Amber LED","set":true,"level":"0","x":681,"y":356,"z":"9bdfc593.642038","wires":[]},{"id":"fbf4d64a.040b28","type":"rpi-pibrella out","name":"Green Light","pin":"Green LED","set":true,"level":"0","x":680,"y":396,"z":"9bdfc593.642038","wires":[]},{"id":"436ecc03.bc9134","type":"http response","name":"Send Response","x":946,"y":275,"z":"9bdfc593.642038","wires":[]},{"id":"42fb0491.bd04fc","type":"function","name":"Map Input JSON to On/Off","func":"context.global.lightstatus = msg.req.body.newlightstate;\nmsg.payload = msg.req.body.newlightstate;\nreturn msg;","outputs":1,"x":386,"y":351,"z":"9bdfc593.642038","wires":[["91493033.6eb6d","72b27f0a.8d4d8","fbf4d64a.040b28","12d6d53c.ed292b"]]},{"id":"12d6d53c.ed292b","type":"function","name":"Return Status Object","func":"msg.payload = {lightstatus: context.global.lightstatus};\nreturn msg;","outputs":1,"x":714,"y":275,"z":"9bdfc593.642038","wires":[["436ecc03.bc9134","16c9a180.e9365e"]]},{"id":"16c9a180.e9365e","type":"debug","name":"Debug","active":false,"console":"false","complete":"true","x":919,"y":342,"z":"9bdfc593.642038","wires":[]}]