Tempo cost computation — 2025.02.1
Source
CRE délibération n° 2025-09 du 30 janvier 2025, portant décision sur les
tarifs réglementés de vente d'électricité (TRV Bleu, option Tempo).
Entrée en vigueur : 1ᵉʳ février 2025.
What this method does
Compute the annual cost of EDF's Tempo tariff (or any supplier replicating
its 3-colour × HP/HC grid) for a residential PDL over a given date range,
typically a full Tempo year (1 September → 31 August).
For each calendar day in [start_date, end_date):
MethodContext.calendar — a TempoCalendarLike supplied by the caller.
- Declared branch (B2C default — Linky consent is rare):
kwh_per_day = total_kwh / days_covered, split by hp_share.
- Hourly branch (Linky branch):
sum kwh_per_hour[h] over the 24 hours of the day, splitting by the
supplied hp_hours_mask[h].
energy cost.
Annual cost = abonnement × (days_covered / 365) + Σ daily energy €.
Calendar source of truth (load-bearing detail)
The day-colour calendar lives outside the method to keep apply() pure:
RTE Tempo API
https://digital.iservices.rte-france.com/open_api/tempo_like_supply_contract/v1/tempo_like_calendars.
Refreshed daily by lib/ingestion/tempo/fetch-day-ahead.ts (Cloud
Scheduler, 11:00 Europe/Paris). The method reads, never fetches.
The 11:00 ingester writes the new day into tempo-historical.json.
tempo-projected.json (all summer = Bleu; per-CRE-quota distribution of
Blanc/Rouge in winter — 22 Rouge + 43 Blanc per Tempo year, rest Bleu).
When any day in the range resolves to a projected colour, the method
emits MethodWarning { code: "TEMPO_PROJECTED", reason: "X jour(s) … " }
so the brief can label the figure "estimation" rather than "actual".
Replay guarantee
MethodResult.intermediates.calendar_fingerprint = sha256(merged calendar
JSON) truncated to 16 hex chars. Persisted alongside the canonical
(method_id, method_version, input_hash) triple. Two calls with the same
inputs and the same calendar_fingerprint return byte-identical
output — replayable even after the calendar evolves.
Worked example (declared branch)
Flat 4 800 kWh/year profile, 60 % HP / 40 % HC, over the 2024-09 →
2025-08 Tempo year (365 days = 300 Bleu + 43 Blanc + 22 Rouge per the
shipped tempo-historical.json; CRE quota is 22 Rouge + 43 Blanc, the
rest Bleu, so 365 − 43 − 22 = 300 Bleu):
Multiplied by the CRE-published 6 kVA Tempo TRV grille (caller supplies
the actual €/kWh values via the prices input), the method returns a
total within €1 of EDF's online Tempo simulator over the same year.
Out of scope
abonnement_eur_per_year for the user's puissance.
the caller supplies the boolean mask; for the declared branch only the
share matters.
(turpe.bt, the simulator tax pipeline).