e-data (Datadis) smart home integration, free and open source

Spanish electricity supplies from Datadis: consumption, peak power and alerts.
This integration brings the electricity supplies of a Datadis account into Gladys. Datadis is the free platform of the Spanish electricity distributors (i-DE, e-distribución, UFD, E-redes, Viesgo…): it serves the hourly consumption, the maximeter and the contract of every supply point (CUPS) of a holder.
It is a cloud integration: it only reads Datadis over the Internet. Nothing is controlled, and the readings arrive with one or two days of delay (that is how Datadis works: the meter data of a day is published the following days).
Before you start
- Create an account on datadis.es with the NIF/NIE of the supply holder (a "private" account is enough).
- Log in once on datadis.es and check that your supplies are listed.
Configuration
- Open the Configuration tab of the integration.
- Enter your Datadis username (NIF/NIE) and password.
- Optional: Authorized NIF — only to read the supplies of another holder who authorized your account on Datadis.
- Optional settings:
- Refresh interval (hours, 12 by default, 6 minimum): how often Datadis is read. Datadis refuses identical queries asked too often.
- History to import (months, 3 by default, up to 24): read on the first sync of a supply.
- High daily consumption (kWh, 0 = disabled): threshold of the scene trigger of the same name.
- Power peak alarm (% of the contracted power, 90 by default).
- Save, then press Test the connection: the number of supplies found is displayed.
- Your supplies appear in the Discovery tab: add them.
What you get
One device per supply, named after its address, with:
| Feature | Description |
|---|---|
| Consumption | Hourly consumption, dated, fed into the Gladys energy monitoring (costs, charts) |
| Last day consumption | Total of the last complete day (kWh) |
| Month consumption | Total of the current month so far (kWh) |
| Month maximum power | Highest maximeter peak of the month (W) |
| Contracted power | Highest contracted power of the contract (W) |
| Last data date | Date of the most recent reading |
Actions
- Test the connection — logs in and lists the supplies, without reading the consumption.
- Refresh the data now — reads Datadis immediately.
Scenes
The integration adds its own cards to the scene editor (Gladys 5.1 or later):
Triggers:
- New daily data — Datadis delivered a new complete day. Variables:
{{triggerEvent.data.date}},{{triggerEvent.data.consumption_kwh}}. - High daily consumption — a day consumed more than the configured
threshold. Variables:
date,consumption_kwh,threshold_kwh. - Power peak alarm — the maximeter recorded a peak at or above the
configured share of the contracted power (risk of the ICP tripping, or of
power excess penalties). Variables:
date,time,max_power_w,contracted_power_w,percent. - Datadis error — Datadis could not be read (credentials refused, rate
limit, service unavailable). Variables:
reason,message.
Every trigger can be limited to one supply (or one error reason).
Actions:
- Refresh Datadis data — reads Datadis now. Outputs:
success,supplies. - Get the consumption — consumption of a supply over a period (last
available day, last 7 or 30 days, current or previous month). Outputs:
consumption_kwh,days,start_date,end_date,max_power_w— use them in a message to receive a weekly or monthly report.
Dashboard
- Electricity supply — one supply: last day, current month, peak power gauge against the contracted power, the last 14 days as bars, distributor, supplier and connection state, with a Refresh button.
- Datadis supplies — every supply of the account and the connection state.
Troubleshooting
- "Datadis refused the username or the password": check the credentials on datadis.es. The username is the NIF/NIE, in capital letters.
- "Datadis limits the number of queries": Datadis temporarily refused the queries; the integration retries later on its own.
- No data for yesterday: normal, distributors publish the readings with one or two days of delay (sometimes more).
- Logs: open the integration logs from Gladys (
LOG_LEVEL=debugfor the full detail). Passwords, tokens and full CUPS are never logged.
Privacy
The integration only talks to datadis.es. It keeps a cache of the readings
under its own /data volume (never the password) so that a restart re-reads
nothing.
Configuration settings
These are the settings e-data (Datadis) asks for in its configuration screen in Gladys.
| Setting | Type | Required | Description |
|---|---|---|---|
| Connect your Datadis account | section | No | Datadis is the free platform of the Spanish electricity distributors. Create an account on datadis.es with the NIF/NIE of the supply holder, then enter the same credentials here. Readings arrive with one or two days of delay. |
| Username (NIF/NIE) | string | Yes | |
| Password | secret | Yes | |
| Authorized NIF (optional) | string | No | Only to read the supplies of another holder who authorized your account on Datadis. |
| Refresh interval (hours) | number | No | How often Datadis is read. Datadis limits repeated queries: 6 hours minimum. |
| History to import (months) | number | No | Months of hourly consumption read on the first sync (Datadis keeps two years). |
| High daily consumption (kWh) | number | No | Threshold of the "High daily consumption" scene trigger. 0 disables it. |
| Power peak alarm (% of contracted) | number | No | A maximeter peak at or above this share of the contracted power fires the "Power peak alarm" trigger. |
How to install e-data (Datadis) in Gladys
- In Gladys, open Integrations: e-data (Datadis) appears in the catalog, next to the native integrations, with a community badge.
- Click Install. Gladys pulls the Docker image (
ghcr.io/gboulvin/gladys-e-data-datadis:1.0.0), starts it in a sandbox isolated from the core, and generates the integration's interface (devices, discovery and configuration). - Open the Configuration screen of the integration, fill in the settings, and save.
- You can also install it directly from its repository URL: https://github.com/gboulvin/Gladys-e-data-Datadis.
e-data (Datadis) requires Gladys >=5.1.0. The catalog inside Gladys refreshes every hour, so a new version becomes available at most one hour after its release.
Not running Gladys yet? It is free and open source: follow the installation guide to get started.
About external integrations
e-data (Datadis) is an external integration: a community integration packaged as a Docker container and published on GitHub, that Gladys installs in one click and runs in a sandbox isolated from its core. It is published and maintained by gboulvin, not by the Gladys core team.
- Browse all integrations, native and community
- Build and publish your own external integration
- Source code on GitHub — source of this documentation