-
Notifications
You must be signed in to change notification settings - Fork 0
ENTSO-E agent #15
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
Merged
Merged
ENTSO-E agent #15
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
04c5e9f
Set-up to make running tests in extensions repo work
ebariaux 745d1a4
Implement an ENTSO-E agent
ebariaux 703d7fa
Merge branch 'main' into feature/entsoe-agent
wborn 63478fc
Support multiple <Period> entries in a single <TimeSeries>
ebariaux dfbc582
Add licence header
ebariaux bd1a943
Improve fetching so that if multiple attributes sahre the same zone f…
ebariaux 01852fd
Use proper package
ebariaux eda80dc
Ensure an unexpected exception does not stop the scheduling
ebariaux 676f6c0
Harden XML parsing
ebariaux 1c7170a
Better parsing of reason text in case of errors
ebariaux 7095bcc
Properly close Resteasy client in test cleanup
ebariaux 45582d0
Don't run tests for now in CI/CD, the pipeline does not properly setu…
ebariaux d4eefda
Merge branch 'main' into feature/entsoe-agent
wborn c6e420c
Add documentation for ENTSO-E agent in this repo
ebariaux f9099de
Improve documentation discoverability
wborn File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| # ENTSO-E | ||
|
|
||
| ## Introduction | ||
|
|
||
| [ENTSO-E](https://www.entsoe.eu/data/transparency-platform/) is a European transparency platform for the energy market that provides | ||
| a large collection of energy related data. | ||
|
|
||
| This agent uses their [REST API](https://documenter.getpostman.com/view/7009892/2s93JtP3F6#3b383df0-ada2-49fe-9a50-98b1bb201c6b) to retrieve the `Energy Prices` (document type A44) data. | ||
|
|
||
| ## Prerequisites | ||
|
|
||
| Accessing the REST API requires a security token. You must create an account and request such a token for your own usage. | ||
| To do so, follow the process described at [How to get security token? – Transparency Platform](https://transparencyplatform.zendesk.com/hc/en-us/articles/12845911031188-How-to-get-security-token). | ||
|
|
||
| ## Agent usage | ||
|
|
||
| ### ENTSO-E Agent | ||
|
|
||
| To get access to the data, add an ENTSO-E agent to your configuration. | ||
| On the agent, fill-in the `Security token` attribute with the token you got from ENTSO-E (see [Prerequisites](#prerequisites) above). | ||
| You can optionally add the `Polling millis` attribute to set the polling frequency. It defaults to 1h. | ||
|
|
||
| ### Getting the data | ||
|
|
||
| Retrieved pricing data is stored as predicted datapoints of any compatible asset attribute in your configuration. | ||
| Note: Compatible means capable of storing positive or negative decimal numbers i.e. the attribute type must be Number or Big Number. | ||
| If the attribute is of a different type a warning log will be generated, predicted datapoints will still be generated | ||
| but inconsistencies in the system will occur (e.g. errors while trying to graph the attribute). | ||
|
|
||
| On an attribute of type `Number`, add an `Agent link` configuration (MetaItem). | ||
| Select the ENTSO-E agent created above, a `Zone` field will appear. | ||
| This indicates the region to fetch data for and must be an [Energy Identification Codes](https://www.entsoe.eu/data/energy-identification-codes-eic/). | ||
| [EIC Approved codes](https://www.entsoe.eu/data/energy-identification-codes-eic/eic-approved-codes/) provides a complete list of the available code. | ||
| Tip: when searching, be sure to select "All Codes" for the "EIC Type Code" criteria. | ||
| You'll for instance find that `10YNL----------L` is the code to use for The Netherlands. | ||
|
|
||
| Make sure to also add the `Has predicted data points` configuration to your attribute. | ||
|
|
||
|  |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,87 @@ | ||
| apply plugin: "groovy" | ||
| apply plugin: "java-library" | ||
| apply plugin: "maven-publish" | ||
| apply plugin: "signing" | ||
|
|
||
| base { | ||
| archivesName = "openremote-${project.name}-extension" | ||
| } | ||
|
|
||
| dependencies { | ||
| api "io.openremote:openremote-manager:$openremoteVersion" | ||
| api "io.openremote:openremote-model:$openremoteVersion" | ||
|
|
||
| api "org.jboss.resteasy:resteasy-client-api:$resteasyVersion" | ||
| api "org.jboss.resteasy:resteasy-jaxb-provider:$resteasyVersion" | ||
|
|
||
| testImplementation "io.openremote:openremote-test:$openremoteVersion" | ||
| } | ||
|
|
||
| jar { | ||
| from sourceSets.main.allJava | ||
| } | ||
|
|
||
| javadoc { | ||
| failOnError = false | ||
| } | ||
|
|
||
| java { | ||
| withJavadocJar() | ||
| withSourcesJar() | ||
| } | ||
|
|
||
| publishing { | ||
| publications { | ||
| maven(MavenPublication) { | ||
| group = "io.openremote.extension" | ||
| artifactId = "openremote-${project.name}-extension" | ||
| from components.java | ||
| pom { | ||
| name = 'OpenRemote ENTSO-E extension' | ||
| description = 'Adds the ENTSO-E extension' | ||
| url = 'https://github.com/openremote/extensions' | ||
| licenses { | ||
| license { | ||
| name = 'GNU Affero General Public License v3.0' | ||
| url = 'https://www.gnu.org/licenses/agpl-3.0.en.html' | ||
| } | ||
| } | ||
| developers { | ||
| developer { | ||
| id = 'developers' | ||
| name = 'Developers' | ||
| email = 'developers@openremote.io' | ||
| organization = 'OpenRemote' | ||
| organizationUrl = 'https://openremote.io' | ||
| } | ||
| } | ||
| scm { | ||
| connection = 'scm:git:git://github.com/openremote/extensions.git' | ||
| developerConnection = 'scm:git:ssh://github.com:openremote/extensions.git' | ||
| url = 'https://github.com/openremote/extensions/tree/main' | ||
| } | ||
| } | ||
| } | ||
| } | ||
|
|
||
| repositories { | ||
| maven { | ||
| if (!version.endsWith('-LOCAL')) { | ||
| credentials { | ||
| username = findProperty("publishUsername") | ||
| password = findProperty("publishPassword") | ||
| } | ||
| } | ||
| url = version.endsWith('-LOCAL') ? layout.buildDirectory.dir('repo') : version.endsWith('-SNAPSHOT') ? findProperty("snapshotsRepoUrl") : findProperty("releasesRepoUrl") | ||
| } | ||
| } | ||
| } | ||
|
|
||
| signing { | ||
| def signingKey = findProperty("signingKey") | ||
| def signingPassword = findProperty("signingPassword") | ||
| if (signingKey && signingPassword) { | ||
| useInMemoryPgpKeys(signingKey, signingPassword) | ||
| sign publishing.publications.maven | ||
| } | ||
| } |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
69 changes: 69 additions & 0 deletions
69
entsoe/src/main/java/org/openremote/extension/entsoe/agent/protocol/EntsoeAgent.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,69 @@ | ||
| /* | ||
| * Copyright 2026, OpenRemote Inc. | ||
| * | ||
| * See the CONTRIBUTORS.txt file in the distribution for a | ||
| * full listing of individual contributors. | ||
| * | ||
| * This program is free software: you can redistribute it and/or modify | ||
| * it under the terms of the GNU Affero General Public License as | ||
| * published by the Free Software Foundation, either version 3 of the | ||
| * License, or (at your option) any later version. | ||
| * | ||
| * This program is distributed in the hope that it will be useful, | ||
| * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| * GNU Affero General Public License for more details. | ||
| * | ||
| * You should have received a copy of the GNU Affero General Public License | ||
| * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
| */ | ||
| package org.openremote.extension.entsoe.agent.protocol; | ||
|
|
||
| import jakarta.persistence.Entity; | ||
| import org.openremote.model.asset.agent.Agent; | ||
| import org.openremote.model.asset.agent.AgentDescriptor; | ||
| import org.openremote.model.value.AttributeDescriptor; | ||
| import org.openremote.model.value.ValueType; | ||
|
|
||
| import java.util.Optional; | ||
|
|
||
| @Entity | ||
| public class EntsoeAgent extends Agent<EntsoeAgent, EntsoeProtocol, EntsoeAgentLink> { | ||
|
|
||
| public static final AgentDescriptor<EntsoeAgent, EntsoeProtocol, EntsoeAgentLink> DESCRIPTOR = new AgentDescriptor<>( | ||
| EntsoeAgent.class, EntsoeProtocol.class, EntsoeAgentLink.class); | ||
|
|
||
| public static final AttributeDescriptor<String> SECURITY_TOKEN = new AttributeDescriptor<>("securityToken", ValueType.TEXT); | ||
|
|
||
| public static final AttributeDescriptor<String> BASE_URL = new AttributeDescriptor<>("baseURL", ValueType.TEXT).withOptional(true); | ||
|
|
||
| public EntsoeAgent() { | ||
| } | ||
|
|
||
| public EntsoeAgent(String name) { | ||
| super(name); | ||
| } | ||
|
|
||
| @Override | ||
| public EntsoeProtocol getProtocolInstance() { | ||
| return new EntsoeProtocol(this); | ||
| } | ||
|
|
||
| public Optional<String> getSecurityToken() { | ||
| return getAttributes().getValue(SECURITY_TOKEN); | ||
| } | ||
|
|
||
| public EntsoeAgent setSecurityToken(String value) { | ||
| getAttributes().getOrCreate(SECURITY_TOKEN).setValue(value); | ||
| return this; | ||
| } | ||
|
|
||
| public Optional<String> getBaseURL() { | ||
| return getAttributes().getValue(BASE_URL); | ||
| } | ||
|
|
||
| public EntsoeAgent setBaseURL(String value) { | ||
| getAttributes().getOrCreate(BASE_URL).setValue(value); | ||
| return this; | ||
| } | ||
| } | ||
49 changes: 49 additions & 0 deletions
49
entsoe/src/main/java/org/openremote/extension/entsoe/agent/protocol/EntsoeAgentLink.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,49 @@ | ||
| /* | ||
| * Copyright 2026, OpenRemote Inc. | ||
| * | ||
| * See the CONTRIBUTORS.txt file in the distribution for a | ||
| * full listing of individual contributors. | ||
| * | ||
| * This program is free software: you can redistribute it and/or modify | ||
| * it under the terms of the GNU Affero General Public License as | ||
| * published by the Free Software Foundation, either version 3 of the | ||
| * License, or (at your option) any later version. | ||
| * | ||
| * This program is distributed in the hope that it will be useful, | ||
| * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| * GNU Affero General Public License for more details. | ||
| * | ||
| * You should have received a copy of the GNU Affero General Public License | ||
| * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
| */ | ||
| package org.openremote.extension.entsoe.agent.protocol; | ||
|
|
||
| import com.fasterxml.jackson.annotation.JsonPropertyDescription; | ||
| import jakarta.validation.constraints.NotNull; | ||
| import jakarta.validation.constraints.Pattern; | ||
| import org.openremote.model.asset.agent.AgentLink; | ||
|
|
||
| public class EntsoeAgentLink extends AgentLink<EntsoeAgentLink> { | ||
|
|
||
| @NotNull | ||
| @JsonPropertyDescription("Energy Identification Code of zone to fetch data for") | ||
| @Pattern(regexp = "^\\d{2}[A-Z][A-Z0-9-]{12}[A-Z0-9]$") | ||
| private String zone; | ||
|
|
||
| // For Hydrators | ||
| public EntsoeAgentLink() { | ||
| } | ||
|
|
||
| public EntsoeAgentLink(String id) { | ||
| super(id); | ||
| } | ||
|
|
||
| public String getZone() { | ||
| return zone; | ||
| } | ||
|
|
||
| public void setZone(String zone) { | ||
| this.zone = zone; | ||
| } | ||
| } |
30 changes: 30 additions & 0 deletions
30
...rc/main/java/org/openremote/extension/entsoe/agent/protocol/EntsoeAgentModelProvider.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| /* | ||
| * Copyright 2026, OpenRemote Inc. | ||
| * | ||
| * See the CONTRIBUTORS.txt file in the distribution for a | ||
| * full listing of individual contributors. | ||
| * | ||
| * This program is free software: you can redistribute it and/or modify | ||
| * it under the terms of the GNU Affero General Public License as | ||
| * published by the Free Software Foundation, either version 3 of the | ||
| * License, or (at your option) any later version. | ||
| * | ||
| * This program is distributed in the hope that it will be useful, | ||
| * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| * GNU Affero General Public License for more details. | ||
| * | ||
| * You should have received a copy of the GNU Affero General Public License | ||
| * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
| */ | ||
| package org.openremote.extension.entsoe.agent.protocol; | ||
|
|
||
| import org.openremote.model.AssetModelProvider; | ||
|
|
||
| public class EntsoeAgentModelProvider implements AssetModelProvider { | ||
|
|
||
| @Override | ||
| public boolean useAutoScan() { | ||
| return true; | ||
| } | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.