Skip to content

eData and Datadis Charts in Home Assistant for Spain

04/08/2026
Home Assistant energy dashboard with daily, monthly and power charts

Updated in August 2026. eData provides several ways to visualize official Datadis electricity readings in Home Assistant. You can use its native card, the Energy dashboard, or advanced ApexCharts configurations.

Regional requirement: these charts use eData readings obtained through Datadis and therefore require an electricity supply point in Spain. Home Assistant and ApexCharts are available worldwide, but the official data-source integration depends on the country and electricity provider.

Quick recommendation: start with the native edata-card. Use ApexCharts only when you need a layout or combination of series that the included card does not provide.

This guide assumes that eData is already installed and has downloaded some data. If it is not, start with Datadis and eData in Home Assistant: the complete guide.

Before creating a chart

  • Find the main entity, normally sensor.edata_xxxx.
  • Replace xxxx with the final characters shown in your entity ID.
  • Confirm that eData has downloaded at least one registered day.
  • Remember that Datadis does not provide real-time readings.

Do not copy the identifier from another installation. Find yours under Settings → Devices & services → eData or Developer tools → States.

Option 1: the native eData card

eData installs and registers edata-card automatically. You do not need to add a Lovelace resource URL manually.

Add it with the visual editor

  1. Open the dashboard you want to edit.
  2. Select Edit dashboard → Add card.
  3. Search for eData.
  4. Select the main entity.
  5. Choose the chart, aggregation period, and number of records.

Daily consumption for the last 30 days

type: custom:edata-card
entity: sensor.edata_xxxx
chart: consumptions
aggr: day
records: 30
title: Daily consumption

The card automatically separates P1, P2, and P3 when those tariff periods are present in the data.

Latest registered day

type: custom:edata-card
entity: sensor.edata_xxxx
chart: summary-last-day
title: Latest registered day

Current month

type: custom:edata-card
entity: sensor.edata_xxxx
chart: summary-month
title: Current month

Previous month

type: custom:edata-card
entity: sensor.edata_xxxx
chart: summary-last-month
title: Previous month

Maximum demand

type: custom:edata-card
entity: sensor.edata_xxxx
chart: maximeter
title: Maximum registered power

Exported energy and costs

If your supply includes generation, or if compatible tariff calculation is enabled, set chart to surplus or costs. Cost charts are only meaningful when the configured formulas and prices match the electricity contract.

Custom colors

type: custom:edata-card
entity: sensor.edata_xxxx
chart: consumptions
aggr: day
records: 30
title: Consumption by tariff period
colors:
  - '#e54304'
  - '#ff9e22'
  - '#9ccc65'

Available aggregation periods

aggr valueRecommended use
hourHourly detail for one or two days
dayCompare recent days
weekWeekly trends
monthCompare months
yearMulti-year overview

The records option controls how many data points the card requests. Asking for hundreds of points unnecessarily makes dashboards heavier, particularly on mobile devices.

Option 2: the Home Assistant Energy dashboard

The Energy dashboard is the best choice for a long-term overview. eData publishes statistics that Home Assistant can use directly.

  1. Open Settings → Dashboards → Energy.
  2. Under grid consumption, select Add consumption.
  3. Choose the eData statistic for total consumption.
  4. Configure returned-to-grid energy separately if solar generation is available.
  5. Save and allow Home Assistant to process the statistics.

The main statistic normally has an internal ID similar to edata:xxxx_consumption. It is not a regular sensor, so it can be offered by the Energy dashboard even when it is not visible as a standalone entity.

Option 3: advanced ApexCharts visualizations

ApexCharts Card offers detailed control of series, axes, and layout. eData exposes historical readings through WebSockets so the card can request daily, monthly, or hourly points.

Install ApexCharts Card

  1. Open HACS → Frontend.
  2. Find ApexCharts Card.
  3. Install it.
  4. Perform a full browser refresh or restart the mobile app.

Daily consumption stacked by tariff period

Replace every occurrence of xxxx with the characters from your main entity:

type: custom:apexcharts-card
graph_span: 30d
span:
  end: day
  offset: '-1d'
header:
  show: true
  title: Daily consumption by tariff period
  show_states: false
all_series_config:
  type: column
  unit: kWh
  stack_group: tariffs
  show:
    legend_value: false
series:
  - entity: sensor.edata_xxxx
    name: Peak
    color: '#e54304'
    data_generator: |
      return hass.connection.sendMessagePromise({
        type: 'edata/ws/consumptions',
        scups: 'xxxx',
        aggr: 'day',
        tariff: 'p1',
        records: 30
      });
  - entity: sensor.edata_xxxx
    name: Flat
    color: '#ff9e22'
    data_generator: |
      return hass.connection.sendMessagePromise({
        type: 'edata/ws/consumptions',
        scups: 'xxxx',
        aggr: 'day',
        tariff: 'p2',
        records: 30
      });
  - entity: sensor.edata_xxxx
    name: Valley
    color: '#9ccc65'
    data_generator: |
      return hass.connection.sendMessagePromise({
        type: 'edata/ws/consumptions',
        scups: 'xxxx',
        aggr: 'day',
        tariff: 'p3',
        records: 30
      });

The entity acts as the Lovelace update reference. Chart points are returned directly by the eData WebSocket.

Maximum demand with ApexCharts

type: custom:apexcharts-card
graph_span: 1y
header:
  show: true
  title: Maximum demand
  show_states: false
chart_type: scatter
series:
  - entity: sensor.edata_xxxx
    name: Peak
    type: column
    data_generator: |
      return hass.connection.sendMessagePromise({
        type: 'edata/ws/maximeter',
        scups: 'xxxx',
        tariff: 'p1'
      });
  - entity: sensor.edata_xxxx
    name: Flat and valley
    type: column
    data_generator: |
      return hass.connection.sendMessagePromise({
        type: 'edata/ws/maximeter',
        scups: 'xxxx',
        tariff: 'p2'
      });

WebSockets available to advanced users

TypeInformation
edata/ws/consumptionsHistorical consumption
edata/ws/surplusHistorical exported energy
edata/ws/costsCalculated costs
edata/ws/maximeterMaximum-demand readings
edata/ws/summarySummary and available attributes

Consumption, exported-energy, and cost endpoints accept aggr, records, and, where applicable, tariff. These endpoints are intended for advanced cards and automations; most users do not need to call them directly.

Troubleshooting

Custom element doesn’t exist: edata-card

  • Confirm that eData loaded without errors.
  • Restart Home Assistant after installing or updating eData.
  • Perform a full browser refresh with Ctrl + F5.
  • Fully close and reopen the mobile app.
  • Do not add duplicate Lovelace resources manually.

The card is empty

  • Verify that sensor.edata_xxxx is your actual entity ID.
  • Confirm that eData has downloaded at least one day.
  • Temporarily reduce the aggregation range and number of records.
  • Remember that a partial day may not be available yet.

ApexCharts reports an error

Check every xxxx value, YAML indentation, and whether ApexCharts Card is installed. Do not use obsolete examples based on sensor.datadis_... entities: eData uses its main entity and the WebSockets documented above.

Which option should you use?

RequirementRecommended option
Fast and maintainable setupNative eData card
Annual overview and energy flowsEnergy dashboard
Fully customized designApexCharts Card
Combine official data with other sensorsApexCharts or a purpose-built card

A practical setup is to use the Energy dashboard for long-term history, an eData card for quick checks, and ApexCharts only where its extra flexibility provides useful information.

All supported options and recent changes are documented in the eData repository.