EDF TEMPO color in Node Red

Hello everyone,

I’m sharing my setup to retrieve the TEMPO color (EDF option) in Node-RED.
node-red1

  • The « Timestamp » node initiates a flow at 00:10
  • The function « generateDate » node generates today’s date in the correct format (this will be the parameter of the http request:
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 « Couleur_TEMPO » node performs the request with EDF’s REST API:
https://particulier.edf.fr/services/rest/referentiel/searchTempoStore?dateRelevant={{{query}}}

  • The function « convert2msg » node extracts the useful info
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.

2 Likes

Thanks for the tutorial :folded_hands:

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

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

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 —

1 Like