[ { "id": "866bd16b214c1d1d", "type": "pdfparse", "z": "16d18688641889fe", "name": "", "path": "/tmp/Grille_prix_Tarif_Bleu.pdf", "x": 460, "y": 580, "wires": [ [ "a0349e7017779b4a" ] ] }, { "id": "bf708d78a507d9c3", "type": "http request", "z": "16d18688641889fe", "name": "", "method": "GET", "ret": "bin", "paytoqs": "ignore", "url": "https://particulier.edf.fr/content/dam/2-Actifs/Documents/Offres/Grille_prix_Tarif_Bleu.pdf", "tls": "", "persist": false, "proxy": "", "insecureHTTPParser": false, "authType": "", "senderr": false, "headers": [], "x": 370, "y": 520, "wires": [ [ "c6602cec6bea28ca" ] ] }, { "id": "4c17b4c529dadc65", "type": "debug", "z": "16d18688641889fe", "name": "prix tempo", "active": true, "tosidebar": true, "console": false, "tostatus": false, "complete": "payload", "targetType": "msg", "statusVal": "", "statusType": "auto", "x": 890, "y": 740, "wires": [] }, { "id": "c6602cec6bea28ca", "type": "file", "z": "16d18688641889fe", "name": "", "filename": "/tmp/Grille_prix_Tarif_Bleu.pdf", "filenameType": "str", "appendNewline": true, "createDir": false, "overwriteFile": "true", "encoding": "none", "x": 230, "y": 580, "wires": [ [ "866bd16b214c1d1d" ] ] }, { "id": "a0349e7017779b4a", "type": "change", "z": "16d18688641889fe", "name": "Texte", "rules": [ { "t": "set", "p": "payload", "pt": "msg", "to": "payload.text", "tot": "msg" } ], "action": "", "property": "", "from": "", "to": "", "reg": false, "x": 610, "y": 580, "wires": [ [ "d23eb75a79c8996d" ] ] }, { "id": "d23eb75a79c8996d", "type": "function", "z": "16d18688641889fe", "name": "Après \"Option Tempo\"", "func": "const regex = /Option Tempo((.|\\n)*)/gm;\nconst found = msg.payload.match(regex);\nmsg.payload = found[0];\nreturn msg;", "outputs": 1, "timeout": 0, "noerr": 0, "initialize": "", "finalize": "", "libs": [], "x": 420, "y": 660, "wires": [ [ "09faecd167fed230" ] ] }, { "id": "09faecd167fed230", "type": "function", "z": "16d18688641889fe", "name": "12 kVA", "func": "const regex = /12 .*/gm; // puissance souscrite\nconst found = msg.payload.match(regex);\nconst searchRegExp = /,/g; // remplace les virgules par des points\nconst replaceWith = '.';\nmsg.payload = found[0];\nmsg.payload = msg.payload.replace(searchRegExp, replaceWith);\nreturn msg;", "outputs": 1, "timeout": 0, "noerr": 0, "initialize": "", "finalize": "", "libs": [], "x": 620, "y": 660, "wires": [ [ "e7ca8ee4d891c581" ] ] }, { "id": "e7ca8ee4d891c581", "type": "split", "z": "16d18688641889fe", "name": "", "splt": " ", "spltType": "str", "arraySplt": 1, "arraySpltType": "len", "stream": false, "addname": "", "x": 450, "y": 740, "wires": [ [ "9f3df8ae0bd5d4bf" ] ] }, { "id": "9f3df8ae0bd5d4bf", "type": "join", "z": "16d18688641889fe", "name": "", "mode": "custom", "build": "array", "property": "payload", "propertyType": "msg", "key": "topic", "joiner": "\\n", "joinerType": "str", "accumulate": false, "timeout": "", "count": "", "reduceRight": false, "reduceExp": "", "reduceInit": "", "reduceInitType": "num", "reduceFixup": "", "x": 590, "y": 740, "wires": [ [ "88eaf52f02be48c8" ] ] }, { "id": "88eaf52f02be48c8", "type": "function", "z": "16d18688641889fe", "name": "JSON", "func": "msg.payload = {\n \"puissance\": msg.payload[0],\n \"prix_abonnement\": Number((Number(msg.payload[1]) * 12).toFixed(2)),\n \"prix_HCJB\": Number(Number(msg.payload[2] / 100).toFixed(4)),\n \"prix_HPJB\": Number(Number(msg.payload[3] / 100).toFixed(4)),\n \"prix_HCJW\": Number(Number(msg.payload[4] / 100).toFixed(4)),\n \"prix_HPJW\": Number(Number(msg.payload[5] / 100).toFixed(4)),\n \"prix_HCJR\": Number(Number(msg.payload[6] / 100).toFixed(4)),\n \"prix_HPJR\": Number(Number(msg.payload[7] / 100).toFixed(4)),\n}\nreturn msg;", "outputs": 1, "timeout": "", "noerr": 0, "initialize": "", "finalize": "", "libs": [], "x": 730, "y": 740, "wires": [ [ "4c17b4c529dadc65", "d96424abf723fcd2" ] ] }, { "id": "1316dbce795332d5", "type": "inject", "z": "16d18688641889fe", "name": "Tous les jours à 9h30", "props": [ { "p": "payload" } ], "repeat": "", "crontab": "30 09 * * *", "once": false, "onceDelay": 0.1, "topic": "", "payload": "", "payloadType": "date", "x": 160, "y": 520, "wires": [ [ "bf708d78a507d9c3" ] ] } ]