Add TLS protocol to HTTP call through web API (Talk2m eWON)

Hello,

I have a Nodered application installed on a cloud Aruba Server that through HTTP request collects data from a eWON Flexy 205 (an industrial router) through Talk2m Web APIs (their propietary cloud service that allow me to communicate with the industrial router, which shares variables with a Schneider M241 PLC connected to it).

It is used to collect production data from a Cleaning Robot of a dam pipes that's located in France, the company that owns the Cloud Aruba Server is in Italy.

eWON sent me an e-mail that they won't support anymore http calls with TLS < 1.2 from 18/11/2021

Now I don't have any TLS protocol configured, and it still works well.
I'd like to implement the TLS protocol, but I don't know how to do it.

I'd like to know wich certificate, private key, CA Certificate I have to use in order to get all working

Now I didn't have any tests because I can communicate with the eWON and the cleaning robot is in production, I don't want to interrupt the collecting data process.

Here the complete flow (where I also paste values in daily csv files):

[{"id":"7404b076.c11a58","type":"tab","label":"Write","disabled":false,"info":""},{"id":"35b5fa8e.9a6516","type":"ui_form","z":"7404b076.c11a58","name":"","label":"Parametri Commessa","group":"4201a4f9.5bcbd4","order":1,"width":8,"height":1,"options":[{"label":"Cliente","value":"Customer_ID_R","type":"text","required":false,"rows":null},{"label":"N° Commessa","value":"JobID_R","type":"number","required":true,"rows":null},{"label":"Metri da fare A","value":"A_Objective_R","type":"number","required":true,"rows":null},{"label":"Metri da fare B","value":"B_Objective_R","type":"number","required":true,"rows":null}],"formValue":{"Customer_ID_R":"","JobID_R":"","A_Objective_R":"","B_Objective_R":""},"payload":"","submit":"Invia","cancel":"Annulla","topic":"","topicType":"str","splitLayout":false,"x":180,"y":380,"wires":[["a02defb5.a3d39"]]},{"id":"a02defb5.a3d39","type":"function","z":"7404b076.c11a58","name":"","func":"var Customer_ID_R, JobID_R, A_Objective_R, B_Objective_R;\n\nCustomer_ID_R   = msg.payload.Customer_ID_R;\nJobID_R       = msg.payload.JobID_R; \nA_Objective_R   = msg.payload.A_Objective_R;\nB_Objective_R   = msg.payload.B_Objective_R;\n\n\nmsg.payload = \"https://m2web.talk2m.com/t2mapi/get/RANDENS/rcgi.bin/UpdateTagForm?\"+\n\"TagName1=JobID_R&TagValue1=\"+JobID_R+\n\"&TagName2=A_Objective_R&TagValue2=\"+A_Objective_R+\n\"&TagName3=B_Objective_R&TagValue3=\"+B_Objective_R+\n\"&TagName4=Customer_ID_R&TagValue4=\"+Customer_ID_R+\n\"&t2maccount=DONELLI&t2musername=AMB1&t2mpassword=Amb4321!&t2mdeveloperid=ab6beb0f-41a7-4488-835e-66a205261e83&t2mdeviceusername=adm&t2mdevicepassword=adm\"\n\nreturn msg;\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":140,"y":434,"wires":[["36457e69.2da6c2"]]},{"id":"a9f73cee.04261","type":"http request","z":"7404b076.c11a58","name":"HTTP_CALL","method":"GET","ret":"txt","paytoqs":"body","url":"","tls":"","persist":false,"proxy":"","authType":"","x":338,"y":490,"wires":[["d88c29fe.89c3f"]]},{"id":"36457e69.2da6c2","type":"change","z":"7404b076.c11a58","name":"","rules":[{"t":"set","p":"url","pt":"msg","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":158,"y":490,"wires":[["a9f73cee.04261"]]},{"id":"d88c29fe.89c3f","type":"html","z":"7404b076.c11a58","name":"","property":"payload","outproperty":"payload","tag":"title","ret":"html","as":"single","x":538,"y":450,"wires":[["229900ba.78c91","754b324e.b9c83c"]]},{"id":"229900ba.78c91","type":"function","z":"7404b076.c11a58","name":"","func":"var result;\n\nresult = msg.payload[0]\n\nif (result === \"Messaggio Successo\" || result === \"Success Message\") {\n    msg.payload = \"Dati inviati\"\n} else {\n    msg.payload = \"Errore invio dati\"\n}\n\nreturn msg;\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":548,"y":510,"wires":[["ef55842c.13aaa8"]]},{"id":"ef55842c.13aaa8","type":"ui_toast","z":"7404b076.c11a58","position":"top right","displayTime":"3","highlight":"","sendall":true,"outputs":0,"ok":"OK","cancel":"","raw":true,"topic":"Esito","name":"","x":738,"y":510,"wires":[]},{"id":"27b47c9a.8f19b4","type":"http request","z":"7404b076.c11a58","name":"HTTP_CALL","method":"GET","ret":"txt","paytoqs":"body","url":"","tls":"","persist":false,"proxy":"","authType":"","x":238,"y":690,"wires":[["6e932e7d.5b4e2","1f222a56.5f8d66"]]},{"id":"9867d4d.d98f328","type":"function","z":"7404b076.c11a58","name":"","func":"msg.payload = \"https://m2web.talk2m.com/t2mapi/get/RANDENS/rcgi.bin/ParamForm?AST_Param=$dtIV$ftT&t2maccount=DONELLI&t2musername=AMB1&t2mpassword=Amb4321!&t2mdeveloperid=ab6beb0f-41a7-4488-835e-66a205261e83&t2mdeviceusername=adm&t2mdevicepassword=adm\"\n\n\nreturn msg;\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":228,"y":636,"wires":[["b95a472f.174978"]]},{"id":"b95a472f.174978","type":"change","z":"7404b076.c11a58","name":"","rules":[{"t":"set","p":"url","pt":"msg","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":400,"y":636,"wires":[["27b47c9a.8f19b4"]]},{"id":"682796d.b5b4168","type":"comment","z":"7404b076.c11a58","name":"Read istant","info":"","x":118,"y":550,"wires":[]},{"id":"56758fd4.05676","type":"inject","z":"7404b076.c11a58","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"*/5 6-22 * * *","once":true,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":116,"y":600,"wires":[["9867d4d.d98f328"]]},{"id":"6e932e7d.5b4e2","type":"json","z":"7404b076.c11a58","name":"","property":"payload","action":"str","pretty":true,"x":398,"y":690,"wires":[["b9613703.55b448"]]},{"id":"b9613703.55b448","type":"csv","z":"7404b076.c11a58","name":"","sep":";","hdrin":true,"hdrout":"none","multi":"mult","ret":"\\r\\n","temp":"","skip":"0","strings":true,"include_empty_strings":false,"include_null_values":false,"x":558,"y":690,"wires":[["d95a0f67.bb381","aefd7348.fd7d1","6672a824.456d38","d204c929.d5eaa8","9be963e4.4090f","53cb3df4.96f494","75ed829f.a6b50c","6521c7b1.faf218","878e8ebb.5b2b7","bfde795e.648998","19dda6b2.058a89","a6443fb8.dc986","851cced9.bd85f","aa6b2580.f006d8","6a6b27fd.274dc8","586558fd.582de8","cc831216.79706","5ee32562.1521cc","1507ba34.a24d26","2eab7986.29ba26","50dcc9e.cddea38","abc2de94.29c56","34895aa8.5cc1f6","acede667.9f6e08","2d6c4d4e.969c82","25d7de5d.240782","40e8eb70.1dd6c4","86ff666.0bdce98"]]},{"id":"d95a0f67.bb381","type":"ui_text","z":"7404b076.c11a58","group":"e815e384.db1578","order":1,"width":8,"height":1,"name":"","label":"N° Commessa","format":"{{msg.payload[0].Value}}","layout":"row-spread","x":168,"y":870,"wires":[]},{"id":"aefd7348.fd7d1","type":"ui_text","z":"7404b076.c11a58","group":"e815e384.db1578","order":2,"width":8,"height":1,"name":"","label":"Cliente","format":"{{msg.payload[3].Value}}","layout":"row-spread","x":148,"y":906,"wires":[]},{"id":"6672a824.456d38","type":"ui_text","z":"7404b076.c11a58","group":"e815e384.db1578","order":3,"width":8,"height":1,"name":"","label":"A Minuti Lavorati","format":"{{msg.payload[12].Value}}","layout":"row-spread","x":178,"y":990,"wires":[]},{"id":"20a5b5d1.33700a","type":"ui_text","z":"7404b076.c11a58","group":"e815e384.db1578","order":7,"width":8,"height":1,"name":"","label":"A Modalità di Lavoro","format":"{{msg.payload.AMode}}","layout":"row-spread","x":386,"y":906,"wires":[]},{"id":"d204c929.d5eaa8","type":"ui_text","z":"7404b076.c11a58","group":"e815e384.db1578","order":8,"width":8,"height":1,"name":"","label":"A Posizione Attuale","format":"{{msg.payload[8].Value}}","layout":"row-spread","x":176,"y":946,"wires":[]},{"id":"bebcc698.7cc938","type":"comment","z":"7404b076.c11a58","name":"Write","info":"","x":98,"y":330,"wires":[]},{"id":"9be963e4.4090f","type":"function","z":"7404b076.c11a58","name":"Set data","func":"var date = new Date().toLocaleDateString(\"it-IT\");\nvar time = new Date().toLocaleTimeString(\"it-IT\");\n\nmsg.payload = {\n    \"timestamp\" : date+\" \"+time,\n    \"commessa\" : msg.payload[0].Value,\n    \"cliente\" :  msg.payload[3].Value,\n    \"Atodo\" :  parseInt(msg.payload[1].Value),\n    \"Adone\" :  parseInt(msg.payload[14].Value),\n    \"Aday\" :  parseInt(msg.payload[4].Value),\n    \"AMode\" : parseInt(msg.payload[6].Value),\n    \"APos\" : parseInt(msg.payload[8].Value),\n    \"APosMax\" :  parseInt(msg.payload[10].Value),\n    \"AMin\" :  parseInt(msg.payload[12].Value),\n    \"Btodo\" :  parseInt(msg.payload[2].Value),\n    \"Bdone\" :  parseInt(msg.payload[15].Value),\n    \"Bday\" : parseInt(msg.payload[5].Value),\n    \"BMode\" : parseInt(msg.payload[7].Value),\n    \"BPos\" :  parseInt(msg.payload[9].Value),\n    \"BPosMax\" :  parseInt(msg.payload[11].Value),\n    \"BMin\" :  parseInt(msg.payload[13].Value),\n}\nreturn msg;\n","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":170,"y":1154,"wires":[["31d754ee.7a46cc"]]},{"id":"31d754ee.7a46cc","type":"function","z":"7404b076.c11a58","name":"Filename generator","func":"// Get the current time and convert it to text\nvar now = new Date();\nvar yyyy = now.getFullYear();\nvar mm = now.getMonth() < 9 ? \"0\" + (now.getMonth() + 1) : (now.getMonth() + 1); // getMonth() is zero-based\nvar dd  = now.getDate() < 10 ? \"0\" + now.getDate() : now.getDate();\nvar hh = now.getHours() < 10 ? \"0\" + now.getHours() : now.getHours();\nvar mmm  = now.getMinutes() < 10 ? \"0\" + now.getMinutes() : now.getMinutes();\nvar ss  = now.getSeconds() < 10 ? \"0\" + now.getSeconds() : now.getSeconds();\n\n// Generate out file name pattern\n//msg.fname = msg.payload.commessa+\"_\"+msg.payload.cliente+\"_\"+dd+\"_\"+mm+\"_\"+yyyy + \".csv\";\nmsg.fname = \"Radens_prod_\"+dd+\"_\"+mm+\"_\"+yyyy + \".csv\";\n// Full filename with path for the file node later\nmsg.filename = \"C:\\\\Radens_csv\\\\Realtime\\\\\"+ msg.fname;\n\n// We save the current payload into a different place on the msg object\nmsg.filecontent = msg.payload;\n\n// We are passing the file name search pattern to fs node to tell us if the file exists or not\nmsg.payload = {\"pattern\":msg.fname};\n\nnode.status({fill:\"blue\",shape:\"ring\",text:msg.fname});\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":192,"y":1226,"wires":[["e1694d39.02392"]]},{"id":"53cb3df4.96f494","type":"debug","z":"7404b076.c11a58","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":400,"y":1154,"wires":[]},{"id":"5289ae61.d9631","type":"switch","z":"7404b076.c11a58","name":"","property":"$count(msg.payload)","propertyType":"jsonata","rules":[{"t":"eq","v":"0","vt":"num"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":538,"y":1226,"wires":[["c2e557c6.7998e8"],["a8f653e.dd54cb"]]},{"id":"5426c6ab.748448","type":"csv","z":"7404b076.c11a58","name":"","sep":",","hdrin":false,"hdrout":"all","multi":"one","ret":"\\r\\n","temp":"timestamp,commessa,cliente,Atodo,Adone,Aday,AMode,APos,APosMax,AMin,Btodo,Bdone,Bday,BMode,BPos,BPosMax,BMin","skip":"0","strings":true,"include_empty_strings":false,"include_null_values":false,"x":338,"y":1330,"wires":[["7762f2e4.23cfdc","96afa6ef.98beb8"]]},{"id":"7762f2e4.23cfdc","type":"file","z":"7404b076.c11a58","name":"","filename":"","appendNewline":false,"createDir":true,"overwriteFile":"false","encoding":"none","x":482,"y":1330,"wires":[[]]},{"id":"56998aec.64c4a4","type":"csv","z":"7404b076.c11a58","name":"","sep":",","hdrin":false,"hdrout":"none","multi":"mult","ret":"\\r\\n","temp":"timestamp,commessa,cliente,Atodo,Adone,Aday,AMode,APos,APosMax,AMin,Btodo,Bdone,Bday,BMode,BPos,BPosMax,BMin","skip":"0","strings":true,"include_empty_strings":false,"include_null_values":false,"x":338,"y":1366,"wires":[["ebb70447.ceee08"]]},{"id":"c2e557c6.7998e8","type":"change","z":"7404b076.c11a58","name":"Get file content","rules":[{"t":"set","p":"payload","pt":"msg","to":"filecontent","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":170,"y":1330,"wires":[["5426c6ab.748448"]]},{"id":"a8f653e.dd54cb","type":"change","z":"7404b076.c11a58","name":"Get file content","rules":[{"t":"set","p":"payload","pt":"msg","to":"filecontent","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":170,"y":1366,"wires":[["56998aec.64c4a4"]]},{"id":"ebb70447.ceee08","type":"file","z":"7404b076.c11a58","name":"","filename":"","appendNewline":false,"createDir":true,"overwriteFile":"false","encoding":"none","x":482,"y":1366,"wires":[[]]},{"id":"96afa6ef.98beb8","type":"debug","z":"7404b076.c11a58","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":678,"y":1290,"wires":[]},{"id":"e1694d39.02392","type":"fs-file-lister","z":"7404b076.c11a58","name":"","start":"C:\\\\Radens_csv\\\\Realtime","pattern":"","folders":"*","hidden":true,"lstype":"files","path":true,"single":true,"depth":0,"stat":true,"showWarnings":true,"x":386,"y":1226,"wires":[["5289ae61.d9631"]]},{"id":"3636113.996d4ee","type":"comment","z":"7404b076.c11a58","name":"SaveCSV","info":"","x":110,"y":1094,"wires":[]},{"id":"754b324e.b9c83c","type":"debug","z":"7404b076.c11a58","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":738,"y":450,"wires":[]},{"id":"75ed829f.a6b50c","type":"ui_text","z":"7404b076.c11a58","group":"cd2429b5.1a0608","order":3,"width":8,"height":1,"name":"","label":"N° Commessa","format":"{{msg.payload[0].Value}}","layout":"row-spread","x":488,"y":330,"wires":[]},{"id":"6521c7b1.faf218","type":"ui_text","z":"7404b076.c11a58","group":"cd2429b5.1a0608","order":2,"width":8,"height":1,"name":"","label":"Cliente","format":"{{msg.payload[3].Value}}","layout":"row-spread","x":668,"y":330,"wires":[]},{"id":"bfde795e.648998","type":"ui_text","z":"7404b076.c11a58","group":"cd2429b5.1a0608","order":5,"width":8,"height":1,"name":"","label":"B Obiettivo","format":"{{msg.payload[2].Value}}","layout":"row-spread","x":678,"y":370,"wires":[]},{"id":"878e8ebb.5b2b7","type":"ui_text","z":"7404b076.c11a58","group":"cd2429b5.1a0608","order":4,"width":8,"height":1,"name":"","label":"A Obiettivo","format":"{{msg.payload[1].Value}}","layout":"row-spread","x":478,"y":370,"wires":[]},{"id":"19dda6b2.058a89","type":"ui_text","z":"7404b076.c11a58","group":"e815e384.db1578","order":4,"width":8,"height":1,"name":"","label":"n° Giorno di Lavorazione","format":"{{msg.payload[4].Value}}","layout":"row-spread","x":396,"y":866,"wires":[]},{"id":"a6443fb8.dc986","type":"ui_text","z":"7404b076.c11a58","group":"e815e384.db1578","order":5,"width":8,"height":1,"name":"","label":"A Obiettivo","format":"{{msg.payload[1].Value}}","layout":"row-spread","x":356,"y":946,"wires":[]},{"id":"851cced9.bd85f","type":"ui_text","z":"7404b076.c11a58","group":"e815e384.db1578","order":6,"width":8,"height":1,"name":"","label":"A Metri Fatti","format":"{{msg.payload[14].Value}}","layout":"row-spread","x":358,"y":990,"wires":[]},{"id":"a175872c.054518","type":"comment","z":"7404b076.c11a58","name":"Platform A","info":"","x":108,"y":810,"wires":[]},{"id":"51d55fb0.6c6e5","type":"comment","z":"7404b076.c11a58","name":"Platform B","info":"","x":688,"y":810,"wires":[]},{"id":"aa6b2580.f006d8","type":"function","z":"7404b076.c11a58","name":"Mode B","func":"if (msg.payload[7].Value == 0) {\n   msg.payload = {\n    \"BMode\" : \"Standby\"\n   } \n} else if (msg.payload[7].Value == 1) {\n   msg.payload = {\n    \"BMode\" : \"Auto\",\n   } \n} else if (msg.payload[7].Value == 2) {\n   msg.payload = {\n    \"BMode\" : \"Auto - Pausa\",\n   } \n} else if (msg.payload[7].Value == 3) {\n   msg.payload = {\n    \"BMode\" : \"Blasting Manuale\",\n   } \n}\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":788,"y":730,"wires":[["e90af1f2.1813c"]]},{"id":"6a6b27fd.274dc8","type":"function","z":"7404b076.c11a58","name":"Mode A","func":"if (msg.payload[6].Value == 0) {\n   msg.payload = {\n    \"AMode\" : \"Standby\"\n   } \n} else if (msg.payload[6].Value == 1) {\n   msg.payload = {\n    \"AMode\" : \"Auto\",\n   } \n} else if (msg.payload[6].Value == 2) {\n   msg.payload = {\n    \"AMode\" : \"Auto - Pausa\",\n   } \n} else if (msg.payload[6].Value == 3) {\n   msg.payload = {\n    \"AMode\" : \"Blasting Manuale\",\n   } \n}\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":288,"y":750,"wires":[["20a5b5d1.33700a"]]},{"id":"586558fd.582de8","type":"ui_gauge","z":"7404b076.c11a58","name":"","group":"e815e384.db1578","order":9,"width":0,"height":0,"gtype":"gage","title":"A modalità Lavoro","label":"Mode","format":"{{msg.payload[6].Value}}","min":"0","max":"3","colors":["#00b500","#e6e600","#75fdff"],"seg1":"1","seg2":"2","x":398,"y":1030,"wires":[]},{"id":"5ee32562.1521cc","type":"ui_text","z":"7404b076.c11a58","group":"84de5e5.332b7a","order":1,"width":8,"height":1,"name":"","label":"N° Commessa","format":"{{msg.payload[0].Value}}","layout":"row-spread","x":648,"y":870,"wires":[]},{"id":"1507ba34.a24d26","type":"ui_text","z":"7404b076.c11a58","group":"84de5e5.332b7a","order":2,"width":8,"height":1,"name":"","label":"Cliente","format":"{{msg.payload[3].Value}}","layout":"row-spread","x":628,"y":906,"wires":[]},{"id":"50dcc9e.cddea38","type":"ui_text","z":"7404b076.c11a58","group":"84de5e5.332b7a","order":3,"width":8,"height":1,"name":"","label":"B Minuti Lavorati","format":"{{msg.payload[13].Value}}","layout":"row-spread","x":658,"y":990,"wires":[]},{"id":"e90af1f2.1813c","type":"ui_text","z":"7404b076.c11a58","group":"84de5e5.332b7a","order":7,"width":8,"height":1,"name":"","label":"B Modalità di Lavoro","format":"{{msg.payload.BMode}}","layout":"row-spread","x":866,"y":906,"wires":[]},{"id":"2eab7986.29ba26","type":"ui_text","z":"7404b076.c11a58","group":"84de5e5.332b7a","order":8,"width":8,"height":1,"name":"","label":"B Posizione Attuale","format":"{{msg.payload[9].Value}}","layout":"row-spread","x":656,"y":946,"wires":[]},{"id":"cc831216.79706","type":"ui_text","z":"7404b076.c11a58","group":"84de5e5.332b7a","order":4,"width":8,"height":1,"name":"","label":"n° Giorno di Lavorazione","format":"{{msg.payload[5].Value}}","layout":"row-spread","x":876,"y":866,"wires":[]},{"id":"abc2de94.29c56","type":"ui_text","z":"7404b076.c11a58","group":"84de5e5.332b7a","order":5,"width":8,"height":1,"name":"","label":"B Obiettivo","format":"{{msg.payload[2].Value}}","layout":"row-spread","x":836,"y":946,"wires":[]},{"id":"34895aa8.5cc1f6","type":"ui_text","z":"7404b076.c11a58","group":"84de5e5.332b7a","order":6,"width":8,"height":1,"name":"","label":"B Metri Fatti","format":"{{msg.payload[15].Value}}","layout":"row-spread","x":838,"y":990,"wires":[]},{"id":"acede667.9f6e08","type":"ui_gauge","z":"7404b076.c11a58","name":"","group":"84de5e5.332b7a","order":9,"width":0,"height":0,"gtype":"gage","title":"A modalità Lavoro","label":"Mode","format":"{{msg.payload[7].Value}}","min":"0","max":"3","colors":["#00b500","#e6e600","#75fdff"],"seg1":"1","seg2":"2","x":878,"y":1030,"wires":[]},{"id":"31bc03b9.447fdc","type":"comment","z":"7404b076.c11a58","name":"File Browser","info":"","x":110,"y":40,"wires":[]},{"id":"47abb352.08104c","type":"ui_button","z":"7404b076.c11a58","name":"","group":"c2fd866.c43df78","order":1,"width":"3","height":"1","passthru":false,"label":"Aggiorna","tooltip":"","color":"","bgcolor":"","icon":"refresh","payload":"","payloadType":"str","topic":"","topicType":"str","x":114,"y":76,"wires":[["53b88022.09ef4"]]},{"id":"234142ab.8a516e","type":"ui_dropdown","z":"7404b076.c11a58","name":"File Selector","label":"","tooltip":"","place":"Seleziona File","group":"c2fd866.c43df78","order":2,"width":"10","height":"1","passthru":false,"multiple":false,"options":[{"label":"","value":"","type":"str"}],"payload":"","topic":"","topicType":"str","x":758,"y":74,"wires":[["ab5861cf.99dc7"]]},{"id":"e84d5d19.66efd","type":"function","z":"7404b076.c11a58","name":"Format data","func":"msg.options = [];\nfor (var i=0; i<msg.payload.length; i++) {\n    obj = {};\n    obj [msg.payload[i].name]=msg.payload[i].name;\n    msg.options.push(obj);\n}\nmsg.payload={};\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":558,"y":74,"wires":[["234142ab.8a516e"]]},{"id":"7b2c59a.75cc5a8","type":"ui_template","z":"7404b076.c11a58","group":"c2fd866.c43df78","name":"","order":4,"width":"18","height":"6","format":"<div ng-bind-html=\"msg.payload\" height=\"400\" style=\"height: 400px;\"><br/>\n</div>\n\n","storeOutMessages":true,"fwdInMessages":true,"resendOnRefresh":true,"templateScope":"local","x":948,"y":134,"wires":[[]]},{"id":"4883894f.b048d8","type":"template","z":"7404b076.c11a58","name":"","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"<table width=\"100%\">\n    <tr><th>Nome File</th><th>Kb</th><th>Creato il:</th><th>Modificato</th></tr>\n    {{#payload}}\n        <tr>\n            <td><a href=\"/download?filename={{name}}\" target=\"blank\">{{fname}}</a></td>\n            <td>{{stat.size}}</td>\n            <td>{{stat.created}}</td>\n            <td>{{stat.changed}}</td>\n        </tr>\n    {{/payload}}\n</table>\n","output":"str","x":788,"y":134,"wires":[["7b2c59a.75cc5a8"]]},{"id":"4795497.8c063b8","type":"function","z":"7404b076.c11a58","name":"Convert timestamps","func":"\nfor (var i=0; i<msg.payload.length; i++) {\n    msg.payload[i].stat.created = msg.payload[i].stat.created.toISOString().slice(0, 19).replace('T', ' ');\n    msg.payload[i].stat.changed = msg.payload[i].stat.changed.toISOString().slice(0, 19).replace('T', ' ');\n    msg.payload[i].stat.accessed = msg.payload[i].stat.accessed.toISOString().slice(0, 19).replace('T', ' ');\n    msg.payload[i].stat.statusChanged = msg.payload[i].stat.statusChanged.toISOString().slice(0, 19).replace('T', ' ');\n    msg.payload[i].fname = msg.payload[i].name.replace(/^.*(\\\\|\\/|\\:)/, '');\n}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":602,"y":128,"wires":[["4883894f.b048d8"]]},{"id":"ab5861cf.99dc7","type":"function","z":"7404b076.c11a58","name":"Save selection","func":"// Save the file name selected from the dropdown in the flow context\nflow.set(\"fileselected\", msg.payload);\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":988,"y":74,"wires":[[]]},{"id":"642f3396.b873ac","type":"ui_button","z":"7404b076.c11a58","name":"","group":"c2fd866.c43df78","order":3,"width":"2","height":"1","passthru":false,"label":"Cancella File","tooltip":"","color":"","bgcolor":"","icon":"delete","payload":"","payloadType":"str","topic":"","topicType":"str","x":110,"y":166,"wires":[["fd962665.c49108"]]},{"id":"fd962665.c49108","type":"function","z":"7404b076.c11a58","name":"Get filename","func":"// Get the filename from the flow context\nlet filename = flow.get(\"fileselected\");\n\n// check, if the filename is undefined that means it does not exist yet, nothing is selected yet\n// return: do not output anything\nif (filename===undefined) {\n    return;\n}\n\n// return the filename to the file-in node to delete\nmsg.filename = filename;\n\n// and delete the context/selection as we are deleting the file as well\nflow.set(\"fileselected\");\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":272,"y":166,"wires":[["cc1b33.e9b824d"]]},{"id":"cc1b33.e9b824d","type":"file","z":"7404b076.c11a58","name":"Delete file","filename":"","appendNewline":true,"createDir":false,"overwriteFile":"delete","encoding":"none","x":424,"y":166,"wires":[["53b88022.09ef4"]]},{"id":"2a592fae.dc7f7","type":"http in","z":"7404b076.c11a58","name":"","url":"/download","method":"get","upload":false,"swaggerDoc":"","x":120,"y":220,"wires":[["3cd1b71e.3167c8"]]},{"id":"983fdd65.bdb99","type":"http response","z":"7404b076.c11a58","name":"","statusCode":"","headers":{},"x":910,"y":220,"wires":[]},{"id":"3cd1b71e.3167c8","type":"function","z":"7404b076.c11a58","name":"Get the file name","func":"msg.filename = msg.req.query.filename;\nmsg.contentdisposition = \"attachment; filename=\\\"\" + msg.req.query.filename.replace(/^.*(\\\\|\\/|\\:)/, '') + \"\\\"\";\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":370,"y":220,"wires":[["ea28ae9d.a3048"]]},{"id":"ea28ae9d.a3048","type":"file in","z":"7404b076.c11a58","name":"","filename":"","format":"","chunk":false,"sendError":false,"encoding":"none","x":560,"y":220,"wires":[["a93edcff.e61d9"]]},{"id":"a93edcff.e61d9","type":"change","z":"7404b076.c11a58","name":"Set Headers","rules":[{"t":"set","p":"headers","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"headers.content-type","pt":"msg","to":"text/csv","tot":"str"},{"t":"set","p":"headers.Content-Disposition","pt":"msg","to":"contentdisposition","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":730,"y":220,"wires":[["983fdd65.bdb99"]]},{"id":"53b88022.09ef4","type":"fs-file-lister","z":"7404b076.c11a58","name":"","start":"C:\\\\Radens_csv\\\\Realtime","pattern":"*.*","folders":"*","hidden":true,"lstype":"files","path":true,"single":true,"depth":0,"stat":true,"showWarnings":true,"x":334,"y":76,"wires":[["e84d5d19.66efd","4795497.8c063b8"]]},{"id":"1f222a56.5f8d66","type":"function","z":"7404b076.c11a58","name":"","func":"\n\nif (msg.statusCode == 200) {\n    msg.payload = 1;\n} else {\n    msg.payload = 0;\n}\n\nreturn msg;\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":720,"y":580,"wires":[["98b5f903.891dd8"]]},{"id":"3aeb9717.a95908","type":"switch","z":"7404b076.c11a58","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":900,"y":700,"wires":[[]]},{"id":"98b5f903.891dd8","type":"ui_switch","z":"7404b076.c11a58","name":"Stato: Spenta/Accesa","label":"STATO:","tooltip":"","group":"2ac2921a.7174be","order":0,"width":0,"height":0,"passthru":false,"decouple":"true","topic":"topic","topicType":"msg","style":"","onvalue":"1","onvalueType":"num","onicon":"","oncolor":"","offvalue":"0","offvalueType":"num","officon":"","offcolor":"","animate":false,"x":940,"y":640,"wires":[[]]},{"id":"2d6c4d4e.969c82","type":"debug","z":"7404b076.c11a58","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":757,"y":671,"wires":[]},{"id":"25d7de5d.240782","type":"debug","z":"7404b076.c11a58","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":610,"y":620,"wires":[]},{"id":"40e8eb70.1dd6c4","type":"ui_text","z":"7404b076.c11a58","group":"84de5e5.332b7a","order":6,"width":8,"height":1,"name":"B_PosMax","label":"B Posizione Max Raggiunta","format":"{{msg.payload[10].Value}}","layout":"row-spread","x":650,"y":1040,"wires":[]},{"id":"86ff666.0bdce98","type":"ui_text","z":"7404b076.c11a58","group":"e815e384.db1578","order":6,"width":8,"height":1,"name":"A_PosMax","label":"B Posizione Max Raggiunta","format":"{{msg.payload[11].Value}}","layout":"row-spread","x":190,"y":1040,"wires":[]},{"id":"4201a4f9.5bcbd4","type":"ui_group","name":"Invio Parametri Commessa","tab":"b0a961d2.482c3","order":1,"disp":true,"width":8,"collapse":false},{"id":"e815e384.db1578","type":"ui_group","name":"Dati in tempo Reale Piattaforma A","tab":"59c3aa80.618b3c","order":2,"disp":true,"width":"8","collapse":false},{"id":"cd2429b5.1a0608","type":"ui_group","name":"Ultimi Dati Inviati","tab":"b0a961d2.482c3","order":2,"disp":true,"width":"8","collapse":false},{"id":"84de5e5.332b7a","type":"ui_group","name":"Dati in tempo Reale Piattaforma B","tab":"59c3aa80.618b3c","order":3,"disp":true,"width":8,"collapse":false},{"id":"c2fd866.c43df78","type":"ui_group","name":"File Dati Produzione Campionati","tab":"5620aa67.e1f2d4","order":2,"disp":true,"width":"18","collapse":false},{"id":"2ac2921a.7174be","type":"ui_group","name":"Stato Macchina:","tab":"59c3aa80.618b3c","order":4,"disp":true,"width":"6","collapse":false},{"id":"b0a961d2.482c3","type":"ui_tab","name":"Parametri Commessa","icon":"fa-download","order":2,"disabled":false,"hidden":false},{"id":"59c3aa80.618b3c","type":"ui_tab","name":"Lettura Produzione","icon":"dashboard","order":3,"disabled":false,"hidden":false},{"id":"5620aa67.e1f2d4","type":"ui_tab","name":"Leggi CSV","icon":"fa-file-text","disabled":false,"hidden":false}]