Arduino & Raspberry Pi

Raspberry Pi and EDF Tempo: an LED that shows the day's color and warns you before a red day

A small Raspberry Pi project that's genuinely useful for anyone on the Tempo plan. As a reminder, it splits the year into blue, white and red days, and on a red day a kWh during peak hours costs more than four times the price on a blue day (€0.7295 versus €0.1654 incl. tax, rates in force since August 1, 2026). Better to see it coming.

How the tutorial works: the Pi queries a public JSON API, with no account or key, that relays the official colors published by EDF. Then:
- an RGB LED takes on the color of the current day
- a second LED lights up as soon as the next day is announced red
- optionally, a 128 × 64 OLED screen (SSD1306, I2C) shows everything in plain text
- optionally, a relay shows how to cut a low-voltage load during red peak hours

On the hardware side, a Pi 3, 4, 5 or a Zero 2 WH is enough, with a common-cathode RGB LED and resistors (220 Ω for red, 100 Ω for green and blue, otherwise blue is dim at 3.3 V). The script is about two hundred lines of Python and runs at boot via systemd.

One detail I found well thought out: the Tempo day runs from 6 a.m. to 6 a.m., not midnight to midnight, and the script takes that into account. It also keeps switching at 6:00 and 22:00 even if the connection drops. RTE announces the next day's color around 10:30, and EDF publishes it late in the morning.

Two important warnings from the author:
- many “5 V active-low” relay modules can't be driven properly at 3.3 V, or even send 5 V back to the pin; go for a module that's 3.3 V compatible and active-high
- never 230 V on the breadboard: for a water heater or a radiator you need a contactor in a code-compliant panel, and in practice an electrician

The scripts are MIT-licensed, and the API data is CC BY 4.0. The obvious next step: publish the color over MQTT or into Home Assistant.

Source: Framboise 314

Comments 0

Leave the first comment, in any language.

Log in to comment