Skip to content

Electricity Price Integration

With electricity price integrations like Nordpool or EPEX Spot, you can get real-time electricity prices directly in Home Assistant. Perfect for saving money by running your washing machine, dishwasher, and EV charging when electricity is cheapest.

  • 📊 Hourly prices for today and tomorrow (after ~13:00)
  • 💰 Total prices including all tariffs and fees
  • 📈 Graphs showing price development
  • Live costs based on your current consumption
  • 📅 Accumulated consumption per day, month and year
IntegrationCoverageGitHub
NordpoolNordic countries, Baltic statesGitHub
EPEX SpotMost of EuropeGitHub
Energi Data ServiceDenmark (with tariffs)GitHub

Before you start, you need:

  • HACS installed
  • ✅ Know your price region (e.g., NO1, SE3, DE-LU, etc.)
  • ✅ Know your currency preference
SettingDescription
RegionYour price area (e.g., NO1, SE3, DK1, FI)
CurrencyEUR, NOK, SEK, DKK, etc.
VATEnable to add local VAT
Price typekWh (recommended)
Low price cutoffPercentage below average for “cheap” hours

After installation you’ll have these sensors:

SensorDescription
sensor.nordpool_kwh_*Current electricity price
Attributes: todayArray of today’s hourly prices
Attributes: tomorrowArray of tomorrow’s hourly prices
Attributes: min / maxMin and max price for today
Attributes: averageAverage price for today

Now for the fun part - let’s create some nice dashboard cards!

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 browser (Ctrl+F5)

This card shows the current electricity price:

type: entity
entity: sensor.nordpool_kwh_se3_sek_3_10_025
name: Current Electricity Price
icon: mdi:flash

This card shows hourly 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.nordpool_kwh_se3_sek_3_10_025
name: Price
unit: EUR/kWh
yaxis_id: price
type: column
float_precision: 3
data_generator: |
const today = entity.attributes.today || [];
const tomorrow = entity.attributes.tomorrow || [];
const now = new Date();
const startOfDay = new Date(now.getFullYear(), now.getMonth(), now.getDate());
return today.map((price, index) => {
const time = new Date(startOfDay.getTime() + index * 3600000);
return [time.getTime(), price];
}).concat(tomorrow.map((price, index) => {
const time = new Date(startOfDay.getTime() + (24 + index) * 3600000);
return [time.getTime(), price];
}));
color_threshold:
- value: 0
color: green
- value: 0.10
color: yellow
- value: 0.20
color: orange
- value: 0.30
color: red

4. Mini Overview with Today’s Statistics

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

This card shows min, max and average price for today:

type: markdown
title: Today's Electricity Prices
content: |
| Statistic | Price |
|-----------|-------|
| 🟢 Lowest | {{ state_attr('sensor.nordpool_kwh_se3_sek_3_10_025', 'min') | round(3) }} EUR/kWh |
| 🔴 Highest | {{ state_attr('sensor.nordpool_kwh_se3_sek_3_10_025', 'max') | round(3) }} EUR/kWh |
| 📊 Average | {{ state_attr('sensor.nordpool_kwh_se3_sek_3_10_025', 'average') | round(3) }} EUR/kWh |
| ⏰ Current | {{ states('sensor.nordpool_kwh_se3_sek_3_10_025') | round(3) }} EUR/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: "EUR/h"
device_class: monetary
state: >
{% set power_watts = states('sensor.your_power_sensor') | float(0) %}
{% set price_kwh = states('sensor.nordpool_kwh_se3_sek_3_10_025') | float(0) %}
{% set cost_per_hour = (power_watts / 1000) * price_kwh %}
{{ cost_per_hour | round(3) }}
attributes:
power_w: "{{ states('sensor.your_power_sensor') | float(0) | round(0) }}"
price_kwh: "{{ states('sensor.nordpool_kwh_se3_sek_3_10_025') | float(3) }}"
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 < 0.05 %}green
{% elif cost < 0.15 %}yellow
{% elif cost < 0.25 %}orange
{% else %}red
{% endif %}

Utility Meter - Day/Month/Year Consumption

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

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

