Good evening
I see in the example: Monitor your energy consumption with Gladys Assistant | Gladys Assistant
but I can’t find my contract:
What should I do with the cost?
Thanks for your help
mutmut
October 15, 2026, 8:12pm
2
Hi @Prof_Techno
normally the blue tariff is the regulated tariff so it should be this one in the contracts:
Not very clear, I agree
Good evening
I must be missing something because I get this in response:
tariff.components: must contain less than or equal to 16 items
mutmut
October 16, 2026, 9:17pm
4
Unfortunately, I can’t help any more
@pierre-gilles , any ideas?
Hi everyone!
This topic is now in development .
A PR has been opened to fix the « too many components » error on EDF Tarif Bleu templates:
master ← claude/magical-planck-07oywr
ouvert 08:57AM - 19 Oct 26 UTC
### 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)_
Don’t hesitate to follow the PR, test (optional, especially for small requests), and share your feedback here if needed.
Well, we’ll just have to wait…
Hi @Prof_Techno , thanks @mutmut !
You chose the right model: edf-peak-off-peak corresponds to the Tarif Bleu Heures Creuses. The name is not very explicit, we will improve it.
The error is not your fault, it’s a bug in Gladys. The model contains the entire history of EDF prices since 2012, i.e., 23 periods with a subscription per period. This makes 24 components while Gladys only accepts a maximum of 16. The EDF Base and Tempo models are also affected.
The fix is ready: fix(energy-contract): drop tariff history outside the contract validity (EDF Tarif Bleu templates) by Pierre-Gilles · Pull Request #3235 · GladysAssistant/Gladys · GitHub
Gladys will now only keep the history that overlaps with the period of your contract. It will be in the next version.
In the meantime, you can work around the problem:
In the assistant, at the step where you choose your off-peak hours, activate « Advanced: edit the tariff definition (JSON) » .
Replace the entire content with this. I took the prices from your screenshot, adjust them if they change:
{
"tariff_version": 1,
"components": [
{
"key": "energy",
"kind": "consumption",
"rules": [
{ "label": "Off-peak hours", "when": { "time": [["22:30", "06:30"]] }, "price": 0.1589 }
],
"fallback": { "label": "Peak hours", "price": 0.2142 }
},
{ "key": "subscription", "kind": "fixed", "amount": 19.88, "per": "month" }
]
}
Click on Preview , check the amounts, then save.
With this tariff, the new EDF prices will not be taken into account automatically, you will have to update them yourself. After the Gladys update, you can recreate your contract from the model if you prefer.
Thanks for reporting!
I’ll wait and see if it’s ready soon. Given the speed at which updates are rolling out, I think it’s probably just a matter of hours or a few days!
I’ve managed to live without it so far, so I can continue like this for a little longer. There are so many other things to test anyway!