# Tutorial - TEMPO tariff update (automatic PDF update)

**URL:** <https://community.gladysassistant.com/t/tuto-mise-a-jour-du-tarif-tempo-mise-a-jour-via-pdf-en-auto/9241>\
**Category:** Tutoriels\
**Tags:** tutoriel\
**Created:** [December 12, 2024, 1:45pm UTC](https://community.gladysassistant.com/t/tuto-mise-a-jour-du-tarif-tempo-mise-a-jour-via-pdf-en-auto/9241 "2024-12-12T13:45:40Z")\
**Posts on this page:** 17\
**Page:** 1

<div class="post-metadata">

**Author:** ![prohand](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/prohand/32/15713_2.png) [@prohand](https://community.gladysassistant.com/u/prohand)\
**Post date:** [December 12, 2024, 1:45pm UTC](https://community.gladysassistant.com/t/tuto-mise-a-jour-du-tarif-tempo-mise-a-jour-via-pdf-en-auto/9241/1 "2024-12-12T13:45:40Z")

</div>

Hello everyone,

As promised in the tutorial by @mutmut: (Thanks to him for this tutorial)

> [@\[TUTORIAL\] TEMPO tariff update](https://community.gladysassistant.com/t/tuto-mise-a-jour-du-tarif-tempo/9218):
>
> Hello Team, following the setup of [Tuto - Domotiser son lave linge avec une prise connectée](https://community.gladysassistant.com/t/tuto-domotiser-son-lave-linge-avec-une-prise-connectee/8824) and [Tuto - Récupérer le prix de son abonnement d'électricité via le site data.gouv.fr - Tarifs hors tempo](https://community.gladysassistant.com/t/tuto-recuperer-le-prix-de-son-abonnement-delectricite-via-le-site-data-gouv-fr/8838) by @prohand, I needed to modify the retrieval of the electricity cost for my TEMPO subscription. Here is the result on my dashboard : I didn’t find any opendata that could be integrated via node-red so I went with scenes and the rates are hardcoded unfortunately.

And following my tutorial that allows retrieving off-peak rates:

> [@Tutorial - Retrieve the price of your electricity subscription via data.gouv.fr - Tariffs excluding Tempo](https://community.gladysassistant.com/t/tuto-recuperer-le-prix-de-son-abonnement-delectricite-via-le-site-data-gouv-fr-tarifs-hors-tempo/8838):
>
> Hello, I see you showing here how to retrieve the electricity rate with Node-RED via the file: [https://www.data.gouv.fr/fr/datasets/r/c13d05e5-9e55-4d03-bf7e-042a2ade7e49](https://www.data.gouv.fr/fr/datasets/r/c13d05e5-9e55-4d03-bf7e-042a2ade7e49) and then transfer it to an MQTT topic to use it in Gladys wink This file can be found here: [https://www.data.gouv.fr/fr/datasets/historique-des-tarifs-reglementes-de-vente-delectricite-pour-les-consommateurs-residentiels/](https://www.data.gouv.fr/fr/datasets/historique-des-tarifs-reglementes-de-vente-delectricite-pour-les-consommateurs-residentiels/) This tutorial is compatible with the «&nbsp;Base&nbsp;» option only because it is the option associated with my …

I wanted to see how to automate the retrieval of the different costs.

I then came across this Jeedom tutorial (Thanks to its author), which I heavily drew inspiration from, including copying the Node-RED code:

> **[Tarif EDF TEMPO instantané](https://community.jeedom.com/t/tarif-edf-tempo-instantane/114531/9)**
>
> J’ai fait une adaptation à partir du fichier d’EDF en utilisant le module pdfparse. Cela vaut ce que ça vaut. Je me dis que c’est mis à jour plus rapidement que l’autre page et qu’il y a peut-être moins de changement de forme côté EDF. Je suppose...

The goal here is to retrieve the PDF file of the Tempo tariff grid directly from the EDF website to update the values directly in Gladys and have the real cost per kWh ready to use in other scenes 🙂

The file can be found here:  
[https://particulier.edf.fr/content/dam/2-Actifs/Documents/Offres/Grille\_prix\_Tarif\_Bleu.pdf](https://particulier.edf.fr/content/dam/2-Actifs/Documents/Offres/Grille_prix_Tarif_Bleu.pdf)

We just have to hope that the structure/composition of the file is not changed by EDF 😁

The final result:

![image](https://gladys-assistant-community.b-cdn.net/uploads/default/original/3X/7/e/7ee1432db7f07c01d84836d6435ac0e3c1a6de7c.png)

Here is the Node-Red flow:  
(An error catch is present to retrieve errors and send them by email)

 ![image](https://gladys-assistant-community.b-cdn.net/uploads/default/original/3X/1/f/1ff2d422841d4cbcb75e9bb887e6afd40901138a.png)

```auto
[
    {
        "id": "670838a9edef0758",
        "type": "catch",
        "z": "d6333988d9cfb817",
        "name": "Errors",
        "scope": null,
        "uncaught": false,
        "x": 110,
        "y": 60,
        "wires": [
            [
                "c097dad994334b5e"
            ]
        ]
    },
    {
        "id": "c097dad994334b5e",
        "type": "e-mail",
        "z": "d6333988d9cfb817",
        "server": "myemailserver",
        "port": "465",
        "authtype": "BASIC",
        "saslformat": false,
        "token": "oauth2Response.access_token",
        "secure": true,
        "tls": true,
        "name": "myaddress@email.fr",
        "dname": "Mail",
        "x": 250,
        "y": 60,
        "wires": []
    },
    {
        "id": "bf708d78a507d9c3",
        "type": "http request",
        "z": "d6333988d9cfb817",
        "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": 430,
        "y": 140,
        "wires": [
            [
                "c6602cec6bea28ca"
            ]
        ]
    },
    {
        "id": "c6602cec6bea28ca",
        "type": "file",
        "z": "d6333988d9cfb817",
        "name": "",
        "filename": "/tmp/Grille_prix_Tarif_Bleu.pdf",
        "filenameType": "str",
        "appendNewline": true,
        "createDir": false,
        "overwriteFile": "true",
        "encoding": "none",
        "x": 290,
        "y": 200,
        "wires": [
            [
                "866bd16b214c1d1d"
            ]
        ]
    },
    {
        "id": "a0349e7017779b4a",
        "type": "change",
        "z": "d6333988d9cfb817",
        "name": "Text",
        "rules": [
            {
                "t": "set",
                "p": "payload",
                "pt": "msg",
                "to": "payload.text",
                "tot": "msg"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 670,
        "y": 200,
        "wires": [
            [
                "d23eb75a79c8996d"
            ]
        ]
    },
    {
        "id": "d23eb75a79c8996d",
        "type": "function",
        "z": "d6333988d9cfb817",
        "name": "After \"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": 480,
        "y": 280,
        "wires": [
            [
                "09faecd167fed230"
            ]
        ]
    },
    {
        "id": "09faecd167fed230",
        "type": "function",
        "z": "d6333988d9cfb817",
        "name": "6 kVA",
        "func": "const regex = /^12\b.*$/gm; // subscribed power\nconst found = msg.payload.match(regex);\nconst searchRegExp = /,/g; // replace commas with dots\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": 670,
        "y": 280,
        "wires": [
            [
                "e7ca8ee4d891c581"
            ]
        ]
    },
    {
        "id": "e7ca8ee4d891c581",
        "type": "split",
        "z": "d6333988d9cfb817",
        "name": "",
        "splt": " ",
        "spltType": "str",
        "arraySplt": 1,
        "arraySpltType": "len",
        "stream": false,
        "addname": "",
        "x": 510,
        "y": 360,
        "wires": [
            [
                "9f3df8ae0bd5d4bf"
            ]
        ]
    },
    {
        "id": "9f3df8ae0bd5d4bf",
        "type": "join",
        "z": "d6333988d9cfb817",
        "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": 650,
        "y": 360,
        "wires": [
            [
                "88eaf52f02be48c8"
            ]
        ]
    },
    {
        "id": "88eaf52f02be48c8",
        "type": "function",
        "z": "d6333988d9cfb817",
        "name": "JSON",
        "func": "msg.payload = {\n \"power\": msg.payload[0],\n \"subscription_price\": Number((Number(msg.payload[1]) * 12).toFixed(2)),\n \"HCJB_price\": Number(Number(msg.payload[2] / 100).toFixed(4)),\n \"HPJB_price\": Number(Number(msg.payload[3] / 100).toFixed(4)),\n \"HCJW_price\": Number(Number(msg.payload[4] / 100).toFixed(4)),\n \"HPJW_price\": Number(Number(msg.payload[5] / 100).toFixed(4)),\n \"HCJR_price\": Number(Number(msg.payload[6] / 100).toFixed(4)),\n \"HPJR_price\": Number(Number(msg.payload[7] / 100).toFixed(4)),\n}\nreturn msg;",
        "outputs": 1,
        "timeout": "",
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 790,
        "y": 360,
        "wires": [
            [
                "6e2b78e27c34c026",
                "4d19e36f157bd2c0",
                "50608e9e9bdecdc6",
                "d9fe4a5ac7c52d90",
                "b4a2b0d2177a9058",
                "c5f9959555f3e7b9"
            ]
        ]
    },
    {
        "id": "1316dbce795332d5",
        "type": "inject",
        "z": "d6333988d9cfb817",
        "name": "Every day at 9:30 AM",
        "props": [
            {
                "p": "payload"
            }
        ],
        "repeat": "",
        "crontab": "30 09 * * *",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "",
        "payloadType": "date",
        "x": 220,
        "y": 140,
        "wires": [
            [
                "bf708d78a507d9c3"
            ]
        ]
    },
    {
        "id": "866bd16b214c1d1d",
        "type": "pdfparse",
        "z": "d6333988d9cfb817",
        "name": "",
        "path": "/tmp/Grille_prix_Tarif_Bleu.pdf",
        "x": 520,
        "y": 200,
        "wires": [
            [
                "a0349e7017779b4a"
            ]
        ]
    },
    {
        "id": "6e2b78e27c34c026",
        "type": "function",
        "z": "d6333988d9cfb817",
        "name": "Blue day HC",
        "func": "msg.payload = msg.payload.HCJB_price;\nmsg.payload = parseFloat(msg.payload);\nreturn msg;",
        "outputs": 1,
        "timeout": 0,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 960,
        "y": 300,
        "wires": [
            [
                "0a6e473635b8b423"
            ]
        ]
    },
    {
        "id": "4d19e36f157bd2c0",
        "type": "function",
        "z": "d6333988d9cfb817",
        "name": "Blue day HP",
        "func": "msg.payload = msg.payload.HPJB_price;\nmsg.payload = parseFloat(msg.payload);\nreturn msg;",
        "outputs": 1,
        "timeout": 0,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 960,
        "y": 340,
        "wires": [
            [
                "69c1fb09c3ede0e0"
            ]
        ]
    },
    {
        "id": "50608e9e9bdecdc6",
        "type": "function",
        "z": "d6333988d9cfb817",
        "name": "White day HC",
        "func": "msg.payload = msg.payload.HCJW_price;\nmsg.payload = parseFloat(msg.payload);\nreturn msg;",
        "outputs": 1,
        "timeout": 0,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 970,
        "y": 380wires": [
            [
                "467f6ce03f7ed6c0"
            ]
        ]
    },
    {
        "id": "d9fe4a5ac7c52d90",
        "type": "function",
        "z": "d6333988d9cfb817",
        "name": "White day HP",
        "func": "msg.payload = msg.payload.prix_HPJW;\nmsg.payload = parseFloat(msg.payload);\nreturn msg;",
        "outputs": 1,
        "timeout": 0,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 970,
        "y": 420,
        "wires": [
            [
                "ed628e4d71dbbc38"
            ]
        ]
    },
    {
        "id": "b4a2b0d2177a9058",
        "type": "function",
        "z": "d6333988d9cfb817",
        "name": "Red day HC",
        "func": "msg.payload = msg.payload.prix_HCJR;\nmsg.payload = parseFloat(msg.payload);\nreturn msg;",
        "outputs": 1,
        "timeout": 0,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 970,
        "y": 460,
        "wires": [
            [
                "f2b3869570196614"
            ]
        ]
    },
    {
        "id": "c5f9959555f3e7b9",
        "type": "function",
        "z": "d6333988d9cfb817",
        "name": "Red day HP",
        "func": "msg.payload = msg.payload.prix_HPJR;\nmsg.payload = parseFloat(msg.payload);\nreturn msg;",
        "outputs": 1,
        "timeout": 0,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 970,
        "y": 500,
        "wires": [
            [
                "ae1d548f6cb679aa"
            ]
        ]
    },
    {
        "id": "0a6e473635b8b423",
        "type": "mqtt out",
        "z": "d6333988d9cfb817",
        "name": "",
        "topic": "gladys/master/device/mqtt:edf/feature/mqtt:cout-abonnement-jour-bleu-hc/state",
        "qos": "2",
        "retain": "true",
        "respTopic": "",
        "contentType": "",
        "userProps": "",
        "correl": "",
        "expiry": "",
        "broker": "0ee77e0f90aa9681",
        "x": 1370,
        "y": 300,
        "wires": []
    },
    {
        "id": "69c1fb09c3ede0e0",
        "type": "mqtt out",
        "z": "d6333988d9cfb817",
        "name": "",
        "topic": "gladys/master/device/mqtt:edf/feature/mqtt:cout-abonnement-jour-bleu-hp/state",
        "qos": "2",
        "retain": "true",
        "respTopic": "",
        "contentType": "",
        "userProps": "",
        "correl": "",
        "expiry": "",
        "broker": "0ee77e0f90aa9681",
        "x": 1370,
        "y": 340,
        "wires": []
    },
    {
        "id": "467f6ce03f7ed6c0",
        "type": "mqtt out",
        "z": "d6333988d9cfb817",
        "name": "",
        "topic": "gladys/master/device/mqtt:edf/feature/mqtt:cout-abonnement-jour-blanc-hc/state",
        "qos": "2",
        "retain": "true",
        "respTopic": "",
        "contentType": "",
        "userProps": "",
        "correl": "",
        "expiry": "",
        "broker": "0ee77e0f90aa9681",
        "x": 1370,
        "y": 380,
        "wires": []
    },
    {
        "id": "ed628e4d71dbbc38",
        "type": "mqtt out",
        "z": "d6333988d9cfb817",
        "name": "",
        "topic": "gladys/master/device/mqtt:edf/feature/mqtt:cout-abonnement-jour-blanc-hp/state",
        "qos": "2",
        "retain": "true",
        "respTopic": "",
        "contentType": "",
        "userProps": "",
        "correl": "",
        "expiry": "",
        "broker": "0ee77e0f90aa9681",
        "x": 1370,
        "y": 420,
        "wires": []
    },
    {
        "id": "f2b3869570196614",
        "type": "mqtt out",
        "z": "d6333988d9cfb817",
        "name": "",
        "topic": "gladys/master/device/mqtt:edf/feature/mqtt:cout-abonnement-jour-rouge-hc/state",
        "qos": "2",
        "retain": "true",
        "respTopic": "",
        "contentType": "",
        "userProps": "",
        "correl": "",
        "expiry": "",
        "broker": "0ee77e0f90aa9681",
        "x": 1370,
        "y": 460,
        "wires": []
    },
    {
        "id": "ae1d548f6cb679aa",
        "type": "mqtt out",
        "z": "d6333988d9cfb817",
        "name": "",
        "topic": "gladys/master/device/mqtt:edf/feature/mqtt:cout-abonnement-jour-rouge-hp/state",
        "qos": "2",
        "retain": "true",
        "respTopic": "",
        "contentType": "",
        "userProps": "",
        "correl": "",
        "expiry": "",
        "broker": "0ee77e0f90aa9681",
        "x": 1370,
        "y": 500,
        "wires": []
    },
    {
        "id": "0ee77e0f90aa9681",
        "type": "mqtt-broker",
        "name": "GLADYS-MQTT",
        "broker": "mqtt://192.168.0.248",
        "port": "1883",
        "clientid": "",
        "autoConnect": true,
        "usetls": false,
        "protocolVersion": "4",
        "keepalive": "60",
        "cleansession": true,
        "autoUnsubscribe": true,
        "birthTopic": "",
        "birthQos": "0",
        "birthRetain": "false",
        "birthPayload": "",
        "birthMsg": {},
        "closeTopic": "",
        "closeQos": "0",
        "closeRetain": "false",
        "closePayload": "",
        "closeMsg": {},
        "willTopic": "",
        "willQos": "0",
        "willRetain": "false",
        "willPayload": "",
        "willMsg": {},
        "userProps": "",
        "sessionExpiry": ""
    }
]

```

**Don’t forget to modify the subscribed power 🙂**

**Prerequisites:**

Install the node-red-contrib-pdfparse module:

 ![image](https://gladys-assistant-community.b-cdn.net/uploads/default/original/3X/6/4/643555429ddb4a9d80e63287044f32f5ee7ad6fc.png)

Here is the MQTT device with the features:

 ![image](https://gladys-assistant-community.b-cdn.net/uploads/default/original/3X/e/6/e6e76f7c1dafa912fead9e789aca5d84525257ab.png)  
 ![image](https://gladys-assistant-community.b-cdn.net/uploads/default/original/3X/2/c/2c515796a910636dcc264a6a2f840483bf0c7e1f.png)  
 ![image](https://gladys-assistant-community.b-cdn.net/uploads/default/original/3X/b/3/b39e8c838fb141c3c4ad7fc60663e324dee973e4.png)  
 ![image](https://gladys-assistant-community.b-cdn.net/uploads/default/original/3X/e/9/e999c18cd90a391a6a2ae8a7a28b063a55a32689.png)  
 ![image](https://gladys-assistant-community.b-cdn.net/uploads/default/original/3X/8/0/8041a5738a3e0c916b6c865b458da085f60f037f.png)

Here are the scenes:

White day - HC:

 ![image](https://gladys-assistant-community.b-cdn.net/uploads/default/original/3X/d/b/dbcaa0814319476acb1b48738e448ca550445e0f.png)  
 ![image](https://gladys-assistant-community.b-cdn.net/uploads/default/original/3X/1/6/16165c39e5929a97c8264417a1fa8133f23e1eee.png)  
 ![image](https://gladys-assistant-community.b-cdn.net/uploads/default/original/3X/7/e/7ea35649c796795a773d4206299eecf787e4d40e.png)  
 ![image](https://gladys-assistant-community.b-cdn.net/uploads/default/original/3X/7/1/715050b70c6c86eb17a2669b26bc014ffded98c1.png)  
 ![image](https://gladys-assistant-community.b-cdn.net/uploads/default/original/3X/b/c/bc37fb408858b8cf3134534cb2d19a09e89a4ec4.png)

White day - HP:

 ![image](https://gladys-assistant-community.b-cdn.net/uploads/default/original/3X/d/b/db298804a54f28bb0312de45e3a7093cb4c03b4b.png)  
 ![image](https://gladys-assistant-community.b-cdn.net/uploads/default/original/3X/1/6/16165c39e5929a97c8264417a1fa8133f23e1eee.png)  
 ![image](https://gladys-assistant-community.b-cdn.net/uploads/default/original/3X/3/f/3f9fbca8933b5fa95c6e7c2a9d06df636ef3d080.png)  
 ![image](https://gladys-assistant-community.b-cdn.net/uploads/default/original/3X/c/a/caef5a33e260cbea695ab80868ba7ecc44687cc2.png)  
 ![image](https://gladys-assistant-community.b-cdn.net/uploads/default/original/3X/9/a/9af39686dd7eb62d14caa90fa1cf27b4fd59f399.png)

Blue day - HC:

 ![image](https://gladys-assistant-community.b-cdn.net/uploads/default/original/3X/3/e/3e5a34deb285dc31efaf48716dc25702f28d9766.png)  
 ![image](https://gladys-assistant-community.b-cdn.net/uploads/default/original/3X/1/6/16165c39e5929a97c8264417a1fa8133f23e1eee.png)  
 ![image](https://gladys-assistant-community.b-cdn.net/uploads/default/original/3X/7/e/7ece8175a25cd2cadf557a32763c208565f50ae8.png)  
 ![image](https://gladys-assistant-community.b-cdn.net/uploads/default/original/3X/c/9/c9963a18f83c004c66d736254b309068e08c7980.png)  
 ![image](https://gladys-assistant-community.b-cdn.net/uploads/default/original/3X/d/1/d1b6977f11b300ab83033046e542277571e4aadb.png)

Blue day - HP:

 ![image](https://gladys-assistant-community.b-cdn.net/uploads/default/original/3X/1/1/1139ed426a1a57520ce446005a9a44f7a9ff1c6f.png)  
 ![image](https://gladys-assistant-community.b-cdn.net/uploads/default/original/3X/1/6/16165c39e5929a97c8264417a1fa8133f23e1eee.png)  
 ![image](https://gladys-assistant-community.b-cdn.net/uploads/default/original/3X/1/a/1a6457303fec2fa9fb9f4b65866a058d3a7f227e.png)  
 ![image](https://gladys-assistant-community.b-cdn.net/uploads/default/original/3X/b/0/b0c94fb4f1be04ac9c53003f930c240eac9b8dd6.png)  
 ![image](https://gladys-assistant-community.b-cdn.net/uploads/default/original/3X/1/5/15abbaa71555f607a3768b13e5beeabca680c13c.png)

Red day - HC:

 ![image](https://gladys-assistant-community.b-cdn.net/uploads/default/original/3X/e/2/e2c809cb7b91665790bfca97db25cac2c6996d2d.png)  
 ![image](https://gladys-assistant-community.b-cdn.net/uploads/default/original/3X/1/6/16165c39e5929a97c8264417a1fa8133f23e1eee.png)  
 ![image](https://gladys-assistant-community.b-cdn.net/uploads/default/original/3X/e/3/e3c118e86d77f3f78d8b06e7b3cfcdc3355e6199.png)  
 ![image](https://gladys-assistant-community.b-cdn.net/uploads/default/original/3X/c/2/c28e862fd0a4175cf0229f8e6ce37a3ec05430d5.png)  
 ![image](https://gladys-assistant-community.b-cdn.net/uploads/default/original/3X/2/7/272b115de235e5e3b959707199e57f86dbb9fda4.png)

Red day - HP:

 ![image](https://gladys-assistant-community.b-cdn.net/uploads/default/original/3X/6/5/6598c912e7c5cfacca7cc9140fb19cfe9d3a87fc.png)  
 ![image](https://gladys-assistant-community.b-cdn.net/uploads/default/original/3X/1/6/16165c39e5929a97c8264417a1fa8133f23e1eee.png)  
 ![image](https://gladys-assistant-community.b-cdn.net/uploads/default/original/3X/1/4/14a464414310c418d9399a74c693aef4c51d2c90.png)  
 ![image](https://gladys-assistant-community.b-cdn.net/uploads/default/original/3X/d/8/d83de4502fcbda951dee09536137a7148e556c9c.png)  
 ![image](https://gladys-assistant-community.b-cdn.net/uploads/default/original/3X/2/2/224169e92a839770d1894f61e96b4d24f0eb3039.png)

If you have any questions/comments, feel free to let me know 🙂

**Changelog to come:**

- None (Your comments 🙂 )

---

<div class="post-metadata">

**Author:** ![pierre-gilles](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/pierre-gilles/32/5886_2.png) [@pierre-gilles](https://community.gladysassistant.com/u/pierre-gilles)\
**Post date:** [December 12, 2024, 3:26pm UTC](https://community.gladysassistant.com/t/tuto-mise-a-jour-du-tarif-tempo-mise-a-jour-via-pdf-en-auto/9241/2 "2024-12-12T15:26:22Z")

</div>

Great tutorial! Thanks @prohand!

---

<div class="post-metadata">

**Author:** ![mutmut](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/mutmut/32/14064_2.png) [@mutmut](https://community.gladysassistant.com/u/mutmut)\
**Post date:** [December 13, 2024, 4:52pm UTC](https://community.gladysassistant.com/t/tuto-mise-a-jour-du-tarif-tempo-mise-a-jour-via-pdf-en-auto/9241/3 "2024-12-13T16:52:43Z")

</div>

Well done @prohand, I didn’t have the courage to add all my screenshots for all the HCHP&JourQuiVaBien cases 😉

Quick question about the triggers — why did you put one at 00:01? Doesn’t Gladys handle tracking from one day to the next?

EDIT: there’s a «&nbsp;Download CSV&nbsp;» paragraph dangling at the end of your flow (I removed it because I didn’t understand it) and for those who have a somewhat clean Node-RED like mine, I’d add that you need to install pdfparse:

 ![Screenshot 2024-12-13 at 18.28.56](https://gladys-assistant-community.b-cdn.net/uploads/default/original/3X/6/1/61ef763cca4c0b873072397d192aa13d58021c0d.png)  
Of course, don’t forget to configure your MQTT server (with login/password).

EDIT 2: @prohand which module did you use for mail?  
I’m having installation issues ☹

```auto
2024-12-13T18:18:42.602Z Installer : node-red-node-email 3.0.2

2024-12-13T18:18:42.699Z npm install --no-audit --no-update-notifier --no-fund --save --save-prefix=~ --production --engine-strict node-red-node-email@3.0.2
2024-12-13T18:18:43.732Z [err] npm
2024-12-13T18:18:43.733Z [err] WARN
2024-12-13T18:18:43.734Z [err] config production Use `--omit=dev` instead.
2024-12-13T18:18:45.070Z [err] npm
2024-12-13T18:18:45.071Z [err] ERR! code EBADENGINE
2024-12-13T18:18:45.075Z [err] npm
2024-12-13T18:18:45.076Z [err] ERR!
2024-12-13T18:18:45.076Z [err] engine Unsupported engine
2024-12-13T18:18:45.076Z [err] npm ERR!
2024-12-13T18:18:45.076Z [err]  
2024-12-13T18:18:45.076Z [err] engine Not compatible with your version of node/npm: node-red-node-email@3.0.2
2024-12-13T18:18:45.077Z [err] npm 
2024-12-13T18:18:45.077Z [err] ERR! notsup Not compatible with your version of node/npm: node-red-node-email@3.0.2
2024-12-13T18:18:45.077Z [err] npm ERR! notsup
2024-12-13T18:18:45.077Z [err] Required: {"node":">=18.0.0"}
2024-12-13T18:18:45.077Z [err] npm 
2024-12-13T18:18:45.077Z [err] ERR! notsup Actual: {"npm":"8.19.4","node":"v16.20.2"}
2024-12-13T18:18:45.082Z [err] 
2024-12-13T18:18:45.082Z [err] npm ERR!
2024-12-13T18:18:45.083Z [err] A complete log of this run can be found in:
2024-12-13T18:18:45.083Z [err] npm ERR! /data/.npm/_logs/2024-12-13T18_18_43_653Z-debug-0.log
2024-12-13T18:18:45.094Z rc=1

```

---

<div class="post-metadata">

**Author:** ![prohand](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/prohand/32/15713_2.png) [@prohand](https://community.gladysassistant.com/u/prohand)\
**Post date:** [December 16, 2024, 3:11pm UTC](https://community.gladysassistant.com/t/tuto-mise-a-jour-du-tarif-tempo-mise-a-jour-via-pdf-en-auto/9241/4 "2024-12-16T15:11:50Z")

</div>

Indeed, 00:01 is a mistake because

---

<div class="post-metadata">

**Author:** ![mutmut](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/mutmut/32/14064_2.png) [@mutmut](https://community.gladysassistant.com/u/mutmut)\
**Post date:** [December 19, 2024, 3:35pm UTC](https://community.gladysassistant.com/t/tuto-mise-a-jour-du-tarif-tempo-mise-a-jour-via-pdf-en-auto/9241/5 "2024-12-19T15:35:05Z")

</div>

Hello,  
I just noticed that I had installed the same node-red-node-email module as you but I only have 3.0.2 and you have 2.2.1, and the problem is that it requires Node.js \>18 for this module in the 3.x.x version ☹  
How did you manage to get that specific version?

I second the Node.js update if that’s possible of course 😉

> [@Upgrade node red avec nodejs 16.20.2 to 18.x ou 20.x](https://community.gladysassistant.com/t/upgrade-node-red-avec-nodejs-16-20-2-to-18-x-ou-20-x/9224?u=pierre-gilles):
>
> Hello, Un petit sondage pour voir si sa serait un problème pour vous d’uprade node-red avec nodejs en version 18.x ou 20.x Nous sommes en version de nodejs 16.20.x qui est EOL septembre 2023 [https://nodered.org/docs/faq/node-versions](https://nodered.org/docs/faq/node-versions)[https://nodered.org/about/releases/](https://nodered.org/about/releases/) J’aurai eu à minima besoin de la version 18 pour ce plugin et la récup des tarfis tempo sur un pdf : (Finalement plus besoin slight_smile ) La question du sondage est : Upgrade or not upgrade ? [sondage](https://community.gladysassistant.com/t/upgrade-node-red-avec-nodejs-16-20-2-to-18-x-ou-20-x/9224/1)

---

<div class="post-metadata">

**Author:** ![prohand](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/prohand/32/15713_2.png) [@prohand](https://community.gladysassistant.com/u/prohand)\
**Post date:** [December 19, 2024, 4:01pm UTC](https://community.gladysassistant.com/t/tuto-mise-a-jour-du-tarif-tempo-mise-a-jour-via-pdf-en-auto/9241/6 "2024-12-19T16:01:46Z")

</div>

Hello,

I probably downloaded it when it was the latest version, quite simply ^^  
If you find a way to install an older version, I’d be interested 🙂

---

<div class="post-metadata">

**Author:** ![mutmut](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/mutmut/32/14064_2.png) [@mutmut](https://community.gladysassistant.com/u/mutmut)\
**Post date:** [December 19, 2024, 4:33pm UTC](https://community.gladysassistant.com/t/tuto-mise-a-jour-du-tarif-tempo-mise-a-jour-via-pdf-en-auto/9241/7 "2024-12-19T16:33:23Z")

</div>

I’m struggling: I tried in a Docker console to run `npm i node-red-node-email@2.2.1`  
It says a new module is installed, others need updating, but nothing shows up in Node-RED, even after refreshing the web page.

So I wanted to disable the Node-RED integration from GLadys and enable it again.  
Result: I lost everything (flows and installed modules) 😢  
Disabling removes the container but also all the data saved on the mounted volume (/volume1/docker/gladysassistant/node-red in my case on a Syno). What a bummer 😬

I don’t know if this is normal behavior but it’s really stupid especially when you haven’t backed up that folder, @pierre-gilles can you tell us?

---

<div class="post-metadata">

**Author:** ![prohand](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/prohand/32/15713_2.png) [@prohand](https://community.gladysassistant.com/u/prohand)\
**Post date:** [December 19, 2024, 4:46pm UTC](https://community.gladysassistant.com/t/tuto-mise-a-jour-du-tarif-tempo-mise-a-jour-via-pdf-en-auto/9241/8 "2024-12-19T16:46:47Z")

</div>

Ouch, yeah that’s beyond my skills ^^  
That’s why I back up the entire VM every night on my end 🙂  
I also export my feeds to my email address just in case.  
Good luck to you 😐

---

<div class="post-metadata">

**Author:** ![pierre-gilles](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/pierre-gilles/32/5886_2.png) [@pierre-gilles](https://community.gladysassistant.com/u/pierre-gilles)\
**Post date:** [December 20, 2024, 8:09am UTC](https://community.gladysassistant.com/t/tuto-mise-a-jour-du-tarif-tempo-mise-a-jour-via-pdf-en-auto/9241/9 "2024-12-20T08:09:24Z")

</div>

> [@mutmut](#):
>
> I don’t know if this is normal behavior but it’s really dumb, especially when you haven’t saved this repo, @pierre-gilles could you tell us?

I’m not the developer of this integration but yes it’s the expected behavior 🙂

A small warning message would be welcome though!

I created an issue :

> <https://github.com/GladysAssistant/Gladys/issues/2188>

---

<div class="post-metadata">

**Author:** ![mutmut](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/mutmut/32/14064_2.png) [@mutmut](https://community.gladysassistant.com/u/mutmut)\
**Post date:** [January 31, 2025, 2:08pm UTC](https://community.gladysassistant.com/t/tuto-mise-a-jour-du-tarif-tempo-mise-a-jour-via-pdf-en-auto/9241/10 "2025-01-31T14:08:30Z")

</div>

@prohand tomorrow (Feb 1) we should normally know whether the file keeps the same name and, at worst, we’ll have to change the link in Node-RED 😉

---

<div class="post-metadata">

**Author:** ![prohand](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/prohand/32/15713_2.png) [@prohand](https://community.gladysassistant.com/u/prohand)\
**Post date:** [January 31, 2025, 2:22pm UTC](https://community.gladysassistant.com/t/tuto-mise-a-jour-du-tarif-tempo-mise-a-jour-via-pdf-en-auto/9241/11 "2025-01-31T14:22:44Z")

</div>

Hello,

You’ll tell me because I’m not keeping time at the moment 😉

---

<div class="post-metadata">

**Author:** ![mutmut](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/mutmut/32/14064_2.png) [@mutmut](https://community.gladysassistant.com/u/mutmut)\
**Post date:** [February 1, 2025, 6:07pm UTC](https://community.gladysassistant.com/t/tuto-mise-a-jour-du-tarif-tempo-mise-a-jour-via-pdf-en-auto/9241/12 "2025-02-01T18:07:43Z")

</div>

EDIT : Everything below is a pretty big mistake on my part but I’ll leave it for the thread’s history.

> **Résumé**
>
> The URL unfortunately changed, here is the new one: [https://particuliers.es.fr/sites/default/files/documents/2025.02.01\_PART\_TRV\_Bleu\_(INF456).pdf](https://particuliers.es.fr/sites/default/files/documents/2025.02.01_PART_TRV_Bleu_%28INF456%29.pdf)  
> And the table format too ☹  
> BEFORE :
> 
> ![image](https://gladys-assistant-community.b-cdn.net/uploads/default/original/3X/e/2/e28ce41438b923d58393c6df9d184e1674878a16.png)  
> NOW :  
> ![image](https://gladys-assistant-community.b-cdn.net/uploads/default/original/3X/c/0/c03126fbc93c79b5e70016b075035161ddcc63a6.png)  
> And since I’m terrible at Node-RED, the flow is out …  
> @prohand would you have a little time to modify the flow? Thanks in advance

---

<div class="post-metadata">

**Author:** ![prohand](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/prohand/32/15713_2.png) [@prohand](https://community.gladysassistant.com/u/prohand)\
**Post date:** [February 1, 2025, 6:44pm UTC](https://community.gladysassistant.com/t/tuto-mise-a-jour-du-tarif-tempo-mise-a-jour-via-pdf-en-auto/9241/13 "2025-02-01T18:44:41Z")

</div>

Ah darn ☹

I won’t have time over the next few days, unfortunately.

Besides, there’s nothing very complicated — you can give the current code to ChatGPT and ask it to adapt it to the new one.

For the current Node-RED flow, that’s what I did 😉

---

<div class="post-metadata">

**Author:** ![mutmut](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/mutmut/32/14064_2.png) [@mutmut](https://community.gladysassistant.com/u/mutmut)\
**Post date:** [February 1, 2025, 7:41pm UTC](https://community.gladysassistant.com/t/tuto-mise-a-jour-du-tarif-tempo-mise-a-jour-via-pdf-en-auto/9241/14 "2025-02-01T19:41:04Z")

</div>

I made a mistake because I’m with ES and not EDF, I took the ES file… I’m analyzing and looking for the EDF file.

---

<div class="post-metadata">

**Author:** ![mutmut](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/mutmut/32/14064_2.png) [@mutmut](https://community.gladysassistant.com/u/mutmut)\
**Post date:** [February 1, 2025, 7:50pm UTC](https://community.gladysassistant.com/t/tuto-mise-a-jour-du-tarif-tempo-mise-a-jour-via-pdf-en-auto/9241/15 "2025-02-01T19:50:36Z")

</div>

Hear ye, hear ye, I’m an idiot!

Aside from that, the file from **EDF** still has the same name and same URL since February 1, 2025 with its new rates and everything works perfectly without changing anything!

Thanks @prohand for the original flow 😉 and I won’t tap multiple times on my keyboard before checking five times anymore 😅

EDIT: and for info, the TEMPO rates are now available as open data since January 30, 2025: [https://www.data.gouv.fr/fr/datasets/historique-des-tarifs-reglementes-de-vente-delectricite-pour-les-consommateurs-residentiels/](https://www.data.gouv.fr/fr/datasets/historique-des-tarifs-reglementes-de-vente-delectricite-pour-les-consommateurs-residentiels/)

---

<div class="post-metadata">

**Author:** ![mutmut](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/mutmut/32/14064_2.png) [@mutmut](https://community.gladysassistant.com/u/mutmut)\
**Post date:** [February 14, 2026, 8:09pm UTC](https://community.gladysassistant.com/t/tuto-mise-a-jour-du-tarif-tempo-mise-a-jour-via-pdf-en-auto/9241/16 "2026-02-14T20:09:21Z")

</div>

Hello,

I’m making a small change to the regex for the subscribed power.  
Indeed, this year for me, who have a 12kVA subscription, the regex searches for 12 in the PDF and matches a consumption price, namely **16,12** , and only captures what follows on the line:  
 ![image](https://gladys-assistant-community.b-cdn.net/uploads/default/original/3X/d/e/de5140991060d75d152227d1c28ec78e762955b9.png)  
To make sure to take only the line that starts with 12, you should use:

```auto
const regex = /^12\\b.*$/gm; // subscribed power

```

`^12\\b` : the line starts with `12` as an integer value (not `112` or `120`).  
@prohand if you can change in your first post the `regex = /6 .*/gm;` in the Node-RED flow line:

```auto
"func": "const regex = /6 .*/gm; // subscribed power\\nconst found = msg.payload.match(regex);\\nconst searchRegExp = /,/g; // replace commas with dots\\nconst replaceWith = '.';\\nmsg.payload = found[0];\\nmsg.payload = msg.payload.replace(searchRegExp, replaceWith);\\nreturn msg;",

```

that would be great 🙂

---

<div class="post-metadata">

**Author:** ![prohand](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/prohand/32/15713_2.png) [@prohand](https://community.gladysassistant.com/u/prohand)\
**Post date:** [February 14, 2026, 9:15pm UTC](https://community.gladysassistant.com/t/tuto-mise-a-jour-du-tarif-tempo-mise-a-jour-via-pdf-en-auto/9241/17 "2026-02-14T21:15:14Z")

</div>

Thanks @mutmut  
I’ve edited the first post 🙂
