mutmut
November 10, 2026, 10:57pm
1
I have strange behavior between the energy tracking widget and my associated contract.
Currently in Tempo blue HC, I should have 0.1356€ per kWh, but I end up with the rate before 01/08/26.
EDIT:
I just noticed that you can choose your contract and that I was still on the old contract
Would it be possible for this widget to automatically take the current contract to have the correct rate?
And would it be possible to have a real name instead of blue off-peak?
Thanks for the feedback, and you didn’t do anything wrong: it’s a bug on our end.
The price not following your contract
The widget is linked to a specific contract. When the rate changes, a new contract is created (which is what you did on August 1st), but the widget remains on the old one. It then continues to display the old prices, without any warning. The scenes „Electricity price changes“ and „Current electricity price“ have the same problem.
I opened an issue: Energy price widget and energy price scenes keep using an expired contract after a tariff change · Issue #3353 · GladysAssistant/Gladys · GitHub
With the fix, the widget and the scenes will automatically follow the active contract of your meter: nothing to reconfigure at the next rate change, and the widgets already in place will continue to work.
In the meantime, you need to properly select the active contract in the widget, as you did. If you have scenes that use the electricity price, make sure to choose the active contract there as well.
„Blue off-peak“ instead of a real name
The rate labels are currently generated in English. I created a feature request to display them in your language („Blue HC“): Libellés des tarifs dans la langue de l’utilisateur (« Bleu HC » plutôt que « blue off-peak »)
Don’t hesitate to vote for it. It also explains how to manually rename the labels in the meantime.
A small question
On your screenshot, the widget announces „0.1325 €/kWh (off-peak)“ starting at 06:00, whereas at 06:00 we switch to full hours. I suspect that the Tempo color of the next day was not yet known to Gladys.
mutmut
November 13, 2026, 9:11am
3
For me the arrow means “until 6 a.m.”
In any case, screenshot taken in blue HC, after 10 p.m.
Hi everyone!
This topic is now in development .
A PR has been opened to make the price widget and price scenes follow the active contract of the meter:
master ← fix/energy-price-follow-meter-active-contract
opened 09:29AM - 13 Nov 26 UTC
### Description
The `energy-price` widget, the `energy-contract.price-changed` … trigger and the `energy-contract.current-price` condition were bound to **one energy contract**. A contract has a validity period and a tariff change is a new, successive contract, so after a tariff change everything kept using the expired one: the widget priced "now" with the old tariff (`/current` never checked the validity), the trigger never fired again (only `active` contracts are checked), and the condition compared against the old price. Nothing told the user.
They now target **a meter**, and the price is the one of the meter's contract **active at each call** (validity judged on the local date of each contract's own timezone). A tariff change needs no reconfiguration.
**Server**
- New `GET /api/v1/energy_contract/current?electric_meter=<device selector>` (`getMeterCurrent`): the main meter by default (the meter of the most recently created consumption contract, the one `getDefaultElectricMeterFeatureId` already uses). With no active contract at that instant, or no meter at all, it answers `200` with `contract: null, price: null`, never an expired price. Unknown meter: `404`.
- `GET /api/v1/energy_contract/:selector/current` is kept: the selector is now read as **the meter of this contract** (the answer's `contract` names the contract that actually priced it).
- `checkPriceChanges` keeps the last price **per meter** (when contract A ends and B starts, B's first price is compared with A's last one), and the event carries `electric_meter`, `contract` and `meter_contracts`.
- Trigger: matches on `electric_meter` (empty = any meter); a legacy `energy_contract` matches when it is one of the event's `meter_contracts`.
- Condition: prices `electric_meter` (empty = main meter, legacy `energy_contract` = its meter) and aborts with `NO_ACTIVE_ENERGY_CONTRACT` when the meter has no active contract.
- The contract list / `GET /:selector` now include the meter (`electric_meter_device`: `id`, `selector`, `name`) so the editors can list meters.
- `electric_meter` is accepted by the dashboard and scene Joi schemas, and it is a device-referencing field: `device.migrate` rewrites it (`DEVICE_STRING_FIELDS`).
**Front**
- The widget editor, the trigger editor and the condition editor list **meters** (each with the name of its active contract, or "no active contract"), after a "Main meter (…)" / "Any meter" choice. This also fixes the list of identical `… (expired)` contract entries reported in the issue.
- The widget shows an explicit "No active contract on *(meter name)* right now." state (or "No electricity contract yet."), with a link to the Contracts tab.
- **Lazy normalization, no data migration:** existing boxes, triggers and conditions storing `energy_contract` keep working (read server-side as the meter of that contract) and their editors replace it with that meter's `electric_meter` on the next save. If the contract was deleted, the picker asks to choose a meter.
- i18n keys in en / fr / de / es; demo fixtures updated.
**Specs (same diff)**
- `docs/specs/energy-contracts.md` §8.1 (`/current` routes, meter in the contract list) and §8.2.5 / §8.2.6 (box config, trigger, condition, per-meter price tracking, legacy reading).
- `docs/specs/dashboard-flexible-layout-and-widgets.md` section J: the box now carries a device-referencing `electric_meter`.
- `docs/specs/device-migration.md` B.3: `electric_meter` listed for scene actions, scene triggers and dashboard boxes; the legacy `energy_contract` is not rewritten (the contract itself is re-pointed).
- The external-integration side (`capabilities/energy-contracts.md`) does not change: `energy-contract.current` is still sent for one contract, now the meter's active one.
Out of scope, as listed in the issue: the untranslated rule labels from `convertPriceRows.js`, the raw template-key names of v1 catalogue contracts, and the Tempo `fallback` label question.
**Checks run locally:** server `prettier-check`, `eslint` (0 errors), `npm run coverage` (exit 0; every added server line covered, no partial branch); front `prettier-check`, `eslint` (0 errors), `compare-translations`, `build`; Cypress full suite 27/27 specs, 133/133 tests. The widget, its editor (meter picker, help text, preview), the "no active contract" state and the lazy normalization of a legacy box / trigger / condition were also checked in the browser in demo mode.
### Related request
Closes #3353
Forum: https://community.gladysassistant.com/t/amelioration-widget-prix-de-l-electricite/11550
### 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` (Codecov requires 100% coverage on changed lines) and Cypress (`npm run cypress:run`) if the UI changed
- [x] Linter and prettier pass on both front and server (`npm run eslint`, `npm run prettier`)
- [x] No undocumented breaking change
---
_Generated by [Claude Code](https://claude.ai/code/session_01MNjB36KcSm4VD1JKgmahQv)_
Feel free to follow the PR, test (optional, especially for small requests), and give your feedback here if needed.
Hello,
The « Electricity Price » widget and price scenes now follow the active contract of the meter. This is fixed in Gladys Assistant 5.3.3 .
Details are in the announcement:
Hi everyone!
Gladys Assistant 5.3.3 is out
Don’t let the version number fool you: this release is almost entirely about one project, Gladys on your phone. Many of you check your dashboard on your smartphone, but as soon as you wanted to change a widget or a scene, you were facing a desktop form squeezed onto a small screen. So we rebuilt dashboard and scene editing starting from the phone. On a computer, your habits don’t change.
[The Devices widget, the scene list and the scene editor…