A Home Assistant integration that calculates real electricity prices for Ecopower customers in Belgium, including all taxes, fees, and supplier margins.
- Features
- Charts
- Installation
- Configuration
- Supported Source Integrations
- Entities Created
- Price Formulas
- Sensor Attributes
- Example ApexCharts Card
- License
- Contributing
- Parses existing price sensors from EPEX Spot or Energi Data Service integrations
- Calculates consumption prices with all Belgian energy costs and Ecopower margins
- Calculates injection prices with Ecopower deductions
- Editable cost parameters via number entities - change values at runtime
- Full price arrays in sensor attributes for easy charting with ApexCharts
- Multiple instances supported - track different source sensors with separate configurations
Example ApexCharts card showing today's consumption prices with color-coded thresholds (green for low, orange for medium, red for high prices):
type: custom:apexcharts-card
grid_options:
columns: full
graph_span: 24h00m
experimental:
color_threshold: true
header:
title: Consumption Prices (Today)
show: true
show_states: true
span:
start: day
now:
show: true
label: now
color: darkblue
series:
- entity: sensor.ecopower_energi_consumption_price
type: column
name: Consumption Price
extend_to: end
unit: €/kWh
float_precision: 4
yaxis_id: Price
show:
in_header: before_now
extremas: true
header_color_threshold: true
color_threshold:
- value: 0.15
color: "#99CC00"
- value: 0.25
color: "#ed8c0e"
- value: 0.35
color: "#e22904"
data_generator: |
const data = entity.attributes.data;
if (!data) {
console.log("ApexCharts: No 'data' attribute found!");
return [];
}
return data
.filter(entry => entry.start_time && entry.price_per_kwh !== undefined)
.map(entry => [new Date(entry.start_time).getTime(), entry.price_per_kwh]);
group_by:
func: avg
duration: 15min
yaxis:
- id: Price
decimals: 4
apex_config:
title:
text: €/kWh
tickAmount: 5
apex_config:
legend:
show: true
tooltip:
x:
show: true
format: HH:mmExample ApexCharts card showing today's injection prices with color-coded thresholds (red for negative/low, orange for medium, green for high prices):
type: custom:apexcharts-card
grid_options:
columns: full
graph_span: 24h00m
experimental:
color_threshold: true
header:
title: Injection Prices (Today)
show: true
show_states: true
span:
start: day>?"|
now:
show: true
label: now
color: darkblue
series:
- entity: sensor.ecopower_energi_injection_price
type: column
name: Injection Price
extend_to: end
unit: €/kWh
float_precision: 4
yaxis_id: Price
show:
in_header: before_now
extremas: true
header_color_threshold: true
color_threshold:
- value: 0.00
color: "#e22904"
- value: 0.05
color: "#ed8c0e"
- value: 0.10
color: "#99CC00"
data_generator: |
const data = entity.attributes.data;
if (!data) {
console.log("ApexCharts: No 'data' attribute found!");
return [];
}
return data
.filter(entry => entry.start_time && entry.price_per_kwh !== undefined)
.map(entry => [new Date(entry.start_time).getTime(), entry.price_per_kwh]);
group_by:
func: avg
duration: 15min
yaxis:
- id: Price
decimals: 4
apex_config:
title:
text: €/kWh
tickAmount: 5
apex_config:
legend:
show: true
tooltip:
x:
show: true
format: HH:mmExample ApexCharts card showing tomorrow's consumption prices with color-coded thresholds (green for low, orange for medium, red for high prices):
type: custom:apexcharts-card
grid_options:
columns: full
graph_span: 24h00m
experimental:
color_threshold: true
header:
title: Consumption Prices (Tomorrow)
show: true
show_states: true
span:
start: day
offset: +1d
now:
show: false
series:
- entity: sensor.ecopower_energi_consumption_price
type: column
name: Consumption Price
extend_to: end
unit: €/kWh
float_precision: 4
yaxis_id: Price
show:
extremas: true
header_color_threshold: true
color_threshold:
- value: 0.15
color: "#99CC00"
- value: 0.25
color: "#ed8c0e"
- value: 0.35
color: "#e22904"
data_generator: |
const data = entity.attributes.raw_tomorrow;
if (!data || data.length === 0) {
console.log("ApexCharts: No 'raw_tomorrow' attribute found or empty!");
return [];
}
return data
.filter(entry => entry.hour && entry.price !== undefined)
.map(entry => [new Date(entry.hour).getTime(), entry.price]);
group_by:
func: avg
duration: 15min
yaxis:
- id: Price
decimals: 4
apex_config:
title:
text: €/kWh
tickAmount: 5
apex_config:
legend:
show: true
tooltip:
x:
show: true
format: HH:mmExample ApexCharts card showing tomorrow's injection prices with color-coded thresholds (red for negative/low, orange for medium, green for high prices):
type: custom:apexcharts-card
grid_options:
columns: full
graph_span: 24h00m
experimental:
color_threshold: true
header:
title: Injection Prices (Tomorrow)
show: true
show_states: true
span:
start: day
offset: +1d
now:
show: false
series:
- entity: sensor.ecopower_energi_injection_price
type: column
name: Injection Price
extend_to: end
unit: €/kWh
float_precision: 4
yaxis_id: Price
show:
extremas: true
header_color_threshold: true
color_threshold:
- value: 0.00
color: "#e22904"
- value: 0.05
color: "#ed8c0e"
- value: 0.10
color: "#99CC00"
data_generator: |
const data = entity.attributes.raw_tomorrow;
if (!data || data.length === 0) {
console.log("ApexCharts: No 'raw_tomorrow' attribute found or empty!");
return [];
}
return data
.filter(entry => entry.hour && entry.price !== undefined)
.map(entry => [new Date(entry.hour).getTime(), entry.price]);
group_by:
func: avg
duration: 15min
yaxis:
- id: Price
decimals: 4
apex_config:
title:
text: €/kWh
tickAmount: 5
apex_config:
legend:
show: true
tooltip:
x:
show: true
format: HH:mm- Open HACS in Home Assistant
- Click on "Integrations"
- Click the three dots in the top right corner
- Select "Custom repositories"
- Add
https://github.com/eliaslecomte/ecopower-dynamic-pricesas an Integration - Click "Install"
- Restart Home Assistant
- Copy the
custom_components/ecopower_dynamic_pricesfolder to your Home Assistantcustom_componentsdirectory - Restart Home Assistant
- Go to Settings > Devices & Services
- Click Add Integration
- Search for "Ecopower Dynamic Prices"
- Select your source sensor (from EPEX Spot or Energi Data Service)
- Configure cost parameters (defaults are provided for Ecopower Belgium)
The integration will create a device named based on your source sensor, e.g., "Ecopower (Epex Spot)" or "Ecopower (Energi Data Service Total Price)".
Entity IDs are automatically generated based on the source sensor name. For example, if your source sensor is sensor.epex_spot_be_price, entities will be named like sensor.ecopower_epex_spot_be_price_consumption_price.
| Entity | Description |
|---|---|
sensor.<name>_consumption_price |
Current consumption price with all costs |
sensor.<name>_injection_price |
Current injection price with deductions |
All cost parameters can be adjusted at runtime via number entities.
Ecopower-specific:
| Entity | Default | Description |
|---|---|---|
number.<name>_consumption_multiplier |
1.02 | Ecopower margin on market price |
number.<name>_ecopower_tariff |
0.004 €/kWh | Ecopower administrative cost |
number.<name>_injection_multiplier |
0.98 | Ecopower margin on injection |
number.<name>_injection_deduction |
0.015 €/kWh | Ecopower injection fee |
Belgian Energy Costs:
| Entity | Default | Description |
|---|---|---|
number.<name>_gsc_groene_stroom |
0.011 €/kWh | Green electricity certificates |
number.<name>_wkk |
0.0039 €/kWh | CHP certificates |
number.<name>_afname_tarief |
0.0589 €/kWh | Distribution network tariff |
number.<name>_bijdrage_energie |
0.0019 €/kWh | Energy contribution fee |
number.<name>_bijzondere_accijns |
0.0475 €/kWh | Special excise tax |
number.<name>_btw_vat_rate |
6 % | VAT percentage |
((market_price * consumption_multiplier) + all_costs) * (1 + vat_rate / 100)
Where all_costs = supplier_cost + green_certificates + chp_certificates + distribution_cost + energy_contribution + excise_tax
(market_price * injection_multiplier) - injection_deduction
Both sensors include rich attributes for charting:
# Detailed format (like EPEX Spot)
data:
- start_time: '2025-12-25T00:00:00+01:00'
end_time: '2025-12-25T01:00:00+01:00'
price_per_kwh: 0.1892
# Simplified format (like Energi Data Service)
raw_today:
- hour: '2025-12-25T00:00:00+01:00'
price: 0.1892
today: [0.1892, 0.1856, ...]
tomorrow: [0.2134, ...]
# Statistics
today_min: 0.1523
today_max: 0.2456
today_mean: 0.1834
tomorrow_min: 0.1456
tomorrow_max: 0.2234
tomorrow_mean: 0.1756
tomorrow_valid: true
source_entity: sensor.epex_spot_be_pricetype: custom:apexcharts-card
header:
show: true
title: Electricity Prices
graph_span: 48h
span:
start: day
series:
- entity: sensor.ecopower_epex_spot_consumption_price
name: Consumption
data_generator: |
return entity.attributes.data.map((entry) => {
return [new Date(entry.start_time).getTime(), entry.price_per_kwh];
});
- entity: sensor.ecopower_epex_spot_injection_price
name: Injection
data_generator: |
return entity.attributes.data.map((entry) => {
return [new Date(entry.start_time).getTime(), entry.price_per_kwh];
});MIT License - see LICENSE file for details.
Contributions are welcome! Please open an issue or pull request on GitHub.



