Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[entsoe] Initial contribution #17416

Open
wants to merge 13 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 12 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@
/bundles/org.openhab.binding.enigma2/ @gdolfen
/bundles/org.openhab.binding.enocean/ @fruggy83
/bundles/org.openhab.binding.enphase/ @Hilbrand
/bundles/org.openhab.binding.entsoe/ @jmelhus
/bundles/org.openhab.binding.enturno/ @klocsson
/bundles/org.openhab.binding.ephemeris/ @clinique
/bundles/org.openhab.binding.epsonprojector/ @mlobstein
Expand Down
5 changes: 5 additions & 0 deletions bom/openhab-addons/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -506,6 +506,11 @@
<artifactId>org.openhab.binding.enphase</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.openhab.addons.bundles</groupId>
<artifactId>org.openhab.binding.entsoe</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.openhab.addons.bundles</groupId>
<artifactId>org.openhab.binding.enturno</artifactId>
Expand Down
13 changes: 13 additions & 0 deletions bundles/org.openhab.binding.entsoe/NOTICE
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
This content is produced and maintained by the openHAB project.

* Project home: https://www.openhab.org

== Declared Project Licenses

This program and the accompanying materials are made available under the terms
of the Eclipse Public License 2.0 which is available at
https://www.eclipse.org/legal/epl-2.0/.

== Source Code

https://github.com/openhab/openhab-addons
85 changes: 85 additions & 0 deletions bundles/org.openhab.binding.entsoe/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
# ENTSO-E Binding

This binding fetches day-ahead energy spot prices from ENTSO-E, the European Network of Transmission System Operators for Electricity. Users can select a specific area to retrieve the relevant energy prices. This binding helps users monitor and manage their energy consumption based on real-time pricing data.
jmelhus marked this conversation as resolved.
Show resolved Hide resolved
This binding fetches day-ahead energy spot prices from ENTSO-E, the European Network of Transmission System Operators for Electricity.
Users can select a specific area to retrieve the relevant energy prices.
This binding helps users monitor and manage their energy consumption based on real-time pricing data.
It is recommended to use this binding together with a currency provider (g.e. Freecurrency binding) for UoM support and exchanging euro spot prices in to local valuta.
jmelhus marked this conversation as resolved.
Show resolved Hide resolved

## Supported Things

- `day-ahead`: This is the main and single Thing of the binding.

## Thing Configuration

