Skip to content

Electricity Prices with Energi Data Service

With the Energi Data Service integration you get real-time Danish electricity prices directly in Home Assistant - including all Danish grid tariffs and taxes. Great for saving money by running the washing machine, dishwasher and EV charging when electricity is cheapest.

  • 📊 Spot prices for today and tomorrow (published around 13:00) - in 15-minute resolution since October 2025
  • 💰 Total prices incl. all tariffs and taxes
  • 📈 Graphs showing price development
  • 🔮 5-day forecast via Carnot.dk
  • Live costs based on your current consumption
  • 📅 Accumulated consumption per day, month and year

Before you start, you need:

  • HACS installed
  • ✅ To know which price area you live in (DK1 or DK2)
  • ✅ To know who your grid company is (for correct tariffs)
SettingRecommendation
CountryDenmark
Price areaDK1 (west) or DK2 (east)
Price typekWh
VATYes (25%)
TariffsAutomatic from grid company
Grid companyPick yours (e.g. Radius, N1, TREFOR)

After installation you have these sensors:

SensorDescription
sensor.energi_data_serviceCurrent electricity price incl. taxes
sensor.energi_data_service_forecastForecast for the coming days

The sensor also has attributes with all of the day’s prices (raw_today and raw_tomorrow). Since Nord Pool switched to 15-minute resolution in October 2025, the lists can hold up to 96 points per day instead of 24 - each point carries its own timestamp, so the cards below work unchanged.

With the sensors in place you can build dashboard cards that show prices as graphs and statistics.

First install ApexCharts Card via HACS:

  1. Go to HACSFrontend
  2. Click + Explore & download repositories
  3. Search for “ApexCharts Card”
  4. Click DownloadDownload
  5. Reload your browser (Ctrl+F5)

This card shows the current electricity price:

type: entity
entity: sensor.energi_data_service
name: Current electricity price
icon: mdi:flash

This card shows the prices as a bar chart with colors based on price:

type: custom:apexcharts-card
header:
show: true
title: Electricity prices today and tomorrow
show_states: true
colorize_states: true
graph_span: 48h
span:
start: day
now:
show: true
label: Now
color: red
yaxis:
- id: price
decimals: 2
min: 0
apex_config:
tickAmount: 5
experimental:
color_threshold: true
series:
- entity: sensor.energi_data_service
name: Electricity price
unit: kr/kWh
yaxis_id: price
type: column
float_precision: 2
data_generator: |
const today = entity.attributes.raw_today || [];
const tomorrow = entity.attributes.raw_tomorrow || [];
const combined = [...today, ...tomorrow];
return combined.map((entry) => {
return [new Date(entry.hour).getTime(), entry.price];
});
color_threshold:
- value: 0
color: green
- value: 1.5
color: yellow
- value: 2.5
color: orange
- value: 3.5
color: red

4. Mini Overview with Today’s Statistics

Section titled “4. Mini Overview with Today’s Statistics”

This card shows the min, max and average price for the day:

type: markdown
title: Today's electricity prices
content: |
| Statistic | Price |
|-----------|-------|
| 🟢 Lowest | {{ state_attr('sensor.energi_data_service', 'today_min')['price'] | round(2) }} kr/kWh |
| 🔴 Highest | {{ state_attr('sensor.energi_data_service', 'today_max')['price'] | round(2) }} kr/kWh |
| 📊 Average | {{ state_attr('sensor.energi_data_service', 'today_mean') | round(2) }} kr/kWh |
| ⏰ Current | {{ states('sensor.energi_data_service') | float(0) | round(2) }} kr/kWh |

This is the smart part - calculate what it costs you right now based on your current power consumption!

Add this to your configuration.yaml (or via UI under Helpers):

template:
- sensor:
- name: "Live Electricity Cost"
unique_id: live_electricity_cost
unit_of_measurement: "kr/h"
device_class: monetary
state: >
{% set power_watts = states('sensor.your_power_sensor') | float(0) %}
{% set price_kwh = states('sensor.energi_data_service') | float(0) %}
{% set cost_per_hour = (power_watts / 1000) * price_kwh %}
{{ cost_per_hour | round(2) }}
attributes:
power_w: "{{ states('sensor.your_power_sensor') | float(0) | round(0) }}"
price_kwh: "{{ states('sensor.energi_data_service') | float(0) | round(2) }}"
description: "Cost if current consumption continues for one hour"
type: custom:mushroom-entity-card
entity: sensor.live_electricity_cost
name: Live power cost
icon: mdi:currency-usd
primary_info: state
secondary_info: name
icon_color: |
{% set cost = states('sensor.live_electricity_cost') | float(0) %}
{% if cost < 1 %}green
{% elif cost < 3 %}yellow
{% elif cost < 5 %}orange
{% else %}red
{% endif %}

Utility Meter - Day/Month/Year Consumption

Section titled “Utility Meter - Day/Month/Year Consumption”

To track your consumption over time, create Utility Meter sensors.

1. Create a Riemann Sum Sensor (kWh from Watts)

Section titled “1. Create a Riemann Sum Sensor (kWh from Watts)”

If your power meter only reports Watts, you first need to convert to kWh:

  1. Go to SettingsDevices & servicesHelpers
  2. Click + Create helperIntegral sensor
  3. Name: “Total Energy Consumption”
  4. Input sensor: Your power sensor (Watts)
  5. Integration method: “Left Riemann sum” or “Trapezoidal”
  6. Metric prefix: “kilo (k)”
  7. Time unit: “Hours”