1. Create Riemann Sum Sensor (kWh from Watt)

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

If your power meter only shows 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 we 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: "EUR"
device_class: monetary
state: >
{% set kwh = states('sensor.daily_energy_consumption') | float(0) %}
{% set avg_price = state_attr('sensor.nordpool_kwh_se3_sek_3_10_025', 'average') | float(0.1) %}
{{ (kwh * avg_price) | round(2) }}
- name: "Monthly Electricity Cost"
unique_id: monthly_electricity_cost
unit_of_measurement: "EUR"
device_class: monetary
state: >
{% set kwh = states('sensor.monthly_energy_consumption') | float(0) %}
{% set avg_price = state_attr('sensor.nordpool_kwh_se3_sek_3_10_025', 'average') | float(0.1) %}
{{ (kwh * avg_price) | round(2) }}
- name: "Yearly Electricity Cost"
unique_id: yearly_electricity_cost
unit_of_measurement: "EUR"
device_class: monetary
state: >
{% set kwh = states('sensor.yearly_energy_consumption') | float(0) %}
{% set avg_price = state_attr('sensor.nordpool_kwh_se3_sek_3_10_025', 'average') | float(0.1) %}
{{ (kwh * avg_price) | round(2) }}

Here’s 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.nordpool_kwh_se3_sek_3_10_025
name: Price now
icon: mdi:flash
primary_info: state
secondary_info: name
icon_color: |
{% set price = states('sensor.nordpool_kwh_se3_sek_3_10_025') | float(0) %}
{% if price < 0.10 %}green
{% elif price < 0.20 %}yellow
{% elif price < 0.30 %}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: Hourly Prices
graph_span: 48h
span:
start: day
now:
show: true
label: Now
yaxis:
- id: price
min: 0
series:
- entity: sensor.nordpool_kwh_se3_sek_3_10_025
type: column
data_generator: |
const today = entity.attributes.today || [];
const tomorrow = entity.attributes.tomorrow || [];
const now = new Date();
const start = new Date(now.getFullYear(), now.getMonth(), now.getDate());
return today.map((p, i) => [start.getTime() + i*3600000, p])
.concat(tomorrow.map((p, i) => [start.getTime() + (24+i)*3600000, p]));
- 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(2) }} EUR |
| This month | {{ states('sensor.monthly_energy_consumption') | round(1) }} kWh | {{ states('sensor.monthly_electricity_cost') | round(2) }} EUR |
| This year | {{ states('sensor.yearly_energy_consumption') | round(0) }} kWh | {{ states('sensor.yearly_electricity_cost') | round(2) }} EUR |

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’s 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.nordpool_kwh_se3_sek_3_10_025
below: 0.08
condition:
- condition: time
after: "08:00:00"
before: "22:00:00"
action:
- service: switch.turn_on
target:
entity_id: switch.washing_machine
- service: notify.mobile_app
data:
title: "Washing machine started"
message: "Electricity price is now {{ states('sensor.nordpool_kwh_se3_sek_3_10_025') }} EUR/kWh"

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

  1. Check your internet connection
  2. Restart Home Assistant
  3. Check the log under Settings → System → Logs
  4. Verify your region code is correct

Ofte stillede spørgsmål

What are the different price regions?
Nordpool divides the Nordic market into regions: NO1-NO5 (Norway), SE1-SE4 (Sweden), DK1-DK2 (Denmark), FI (Finland), and Baltic states. Each region can have different prices.
When do tomorrow's prices arrive?
Nord Pool typically publishes prices for the next day around 13:00 CET. The integration updates shortly after.
Does the price include VAT and fees?
The Nordpool integration shows spot prices. You can enable VAT in the settings. For additional fees and tariffs, you may need to use templates or integrations specific to your country.
Can I use this with solar panels?
Yes, you can use separate sensors for import and export, and calculate net costs based on the spot price.
Which integration should I use?
Use Nordpool for Nordic countries, EPEX Spot for Central Europe, or country-specific integrations like Energi Data Service (Denmark) or Tibber for more features.

Last updated: December 2025


Kommentarer