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

ENTSO-E: fix parsing of XML, resolution fallback, improve error handling #2839

Merged
merged 4 commits into from
Oct 25, 2024

Conversation

Sn0w3y
Copy link
Contributor

@Sn0w3y Sn0w3y commented Oct 13, 2024

Summary of Changes

This pull request introduces a fix to the TouEntsoeImpl class in the io.openems.edge.timeofusetariff.entsoe package. The changes are specifically aimed at resolving the issue where the ENTSO-E API is not returning any values for Belgium when using the PT60M resolution.

Key Improvements

  1. Fallback to PT15M Resolution:

    • Added logic to attempt a fallback to the PT15M resolution if the primary query for PT60M fails. This ensures that pricing data can still be retrieved when PT60M is unavailable.
    • Improved error handling and logging to provide clear visibility into the fallback process.
  2. Error Logging:

    • Enhanced logging to capture exceptions that occur during the retrieval of pricing data. This includes detailed logs for both PT60M and PT15M queries, allowing for easier debugging and tracking of issues.

Impact

These changes address the specific issue reported in #2830 by providing a robust mechanism to handle cases where the PT60M resolution is no longer available. This will improve the user experience for those configuring TimeOfUse Tariffs in Belgium and ensure that data can still be accessed.

Related Issues

  • Fixes #2830: Entso-e tariffs for Belgium not loaded - No data for resolution: PT60M.

## Summary of Changes
This pull request introduces a fix to the `TouEntsoeImpl` class in the `io.openems.edge.timeofusetariff.entsoe` package. The changes are specifically aimed at resolving the issue where the ENTSO-E API is not returning any values for Belgium when using the PT60M resolution.

### Key Improvements
1. **Fallback to PT15M Resolution**:
   - Added logic to attempt a fallback to the PT15M resolution if the primary query for PT60M fails. This ensures that pricing data can still be retrieved when PT60M is unavailable.
   - Improved error handling and logging to provide clear visibility into the fallback process.

2. **Error Logging**:
   - Enhanced logging to capture exceptions that occur during the retrieval of pricing data. This includes detailed logs for both PT60M and PT15M queries, allowing for easier debugging and tracking of issues.

## Impact
These changes address the specific issue reported in [OpenEMS#2830](OpenEMS#2830) by providing a robust mechanism to handle cases where the PT60M resolution is no longer available. This will improve the user experience for those configuring TimeOfUse Tariffs in Belgium and ensure that data can still be accessed.

## Related Issues
- Fixes [OpenEMS#2830](OpenEMS#2830): Entso-e tariffs for Belgium not loaded - No data for resolution: PT60M.
Copy link

codecov bot commented Oct 13, 2024

Codecov Report

Attention: Patch coverage is 75.80645% with 15 lines in your changes missing coverage. Please review.

Additional details and impacted files
@@              Coverage Diff              @@
##             develop    #2839      +/-   ##
=============================================
+ Coverage      56.55%   56.66%   +0.12%     
- Complexity      8888     8926      +38     
=============================================
  Files           2167     2167              
  Lines          91918    91959      +41     
  Branches        6834     6831       -3     
=============================================
+ Hits           51973    52101     +128     
+ Misses         38086    37982     -104     
- Partials        1859     1876      +17     

@sfeilmeier sfeilmeier requested a review from venu-sagar October 23, 2024 18:56
- automatically choose smallest resolution of available data
- handle exceptions internally
- handle missing values and multiple periods
- add additional tests for real XML
@sfeilmeier
Copy link
Contributor

@Sn0w3y: I hijacked your PR and backported some changes I have recently been applying for ENTSO-E for FEMS.

@sfeilmeier sfeilmeier changed the title Refactor TouEntsoeImpl for Belgium ENTSO-E: fix parsing of XML, resolution fallback, improve error handling Oct 25, 2024
@sfeilmeier sfeilmeier merged commit 7ef6c74 into OpenEMS:develop Oct 25, 2024
6 of 7 checks passed
@Sn0w3y
Copy link
Contributor Author

Sn0w3y commented Oct 25, 2024

@Sn0w3y: I hijacked your PR and backported some changes I have recently been applying for ENTSO-E for FEMS.

haha, no Problem ! :)

@Sn0w3y Sn0w3y deleted the fix-entso-e branch October 25, 2024 16:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Entso-e tariffs for Belgium not loaded - No data for resolution: PT60M
2 participants