[{"id":"dfe0d4899f3a3019","type":"shelly-gen1","z":"0d338faf61a7ae48","hostname":"192.168.178.120","description":"","mode":"polling","server":"033a6e9acf499057","uploadretryinterval":"5000","pollinginterval":5000,"pollstatus":false,"getstatusoncommand":true,"devicetype":"Measure","outputs":2,"credentials":{"username":"","password":""},"x":590,"y":140,"wires":[["44eaf42a.9e197c"],["7babbb7d2fc9f75e","ef73396048246b64"]]},{"id":"44eaf42a.9e197c","type":"debug","z":"0d338faf61a7ae48","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":790,"y":120,"wires":[]},{"id":"475a1574.c2a66c","type":"inject","z":"0d338faf61a7ae48","name":"Poll Status","repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":220,"y":60,"wires":[["dfe0d4899f3a3019"]]},{"id":"6d64c35a96ac1d04","type":"function","z":"0d338faf61a7ae48","name":"all","func":"// The array contains the indexes of the measurement channels to be downloaded.\nmsg.payload = {\n download: [0, 1, 2]\n};\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":390,"y":260,"wires":[["dfe0d4899f3a3019"]]},{"id":"fdab0a3a904683e9","type":"inject","z":"0d338faf61a7ae48","name":"download CSV","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payloadType":"date","x":220,"y":260,"wires":[["6d64c35a96ac1d04"]]},{"id":"7babbb7d2fc9f75e","type":"debug","z":"0d338faf61a7ae48","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":790,"y":180,"wires":[]},{"id":"ee0c95fe05c7c98c","type":"function","z":"0d338faf61a7ae48","name":"L1","func":"// The array contains the indexes of the measurement channels to be downloaded.\nmsg.payload = {\n download: [0]\n};\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":390,"y":140,"wires":[["dfe0d4899f3a3019"]]},{"id":"1363a7b95dc22423","type":"inject","z":"0d338faf61a7ae48","name":"download CSV","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payloadType":"date","x":220,"y":140,"wires":[["ee0c95fe05c7c98c"]]},{"id":"54e3634585049b89","type":"function","z":"0d338faf61a7ae48","name":"L2","func":"// The array contains the indexes of the measurement channels to be downloaded.\nmsg.payload = {\n download: [1]\n};\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":390,"y":180,"wires":[["dfe0d4899f3a3019"]]},{"id":"f9eacb981dab1d80","type":"inject","z":"0d338faf61a7ae48","name":"download CSV","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payloadType":"date","x":220,"y":180,"wires":[["54e3634585049b89"]]},{"id":"98a67b3fb4249836","type":"function","z":"0d338faf61a7ae48","name":"L3","func":"// The array contains the indexes of the measurement channels to be downloaded.\nmsg.payload = {\n download: [2]\n};\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":390,"y":220,"wires":[["dfe0d4899f3a3019"]]},{"id":"64260d206019d584","type":"inject","z":"0d338faf61a7ae48","name":"download CSV","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payloadType":"date","x":220,"y":220,"wires":[["98a67b3fb4249836"]]},{"id":"e2533fe31f6f0a92","type":"file","z":"0d338faf61a7ae48","name":"write CSV","filename":"","appendNewline":true,"createDir":false,"overwriteFile":"true","encoding":"none","x":960,"y":260,"wires":[[]]},{"id":"ef73396048246b64","type":"function","z":"0d338faf61a7ae48","name":"split payload","func":"for (let i = 0; i < msg.payload.length; i++) {\n let emData = msg.payload[i];\n \n var newMsg = {\n filename : \"emData\" + i + \".csv\",\n payload : emData\n }\n\n node.send(newMsg);\n}\n","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":800,"y":260,"wires":[["e2533fe31f6f0a92"]]},{"id":"033a6e9acf499057","type":"shelly-gen1-server","port":"20001","hostname":""}]