Now create meters that reset daily, monthly and yearly:

  1. Go to SettingsDevices & servicesHelpers
  2. Click + Create helperUtility Meter
  3. Create three meters:
    • Daily consumption: Cycle = Daily
    • Monthly consumption: Cycle = Monthly
    • Yearly consumption: Cycle = Yearly
  4. Input sensor: Your kWh sensor from step 1

Create template sensors that calculate costs based on consumption and average price:

template:
- sensor:
- name: "Daily Electricity Cost"
unique_id: daily_electricity_cost
unit_of_measurement: "kr"
device_class: monetary
state: >
{% set kwh = states('sensor.daily_energy_consumption') | float(0) %}
{% set avg_price = state_attr('sensor.energi_data_service', 'today_mean') | float(0) %}
{{ (kwh * avg_price) | round(2) }}
- name: "Monthly Electricity Cost"
unique_id: monthly_electricity_cost
unit_of_measurement: "kr"
device_class: monetary
state: >
{% set kwh = states('sensor.monthly_energy_consumption') | float(0) %}
{% set avg_price = state_attr('sensor.energi_data_service', 'today_mean') | float(0) %}
{{ (kwh * avg_price) | round(2) }}
- name: "Yearly Electricity Cost"
unique_id: yearly_electricity_cost
unit_of_measurement: "kr"
device_class: monetary
state: >
{% set kwh = states('sensor.yearly_energy_consumption') | float(0) %}
{% set avg_price = state_attr('sensor.energi_data_service', 'today_mean') | float(0) %}
{{ (kwh * avg_price) | round(2) }}

Here is a combined card that shows everything in one place:

type: vertical-stack
cards:
- type: custom:mushroom-title-card
title: ⚡ Energy overview
subtitle: Live electricity prices and consumption
- type: horizontal-stack
cards:
- type: custom:mushroom-entity-card
entity: sensor.energi_data_service
name: Price now
icon: mdi:flash
primary_info: state
secondary_info: name
icon_color: |
{% set price = states('sensor.energi_data_service') | float(0) %}
{% if price < 1.5 %}green
{% elif price < 2.5 %}yellow
{% elif price < 3.5 %}orange
{% else %}red
{% endif %}
- type: custom:mushroom-entity-card
entity: sensor.live_electricity_cost
name: Live cost
icon: mdi:currency-usd
primary_info: state
secondary_info: name
- type: custom:apexcharts-card
header:
show: true
title: Prices today and tomorrow
graph_span: 48h
span:
start: day
now:
show: true
label: Now
yaxis:
- id: price
min: 0
series:
- entity: sensor.energi_data_service
type: column
data_generator: |
const today = entity.attributes.raw_today || [];
const tomorrow = entity.attributes.raw_tomorrow || [];
return [...today, ...tomorrow].map((e) => [new Date(e.hour).getTime(), e.price]);
- type: horizontal-stack
cards:
- type: statistic
entity: sensor.daily_energy_consumption
name: Today
period:
calendar:
period: day
- type: statistic
entity: sensor.monthly_energy_consumption
name: This month
period:
calendar:
period: month
- type: markdown
content: |
### 💰 Costs
| Period | Consumption | Estimate |
|--------|-------------|----------|
| Today | {{ states('sensor.daily_energy_consumption') | round(1) }} kWh | {{ states('sensor.daily_electricity_cost') | round(0) }} kr |
| This month | {{ states('sensor.monthly_energy_consumption') | round(1) }} kWh | {{ states('sensor.monthly_electricity_cost') | round(0) }} kr |
| This year | {{ states('sensor.yearly_energy_consumption') | round(0) }} kWh | {{ states('sensor.yearly_electricity_cost') | round(0) }} kr |

For even easier cost calculation you can install Dynamic Energy Cost via HACS:

This integration automatically creates sensors for:

  • Hourly costs
  • Daily costs
  • Weekly costs
  • Monthly costs
  • Yearly costs

Here is an automation that starts a device when the electricity price is low:

automation:
- alias: "Turn on washing machine when electricity is cheap"
trigger:
- platform: numeric_state
entity_id: sensor.energi_data_service
below: 1.5
condition:
- condition: time
after: "08:00:00"
before: "22:00:00"
action:
- service: switch.turn_on
target:
entity_id: switch.washing_machine
# Replace "your_phone" with the name of your device in the companion app
- service: notify.mobile_app_your_phone
data:
title: "Washing machine started"
message: "The electricity price is now {{ states('sensor.energi_data_service') }} kr/kWh"

Prices for the next day are typically published around 13:00. Before that, raw_tomorrow will be empty.

  1. Check that you selected the correct grid company
  2. Check the integration’s wiki for updated tariff information
  3. Consider a custom template for extra costs
  1. Check your internet connection
  2. Restart Home Assistant
  3. Check the log under Settings → System → Logs

Frequently Asked Questions

What is the difference between DK1 and DK2?
DK1 is western Denmark (Jutland and Funen), DK2 is eastern Denmark (Zealand and Bornholm). Prices can differ between the areas due to different production conditions.
When do tomorrow's prices arrive?
Nord Pool normally publishes prices for the next day around 13:00. Energi Data Service updates shortly after.
Does the price include VAT and taxes?
Yes, if you enabled automatic tariffs and selected your grid company, the price includes all known taxes, tariffs and 25% Danish VAT.
Can I use this with Eloverblik?
Yes, you can combine Energi Data Service (for prices) with Eloverblik (for your actual consumption) to get even more precise cost calculations.
Does it work with solar panels and selling power?
Yes, you can use separate sensors for import and export, and calculate net costs based on the spot price.

Last updated: December 2025


Comments