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.
What You’ll Get
Section titled “What You’ll Get”- 📊 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
Available Integrations
Section titled “Available Integrations”| Integration | Coverage | GitHub |
|---|---|---|
| Nordpool | Nordic countries, Baltic states | GitHub |
| EPEX Spot | Most of Europe | GitHub |
| Energi Data Service | Denmark (with tariffs) | GitHub |
Prerequisites
Section titled “Prerequisites”Before you start, you need:
- ✅ HACS installed
- ✅ Know your price region (e.g., NO1, SE3, DE-LU, etc.)
- ✅ Know your currency preference
Installation of Nordpool Integration
Section titled “Installation of Nordpool Integration”Configuration Options
Section titled “Configuration Options”| Setting | Description |
|---|---|
| Region | Your price area (e.g., NO1, SE3, DK1, FI) |
| Currency | EUR, NOK, SEK, DKK, etc. |
| VAT | Enable to add local VAT |
| Price type | kWh (recommended) |
| Low price cutoff | Percentage below average for “cheap” hours |
Sensors You’ll Get
Section titled “Sensors You’ll Get”After installation you’ll have these sensors:
| Sensor | Description |
|---|---|
sensor.nordpool_kwh_* | Current electricity price |
Attributes: today | Array of today’s hourly prices |
Attributes: tomorrow | Array of tomorrow’s hourly prices |
Attributes: min / max | Min and max price for today |
Attributes: average | Average price for today |
Dashboard Cards
Section titled “Dashboard Cards”Now for the fun part - let’s create some nice dashboard cards!
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 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.nordpool_kwh_se3_sek_3_10_025name: Current Electricity Priceicon: mdi:flash3. Price Graph for 24-48 Hours
Section titled “3. Price Graph for 24-48 Hours”This card shows hourly 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.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: red4. 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: markdowntitle: Today's Electricity Pricescontent: | | 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 |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 Template Sensor
Section titled “Create 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: "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"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 < 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:
- 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 we 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: "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) }}All-in-One Dashboard Card
Section titled “All-in-One Dashboard Card”Here’s 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.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 |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’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"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 time, the tomorrow attribute will be empty.
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
- 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.
Next Steps
Section titled “Next Steps”Last updated: December 2025