Crate tempo_rs

Source
Expand description

This crate is a Rust client library allowing to access RTE’s API for EDF’s “Tempo” contract option.

EDF is a French state-owned electricity utility company in charge of selling energy (electricity) to homes and business. RTE is a subsidiary of EDF in charge of the operation, maintenance and development of the French high-voltage transmission system.

EDF’s “Tarif Bleu” contract comes with an option called “Tempo”, with which electricity price fluctuates depending on days and time of day. There are three types of day:

  • Blue : cheapest prices
  • White : average prices
  • Red : prices can be five times higher than average

Each day is split in two periods:

  • Peak hours: from 6AM to 10PM
  • Off-peak hours: from 10PM to 6AM

For example, at the time of writing :

  • during a Blue day, off-peak hour price is 12.96 ct€/kWh
  • during a White day, off-peak hour price is 14.86 ct€/kWh
  • during a Red day, peak hour price is 75.62 ct€/kWh

See the official prices table for all prices.

Given the high differences between periods and days, it can be interesting to have advance knowledge about future days’ color. As a matter of fact, RTE is contractually bound to publish next-day color at 10:30AM each day.

It also publishes a REST API allowing to programmaticaly request:

  • historical data (past days’ color)
  • next day color

This API is authenticated through OAuth2. To obtain a client id and client secret, you need to create an account at RTE’s Data Portal and subscribe to the “Tempo-like supply contract” API.

For an example of how to use this crate, see [../bin/tempo.rs].

Structs§

CalendarValue
A “Tempo” period. Despite that
Tempo
Main object for interacting with the API.
TempoCalendars
API’s main output struct.

Enums§

ApiError
Something went wrong while using the API.
BadCreds
There was a problem while using the user provided credentials file for OAuth2.
TempoColor
Tempo day color.

Functions§

authorize
Directly supply a client id and a client secret to get authorization through OAuth2 from the server.
authorize_with_file
Given a file containing a client id and client secret, get authorization through OAuth2 from the server. It is assumed the file is the one given by RTE.