# Tarif bleu edf?

**URL:** <https://community.gladysassistant.com/t/tarif-bleu-edf/11307>\
**Category:** Configuration\
**Created:** [Octobre 15, 2026, 7:28 UTC](https://community.gladysassistant.com/t/tarif-bleu-edf/11307 "2026-10-15T19:28:40Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Prof\_Techno](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/prof_techno/32/19038_2.png) [@Prof\_Techno](https://community.gladysassistant.com/u/Prof_Techno)\
**Post date:** [Octobre 15, 2026, 7:28 UTC](https://community.gladysassistant.com/t/tarif-bleu-edf/11307/1 "2026-10-15T19:28:40Z")

</div>

Bonsoir

je vois dans l’exemple : [Surveillez votre consommation énergétique avec Gladys Assistant | Gladys Assistant](https://gladysassistant.com/fr/docs/integrations/energy-monitoring/)

mais je retrouve pas mon contrat :

 ![image](https://gladys-assistant-community.b-cdn.net/uploads/default/original/3X/7/d/7dec79a85a1fe80ba45c163474da679789b5afb3.png)

Je dois faire quoi du cout ?

Merci de votre aide

---

<div class="post-metadata">

**Author:** ![mutmut](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/mutmut/32/14064_2.png) [@mutmut](https://community.gladysassistant.com/u/mutmut)\
**Post date:** [Octobre 15, 2026, 8:12 UTC](https://community.gladysassistant.com/t/tarif-bleu-edf/11307/2 "2026-10-15T20:12:09Z")

</div>

Salut @Prof_Techno  
normalement le tarif bleu est le tarif réglementé donc ce doit être celui-ci dans les contrats :

 ![image](https://gladys-assistant-community.b-cdn.net/uploads/default/original/3X/e/6/e6c08b00a6bc3e8fbca7c2bfaa6d33c30ce4f6e6.png)  
Pas super explicite je te l’accorde 😕

---

<div class="post-metadata">

**Author:** ![Prof\_Techno](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/prof_techno/32/19038_2.png) [@Prof\_Techno](https://community.gladysassistant.com/u/Prof_Techno)\
**Post date:** [Octobre 16, 2026, 8:25 UTC](https://community.gladysassistant.com/t/tarif-bleu-edf/11307/3 "2026-10-16T20:25:01Z")

</div>

Bonsoir

je dois rater un truc car j’ai cela en reponse :

tariff.components: must contain less than or equal to 16 items

 ![image](https://gladys-assistant-community.b-cdn.net/uploads/default/original/3X/d/8/d8f031fadbe0152eccc0378bf8fd4ae1331070ab.png)

---

<div class="post-metadata">

**Author:** ![mutmut](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/mutmut/32/14064_2.png) [@mutmut](https://community.gladysassistant.com/u/mutmut)\
**Post date:** [Octobre 16, 2026, 9:17 UTC](https://community.gladysassistant.com/t/tarif-bleu-edf/11307/4 "2026-10-16T21:17:55Z")

</div>

Je ne pourrais aider plus malheureusement 😕  
@pierre-gilles , une idée ?

---

<div class="post-metadata">

**Author:** ![cursor-bot](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/cursor-bot/32/22252_2.png) [@cursor-bot](https://community.gladysassistant.com/u/cursor-bot)\
**Post date:** [Octobre 19, 2026, 8:59 UTC](https://community.gladysassistant.com/t/tarif-bleu-edf/11307/5 "2026-10-19T08:59:55Z")

</div>

Salut tout le monde !

Ce sujet est désormais **en cours de développement**.

Une PR a été ouverte pour corriger l’erreur « trop de composants » sur les templates Tarif Bleu EDF :

> <https://github.com/GladysAssistant/Gladys/pull/3235>
>
> \### Description
> 
> \*\*Bug:\*\* picking the \`edf-peak-off-peak 9 kVA\` template (EDF Ta…rif Bleu, Heures Creuses) and clicking \*Preview\* fails with \`tariff.components: must contain less than or equal to 16 items\`.
> 
> \*\*Root cause:\*\* the community catalogue is only published in v1 (\`contracts.json\`), and Gladys converts it with \`buildVariantTariff\`. That function turns every \*\*older\*\* price range into dated rules plus a \*\*dated \`fixed\` subscription component\*\*. The EDF regulated tariffs have 23 price ranges since 2012, so these templates end up with \`energy\` + \`subscription\` + 22 dated subscriptions = \*\*24 components\*\* (the limit is 16). Tempo also goes over the limit: about 132 rules where 64 are allowed.
> 
> I converted and validated the live catalogue: \*\*19 of the 187 templates were unusable\*\*. They are every power of \`edf-base\`, \`edf-peak-off-peak\` (except 3 kVA, which has only one range) and \`edf-tempo\` (except 6 and 24 kVA).
> 
> \*\*Fix:\*\* before validating a contract tariff (create, update, preview), \`pruneTariffToValidity\` (new \`tariff.prune.js\`) removes the tariff parts that can never price an interval of the contract:
> \- consumption rules whose \`dates\` condition ends before \`valid\_from\` or starts after \`valid\_to\`
> \- \`fixed\` / \`demand\` components dated the same way
> \- taxes lose the removed components from \`applies\_to\`, and a tax is removed when nothing is left in it
> 
> This doesn't change any cost, because those parts can never match an interval the contract prices. The preview prunes against the contract validity widened to its window, because the window (the last 7 days) can start before \`valid\_from\`. Malformed \`dates\` are never removed, so validation still reports them.
> 
> \*\*Result on the real catalogue:\*\*
> 
> | \`valid\_from\` | Templates still failing |
> | --- | --- |
> | 2026-10-01 (forum case) | 0 / 187 |
> | 2024-01-01 | 0 / 187 |
> | 2020-01-01 | 6 / 187 (only \`edf-tempo\` 9–36 kVA, over the 64-rule limit) |
> | 2015-01-01 | 19 / 187 |
> 
> A contract going back that far still fails as before. It can be modelled as successive contracts, or we can decide separately to raise the limits.
> 
> \*\*Trade-off (documented in the spec):\*\* the stored tariff is the pruned one. If \`valid\_from\` is later moved earlier, the dropped history does not come back (the undated rules price those dates) and the template has to be picked again.
> 
> Spec updated in the same diff: \`docs/specs/energy-contracts.md\`, in section 3 (new paragraph), the preview row of the API table and 9.4 (how the v1 conversion builds the history).
> 
> \### Related request
> 
> Forum: https://community.gladysassistant.com/t/tarif-bleu-edf/11307
> 
> \### Checklist
> 
> \- \[x\] If a forum topic or GitHub issue exists, the description links it (\`Forum: https://community.gladysassistant.com/t/...\` or \`Closes #...\`)
> \- \[x\] Tests pass: \`cd server && npm run coverage\` (100% lines on \`tariff.prune.js\` and the changed lines of \`contract.{create,update,preview,validate}.js\`). No UI change.
> \- \[x\] Linter and prettier pass on the server (no front change)
> \- \[x\] No undocumented breaking change
> 
> \---
> \_Generated by \[Claude Code\](https://claude.ai/code/session\_01VwSfzT2b9MHU7rHhXHW6mp)\_

N’hésitez pas à suivre la PR, à tester (optionnel, surtout pour les petites demandes) et à faire vos retours ici si besoin.

---

<div class="post-metadata">

**Author:** ![Prof\_Techno](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/prof_techno/32/19038_2.png) [@Prof\_Techno](https://community.gladysassistant.com/u/Prof_Techno)\
**Post date:** [Octobre 19, 2026, 9:05 UTC](https://community.gladysassistant.com/t/tarif-bleu-edf/11307/6 "2026-10-19T09:05:12Z")

</div>

Du coup on va patienter …

---

<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:** [Octobre 19, 2026, 9:32 UTC](https://community.gladysassistant.com/t/tarif-bleu-edf/11307/7 "2026-10-19T09:32:37Z")

</div>

Salut @Prof_Techno, merci @mutmut !

Tu as choisi le bon modèle : `edf-peak-off-peak` correspond bien au Tarif Bleu Heures Creuses. Le nom n’est pas explicite du tout, on va l’améliorer.

L’erreur ne vient pas de toi, c’est un bug de Gladys. Le modèle contient tout l’historique des prix EDF depuis 2012, soit 23 périodes avec un abonnement par période. Cela fait 24 composants alors que Gladys en accepte au maximum 16. Les modèles EDF Base et Tempo sont touchés aussi.

Le correctif est prêt : [fix(energy-contract): drop tariff history outside the contract validity (EDF Tarif Bleu templates) by Pierre-Gilles · Pull Request #3235 · GladysAssistant/Gladys · GitHub](https://github.com/GladysAssistant/Gladys/pull/3235)  
Gladys ne gardera plus que l’historique qui recoupe la période de ton contrat. Il sera dans la prochaine version.

**En attendant, tu peux contourner le problème :**

1. Dans l’assistant, à l’étape où tu choisis tes heures creuses, active **« Avancé : éditer la définition du tarif (JSON) »**.
2. Remplace tout le contenu par ceci. J’ai repris les prix de ta capture, à adapter s’ils changent :

```json
{
  "tariff_version": 1,
  "components": [
    {
      "key": "energy",
      "kind": "consumption",
      "rules": [
        { "label": "Heures creuses", "when": { "time": [["22:30", "06:30"]] }, "price": 0.1589 }
      ],
      "fallback": { "label": "Heures pleines", "price": 0.2142 }
    },
    { "key": "subscription", "kind": "fixed", "amount": 19.88, "per": "month" }
  ]
}

```

1. Clique sur **Aperçu** , vérifie les montants, puis enregistre.

Avec ce tarif, les nouveaux prix EDF ne seront pas pris en compte automatiquement, il faudra les mettre à jour toi-même. Après la mise à jour de Gladys, tu pourras recréer ton contrat à partir du modèle si tu préfères.

Merci pour le signalement !

---

<div class="post-metadata">

**Author:** ![Prof\_Techno](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/prof_techno/32/19038_2.png) [@Prof\_Techno](https://community.gladysassistant.com/u/Prof_Techno)\
**Post date:** [Octobre 19, 2026, 9:39 UTC](https://community.gladysassistant.com/t/tarif-bleu-edf/11307/8 "2026-10-19T09:39:05Z")

</div>

Je vais patienter pour voir si c’est prêt prochainement. Vu la vitesse à laquelle les mises à jour s’enchaînent, je me dis que ce n’est probablement qu’une question d’heures ou de quelques jours !

J’ai réussi à vivre sans jusqu’à présent, je vais donc pouvoir continuer encore un peu comme ça. Il y a tellement d’autres choses à tester de toute façon !
