# EDF TEMPO color in Node Red

**URL:** <https://community.gladysassistant.com/t/couleur-edf-tempo-dans-node-red/7645>\
**Category:** Tutoriels\
**Created:** [November 2, 2022, 10:55pm UTC](https://community.gladysassistant.com/t/couleur-edf-tempo-dans-node-red/7645 "2022-11-02T22:55:30Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![laguiche](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/laguiche/32/11383_2.png) [@laguiche](https://community.gladysassistant.com/u/laguiche)\
**Post date:** [November 2, 2022, 10:55pm UTC](https://community.gladysassistant.com/t/couleur-edf-tempo-dans-node-red/7645/1 "2022-11-02T22:55:30Z")

</div>

Hello everyone,

I’m sharing my setup to retrieve the TEMPO color (EDF option) in Node-RED.  
 ![node-red1](https://gladys-assistant-community.b-cdn.net/uploads/default/optimized/2X/b/b121fbcee3bad2e6037ec065cb66a7e134524933_2_690x34.png)

- The «&nbsp;Timestamp&nbsp;» node initiates a flow at 00:10
- The **function** «&nbsp;generateDate&nbsp;» node generates today’s date in the correct format (this will be the parameter of the http request:

```auto
const date = new Date();

let day = date.getDate();
let month = date.getMonth() + 1;
let year = date.getFullYear();

let currentDate = `${year}-${month}-${day}`;

msg.query = currentDate;
return msg;

```

- The **http request** «&nbsp;Couleur\_TEMPO&nbsp;» node performs the request with EDF’s REST API:

```auto
https://particulier.edf.fr/services/rest/referentiel/searchTempoStore?dateRelevant={{{query}}}

```

 ![node-red2](https://gladys-assistant-community.b-cdn.net/uploads/default/original/2X/f/f13f13b95e814cd56416c6caacac184c381ac784.png)

- The **function** «&nbsp;convert2msg&nbsp;» node extracts the useful info

```auto
var tempo=msg.payload.couleurJourJ;
msg.payload=tempo;
msg.topic="couleur_tempo";

if(tempo==="TEMPO_BLEU")
{
    node.status({ fill: "blue", shape: "ring", text: tempo });
}
if (tempo === "TEMPO_BLANC") {
    node.status({ fill: "white", shape: "ring", text: tempo });
}
if (tempo === "TEMPO_ROUGE") {
    node.status({ fill: "red", shape: "ring", text: tempo });
}

return msg;

```

At the output of the flow you get a result TEMPO\_BLEU, TEMPO\_BLANC or TEMPO\_ROUGE to use as you wish.

---

<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:** [November 3, 2022, 3:00am UTC](https://community.gladysassistant.com/t/couleur-edf-tempo-dans-node-red/7645/2 "2022-11-03T03:00:54Z")

</div>

Thanks for the tutorial 🙏

I’ve moved it to the «&nbsp;tutorials&nbsp;» category of the forum!

---

<div class="post-metadata">

**Author:** ![Tlse-vins](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/tlse-vins/32/6054_2.png) [@Tlse-vins](https://community.gladysassistant.com/u/Tlse-vins)\
**Post date:** [November 3, 2022, 6:31am UTC](https://community.gladysassistant.com/t/couleur-edf-tempo-dans-node-red/7645/3 "2022-11-03T06:31:55Z")

</div>

Just for my information, what is this EDF Tempo color? What is it for?

---

<div class="post-metadata">

**Author:** ![laguiche](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/laguiche/32/11383_2.png) [@laguiche](https://community.gladysassistant.com/u/laguiche)\
**Post date:** [November 3, 2022, 7:20am UTC](https://community.gladysassistant.com/t/couleur-edf-tempo-dans-node-red/7645/4 "2022-11-03T07:20:14Z")

</div>

Without trying to be an EDF salesman or apologist, I quote:

> With the Tempo option, benefit from a favorable electricity price 343 days a year and greatly reduce your electricity consumption during 22 days of winter peak demand.

In short, if you need at least 9 kVA of usable power (this is the case for an older house heated electrically like mine) and you have a way to drastically lower your electricity consumption during the 22 RED days (decided the day before by EDF with the price tripled) — for example with a wood stove —
