Skip to content

Instantly share code, notes, and snippets.

@namgk
Created February 20, 2019 11:37
Show Gist options
  • Save namgk/25465954c22a00a86a51832bc266da44 to your computer and use it in GitHub Desktop.
Save namgk/25465954c22a00a86a51832bc266da44 to your computer and use it in GitHub Desktop.
[{"id":"d627a496.144108","type":"tab","label":"Washers"},{"id":"f585beb5.00bac","type":"inject","z":"d627a496.144108","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"x":106.5,"y":38,"wires":[["1ad562f4.97e2fd"]]},{"id":"1ad562f4.97e2fd","type":"http request","z":"d627a496.144108","name":"","method":"GET","ret":"txt","url":"https://hollyburn.laundroworks.com","tls":"","x":285.5,"y":39,"wires":[["ae701ff1.37aaa"]]},{"id":"ae701ff1.37aaa","type":"html","z":"d627a496.144108","name":"","tag":"[name=_token]","ret":"attr","as":"single","x":489.5,"y":39,"wires":[["7321ced1.a56cd"]]},{"id":"7321ced1.a56cd","type":"change","z":"d627a496.144108","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload[0].value","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":702.5,"y":39,"wires":[["82ecd7b3.f43b58"]]},{"id":"843e044b.41a478","type":"exec","z":"d627a496.144108","command":"curl","addpay":true,"append":"","useSpawn":"","timer":"","name":"","x":344.5,"y":171.5,"wires":[[],[],["9280ce9d.8693"]]},{"id":"82ecd7b3.f43b58","type":"function","z":"d627a496.144108","name":"curl arg","func":"msg.payload = \"-d \\\"_token=\"+msg.payload+\"&cardNumber=22222\\\" -X POST https://hollyburn.laundroworks.com/login -c x\";\nreturn msg;","outputs":1,"noerr":0,"x":177.5,"y":170,"wires":[["843e044b.41a478"]]},{"id":"9280ce9d.8693","type":"switch","z":"d627a496.144108","name":"login ok","property":"payload.code","propertyType":"msg","rules":[{"t":"eq","v":"0","vt":"num"}],"checkall":"true","outputs":1,"x":508.5,"y":185,"wires":[["5ee3c4ea.8309dc"]]},{"id":"5ee3c4ea.8309dc","type":"exec","z":"d627a496.144108","command":"curl -X GET https://hollyburn.laundroworks.com/machines -b x","addpay":false,"append":"","useSpawn":"","timer":"","name":"machines","x":703,"y":185,"wires":[["cc6f6b63.17c6d8"],[],[]]},{"id":"cc6f6b63.17c6d8","type":"json","z":"d627a496.144108","name":"","x":166.5,"y":292,"wires":[["29f72083.ee96f"]]},{"id":"29f72083.ee96f","type":"change","z":"d627a496.144108","name":"view","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.display_locations[0]","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":310.5,"y":292,"wires":[["ef18f12a.65ac7"]]},{"id":"ef18f12a.65ac7","type":"change","z":"d627a496.144108","name":"washers","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.allWashers","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":486.5,"y":291,"wires":[["745e4c20.58f7c4"]]},{"id":"745e4c20.58f7c4","type":"split","z":"d627a496.144108","name":"","splt":"\\n","x":661.5,"y":291,"wires":[["554e13c.508eaec"]]},{"id":"554e13c.508eaec","type":"change","z":"d627a496.144108","name":"","rules":[{"t":"set","p":"no","pt":"msg","to":"payload.Number","tot":"msg"},{"t":"set","p":"stt","pt":"msg","to":"payload.display_status","tot":"msg"},{"t":"set","p":"payload","pt":"msg","to":"{}","tot":"json"},{"t":"move","p":"no","pt":"msg","to":"payload.Number","tot":"msg"},{"t":"move","p":"stt","pt":"msg","to":"payload.display_status","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":146.5,"y":404,"wires":[["1f790ef9.ec8091"]]},{"id":"1f790ef9.ec8091","type":"switch","z":"d627a496.144108","name":"","property":"payload.Number","propertyType":"msg","rules":[{"t":"eq","v":"W01","vt":"str"},{"t":"eq","v":"W02","vt":"str"},{"t":"eq","v":"W03","vt":"str"}],"checkall":"true","outputs":3,"x":347.5,"y":403,"wires":[["f8e37cf2.17429"],["9f292868.1c0568"],["34938051.7c9a3"]]},{"id":"f8e37cf2.17429","type":"ui_text","z":"d627a496.144108","group":"98c66cb1.be568","order":0,"width":0,"height":0,"name":"","label":"W01","format":"{{msg.payload.display_status}}","layout":"row-spread","x":616.5,"y":378,"wires":[]},{"id":"34938051.7c9a3","type":"ui_text","z":"d627a496.144108","group":"98c66cb1.be568","order":0,"width":0,"height":0,"name":"","label":"W03","format":"{{msg.payload.display_status}}","layout":"row-spread","x":589,"y":486,"wires":[]},{"id":"9f292868.1c0568","type":"ui_text","z":"d627a496.144108","group":"98c66cb1.be568","order":0,"width":0,"height":0,"name":"","label":"W02","format":"{{msg.payload.display_status}}","layout":"row-spread","x":615,"y":432,"wires":[]},{"id":"fe7ab642.f743d8","type":"ui_button","z":"d627a496.144108","name":"","group":"98c66cb1.be568","order":3,"width":0,"height":0,"passthru":false,"label":"Refresh","tooltip":"","color":"","bgcolor":"","icon":"","payload":"","payloadType":"str","topic":"","x":114.5,"y":89,"wires":[["1ad562f4.97e2fd"]]},{"id":"98c66cb1.be568","type":"ui_group","z":"","name":"Washers","tab":"43e5af46.878f","disp":true,"width":"6","collapse":false},{"id":"43e5af46.878f","type":"ui_tab","z":"","name":"Home","icon":"dashboard","disabled":false,"hidden":false}]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment