Custom component for Home Assistant to fetch energy prices of all European countries from the ENTSO-e Transparency Platform (https://transparency.entsoe.eu/). Day ahead energy prices are added as a sensor and can be used in automations to switch equipment. A 24 Hour forecast of the energy prices is in the sensors attributes and can be shown in a graph:
You need an ENTSO-e Restful API key for this integration. To request this API key, register on the Transparency Platform and send an email to [email protected] with “Restful API access” in the subject line.
The integration adds the following sensors:
- Average Day-Ahead Electricity Price Today
- Highest Day-Ahead Electricity Price Today
- Lowest Day-Ahead Electricity Price Today
- Current Day-Ahead Electricity Price
- Current Percentage Relative To Highest Electricity Price Of The Day
- Next Hour Day-Ahead Electricity Price
- Time Of Highest Energy Price Today
- Time Of Lowest Energy Price Today
Download this repository and place the contents of custom_components
in your own custom_components
map of your Home Assistant installation. Restart Home Assistant and add the integration through your settings.
Search for "ENTSO-e" when adding HACS integrations and add "ENTSO-e Transparency Platform". Restart Home Assistant and add the integration through your settings.
The sensors can be added using the web UI. In the web UI you can add your API-key and country and the sensors will automatically be added to your system. There is an optional field for an cost modifyer template.
In the optional field Price Modifyer Template
a template to modify the price to add additional costs, such as fixed costs per kWh and VAT, can be added. When left empty, no additional costs are added.
In this template now()
always refers start of the hour of that price and current_price
refers to the price itself. This way day ahead price can be modified to correct for extra costs.
An example template is given below. You can find and share other templates here.
{% set s = {
"extra_cost": 0.5352,
"winter_night": 0.265,
"winter_day": 0.465,
"summer_day": 0.284,
"summer_night": 0.246,
"VAT": 1.21
}
%}
{% if now().month >= 5 and now().month <11 %}
{% if now().hour >=6 and now().hour <23 %}
{{(current_price + s.summer_day+s.extra_cost) * s.VAT | float}}
{% else %}
{{(current_price + s.summer_night + s.extra_cost) * s.VAT | float}}
{% endif %}
{% else %}
{% if now().hour >=6 and now().hour <23 %}
{{(current_price + s.winter_day + s.extra_cost) * s.VAT | float}}
{%else%}
{{(current_price + s.winter_night + s.extra_cost) * s.VAT | float}}
{% endif %}
{% endif %}
Prices can be shown using the ApexChart Graph Card like in the example above. The Lovelace code for this graph is given below:
type: custom:apexcharts-card
graph_span: 24h
span:
start: day
now:
show: true
label: Now
header:
show: true
title: Electriciteitsprijzen Vandaag (€/kwh)
series:
# This is the entity ID with no name configured.
# When a name is configured it will be sensor.<name>_average_electricity_price_today.
- entity: sensor.average_electricity_price_today
stroke_width: 2
float_precision: 3
type: column
opacity: 1
color: ''
data_generator: |
return entity.attributes.prices_today.map((record, index) => {
return [record.time, record.price];
});
The integration is in an early state and receives a lot of updates. If you already setup this integration and encounter an error after updating, please try redoing the above installation steps.