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.
What You Get
Section titled “What You Get”- 📊 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
Prerequisites
Section titled “Prerequisites”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)
Installing Energi Data Service
Section titled “Installing Energi Data Service”Configuration Settings
Section titled “Configuration Settings”| Setting | Recommendation |
|---|---|
| Country | Denmark |
| Price area | DK1 (west) or DK2 (east) |
| Price type | kWh |
| VAT | Yes (25%) |
| Tariffs | Automatic from grid company |
| Grid company | Pick yours (e.g. Radius, N1, TREFOR) |
Sensors You Get
Section titled “Sensors You Get”After installation you have these sensors:
| Sensor | Description |
|---|---|
sensor.energi_data_service | Current electricity price incl. taxes |
sensor.energi_data_service_forecast | Forecast 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.
Dashboard Cards
Section titled “Dashboard Cards”With the sensors in place you can build dashboard cards that show prices as graphs and statistics.
1. Install ApexCharts Card
Section titled “1. Install ApexCharts Card”First install ApexCharts Card via HACS:
- Go to HACS → Frontend
- Click + Explore & download repositories
- Search for “ApexCharts Card”
- Click Download → Download
- Reload your browser (Ctrl+F5)
2. Simple Price Display (Current Price)
Section titled “2. Simple Price Display (Current Price)”This card shows the current electricity price:
type: entityentity: sensor.energi_data_servicename: Current electricity priceicon: mdi:flash3. Price Graph for 24-48 Hours
Section titled “3. Price Graph for 24-48 Hours”This card shows the prices as a bar chart with colors based on price:
type: custom:apexcharts-cardheader: show: true title: Electricity prices today and tomorrow show_states: true colorize_states: truegraph_span: 48hspan: start: daynow: show: true label: Now color: redyaxis: - id: price decimals: 2 min: 0 apex_config: tickAmount: 5experimental: color_threshold: trueseries: - 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: red4. 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: markdowntitle: Today's electricity pricescontent: | | 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 |Live Costs Based on Watt Consumption
Section titled “Live Costs Based on Watt Consumption”This is the smart part - calculate what it costs you right now based on your current power consumption!
Create a Template Sensor
Section titled “Create a Template Sensor”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"Dashboard Card for Live Cost
Section titled “Dashboard Card for Live Cost”type: custom:mushroom-entity-cardentity: sensor.live_electricity_costname: Live power costicon: mdi:currency-usdprimary_info: statesecondary_info: nameicon_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:
- Go to Settings → Devices & services → Helpers
- Click + Create helper → Integral sensor
- Name: “Total Energy Consumption”
- Input sensor: Your power sensor (Watts)
- Integration method: “Left Riemann sum” or “Trapezoidal”
- Metric prefix: “kilo (k)”
- Time unit: “Hours”
2. Create Utility Meters
Section titled “2. Create Utility Meters”Now create meters that reset daily, monthly and yearly:
- Go to Settings → Devices & services → Helpers
- Click + Create helper → Utility Meter
- Create three meters:
- Daily consumption: Cycle = Daily
- Monthly consumption: Cycle = Monthly
- Yearly consumption: Cycle = Yearly
- Input sensor: Your kWh sensor from step 1
utility_meter: daily_energy_consumption: source: sensor.total_energy_consumption name: Daily Energy Consumption cycle: daily monthly_energy_consumption: source: sensor.total_energy_consumption name: Monthly Energy Consumption cycle: monthly yearly_energy_consumption: source: sensor.total_energy_consumption name: Yearly Energy Consumption cycle: yearly3. Calculate Costs per Day/Month/Year
Section titled “3. Calculate Costs per Day/Month/Year”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) }}All-in-One Dashboard Card
Section titled “All-in-One Dashboard Card”Here is a combined card that shows everything in one place:
type: vertical-stackcards: - 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 |Bonus: Dynamic Energy Cost Integration
Section titled “Bonus: Dynamic Energy Cost Integration”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
Automation: Run When Electricity Is Cheap
Section titled “Automation: Run When Electricity Is Cheap”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"Troubleshooting
Section titled “Troubleshooting”No data for tomorrow
Section titled “No data for tomorrow”Prices for the next day are typically published around 13:00. Before that, raw_tomorrow will be empty.
Wrong tariffs
Section titled “Wrong tariffs”- Check that you selected the correct grid company
- Check the integration’s wiki for updated tariff information
- Consider a custom template for extra costs
Sensor shows 0 or unavailable
Section titled “Sensor shows 0 or unavailable”- Check your internet connection
- Restart Home Assistant
- 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.
Next Steps
Section titled “Next Steps”Last updated: December 2025
Comments
SmartBolig // AI Core
SmartBolig AI
Get help with troubleshooting, architecture and concrete configuration. I use broad AI knowledge and find SmartBolig guides when they improve the answer.
Start with a useful question