To access the ENTSO-E Transparency Platform API, users need a **security token** for authentication and authorization.
This token ensure secure access to the platform's data and services.
For detailed instructions on obtaining this token, you can refer to the [ENTSO-E API Guide 2. Authentication and Authorisation](https://transparency.entsoe.eu/content/static_content/Static%20content/web%20api/Guide.html#_authentication_and_authorisation).

Mandatory parameters of the Thing is security token and area.
jmelhus marked this conversation as resolved.
Show resolved Hide resolved
Optional parameter are historic days.
jmelhus marked this conversation as resolved.
Show resolved Hide resolved

Thing can be added in graphical user interface of openHAB or manually within a things file.

### `entsoe` Thing Configuration

| Name | Type | Description | Default | Required | Advanced |
|-------------------------------|-------------------|---------------------------------------------------------------------------|-----------|----------|----------|
| securityToken | text | Security token to fetch from ENTSO-E | N/A | yes | no |
| area | text | Area | N/A | yes | no |
| historicDays | integer | Historic days to get prices from (will use exchange rate as of today) | 0 | no | no |
| spotPricesAvailableUtcHour | integer | Which UTC hour binding assumes new spot prices for next day is available | 12 | no | yes |

## Channels

Binding has one channel.

spot-price which are the values fetched from ENTSO-E and persisted in openHAB as time series.
The price is per kWh at your selected base currency.

| Channel | Type | Read/Write | Description |
|--------------------------|-----------------------|------------|-------------------------------------------|
| spot-price | Number:EnergyPrice | R | Spot prices |

### Thing Configuration

```java
Thing entsoe:day-ahead:eda "Entsoe Day Ahead" [ securityToken="your-security-token", area="10YNO-3--------J", historicDays=14 ]
```

### Item Configuration

```java
Number:EnergyPrice energySpotPrice "Current Spot Price" <price> { channel="entsoe:day-ahead:eda:spot-price" }
```

#### Value-Added Tax

VAT is not included in any of the prices.
To include VAT for items linked to the `Number` channels, the [VAT profile](https://www.openhab.org/addons/transformations/vat/) can be used.
jmelhus marked this conversation as resolved.
Show resolved Hide resolved
This must be installed separately.
Once installed, simply select "Value-Added Tax" as Profile when linking an item.

#### Total Price

_Please note:_ There is no channel providing the total price.
Instead, create a group item with `SUM` as aggregate function and add the individual price items as children.
Read more about how to in this similar binding [energidataservice](https://www.openhab.org/addons/bindings/energidataservice/#total-price)
jmelhus marked this conversation as resolved.
Show resolved Hide resolved

### Trigger Channels

Channel `prices-received` is triggered when new prices are available
jmelhus marked this conversation as resolved.
Show resolved Hide resolved

### Examples

examples.rules

```java
rule "Spot prices received"
jmelhus marked this conversation as resolved.
Show resolved Hide resolved
when
Channel "entsoe:day-ahead:eda:prices-received" triggered
then
// Do something within rule
logInfo("ENTSO-E Rule", "ENTSO-E channel triggered, new spot prices available")
end
```
17 changes: 17 additions & 0 deletions bundles/org.openhab.binding.entsoe/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">

<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>org.openhab.addons.bundles</groupId>
<artifactId>org.openhab.addons.reactor.bundles</artifactId>
<version>4.3.0-SNAPSHOT</version>
</parent>

<artifactId>org.openhab.binding.entsoe</artifactId>

<name>openHAB Add-ons :: Bundles :: ENTSO-E Binding</name>

</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<features name="org.openhab.binding.entsoe-${project.version}" xmlns="http://karaf.apache.org/xmlns/features/v1.4.0">
<repository>mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features</repository>

<feature name="openhab-binding-entsoe" description="ENTSO-E Binding" version="${project.version}">
<feature>openhab-runtime-base</feature>
<bundle start-level="80">mvn:org.openhab.addons.bundles/org.openhab.binding.entsoe/${project.version}</bundle>
</feature>
</features>
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
/**
* Copyright (c) 2010-2024 Contributors to the openHAB project
*
* See the NOTICE file(s) distributed with this work for additional
* information.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0
*
* SPDX-License-Identifier: EPL-2.0
*/
package org.openhab.binding.entsoe.internal;

import java.util.Set;

import org.eclipse.jdt.annotation.NonNullByDefault;
import org.openhab.core.thing.ThingTypeUID;
import org.openhab.core.types.TimeSeries.Policy;

/**
* The {@link EntsoeBindingConstants} class defines common constants, which are
* used across the whole binding.
*
* @author Jørgen Melhus - Initial contribution
* @author Miika Jukka - Initial contribution
*/
@NonNullByDefault
public class EntsoeBindingConstants {

private static final String BINDING_ID = "entsoe";

public static final Policy TIMESERIES_POLICY = Policy.REPLACE;

public static final String ENTSOE_CURRENCY = "EUR";

public static final String CHANNEL_SPOT_PRICES = "spot-price";
jmelhus marked this conversation as resolved.
Show resolved Hide resolved

public static final String CHANNEL_TRIGGER_PRICES_RECEIVED = "prices-received";

// Thing Type UIDs
public static final ThingTypeUID THING_TYPE_DAY_AHEAD = new ThingTypeUID(BINDING_ID, "day-ahead");

// List of all Thing Type UIDs
public static final Set<ThingTypeUID> SUPPORTED_THING_TYPE_UIDS = Set.of(THING_TYPE_DAY_AHEAD);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/**
* Copyright (c) 2010-2024 Contributors to the openHAB project
*
* See the NOTICE file(s) distributed with this work for additional
* information.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0
*
* SPDX-License-Identifier: EPL-2.0
*/
package org.openhab.binding.entsoe.internal;

import org.eclipse.jdt.annotation.NonNullByDefault;

/**
* The {@link EntsoeConfiguration} class contains fields mapping thing configuration parameters.
*
* @author Jørgen Melhus - Initial contribution
*/
@NonNullByDefault
public class EntsoeConfiguration {
public String securityToken = "";
public String area = "";
public int spotPricesAvailableUtcHour = 11;
public int historicDays = 1;
}
Loading