ENTSO-E funktioniert nicht mehr

Hallo Forum,

Ich setze den Entso-E Controller jetzt schon seit zwei Wochen ein und bin begeistert - tolle Arbeit!

Leider bekomme ich seit zwei Tagen keine Daten mehr raus.
Die Abfrage der Entso-API scheint zu funktionieren - diese liefert ein 200-OK und auch Daten. Anschließend wird noch eine Anfrage an einen Währungsrechner geschickt. Diese liefert einen 101 Fehler zurück: “misssing_access_key”.
Wenn ich das recht verstehe, sollte die Abfrage nicht ausgeführt werden wenn die lokale Währung und die von der Entso-API gleich sind.

Gruß,
Klinki

Nach einem Neustart des Debuggers versucht das Modul so lange neue Werte abzufragen bis es Erfolg hat. Es springt dabei immer wieder in die Web-Abfrage zur Währungsumrechnung.

Möglicherweise gibt es ein Abfrage-Limit seitens api.exchangerate.host.

Ich habe den Code mal versuchsweise in

TouEntsoeImpl.java

angepasst:

			final String entsoeCurrency = Utils.parseCurrency(result); 
			final var globalCurrency = this.meta.getCurrency();
			final String globalCurrencyName = globalCurrency.name().toString();
			
			var exchangeRate = 1.0;
			
			if (!globalCurrencyName.equals(entsoeCurrency)) {
				exchangeRate = Utils.exchangeRateParser(ExchangeRateApi.getExchangeRates(), globalCurrency);
			}

Hi @klinki,

I am glad you are using ENTSO-E and Thank you for posting the issue here.

Leider bekomme ich seit zwei Tagen keine Daten mehr raus.
Die Abfrage der Entso-API scheint zu funktionieren - diese liefert ein 200-OK und auch Daten. Anschließend wird noch eine Anfrage an einen Währungsrechner geschickt. Diese liefert einen 101 Fehler zurück: “misssing_access_key”

The issue stems from a recent alteration in the api.exchangerate.host implementation. They’ve introduced a new access key requirement for accessing exchange rates, which was not previously in place. This change is the reason you encountered an error just two days ago. I’ll need to modify the implementation to align with this new requirement, and I’ll provide updates as soon as I begin working on it. If you’re eager to make the implementation adjustment yourself, you can request a free API key from api.exchangerate.host and update the URL from “https://api.exchangerate.host/latest?base=EUR” to “https://api.exchangerate.host/list?access_key=YOUR_ACCESS_KEY.

Wenn ich das recht verstehe, sollte die Abfrage nicht ausgeführt werden wenn die lokale Währung und die von der Entso-API gleich sind.

The implementation has been designed to optimize efficiency by avoiding the need to fetch exchange rates when the edge device currency (globalCurrency) matches the ENTSO-E currency (entsoeCurrency). This rule specifically applies to EUR, as ENTSO-E provides prices in EUR, making currency conversion unnecessary in these cases.

Regards,
Sagar

Hi Sagar,

Yes, I´ve seen this access key thing on their website and made my little workaround for it as I only need Euro<->Euro.
In my opinion it is a bit ‘unlucky’ not to get the rates and not knowing why.

But as mentioned before in german this is a really great module and I´m very happy with it.

My power supplier promised me a smart meter (hopefully) within the next months. So looking at actual market prices is very handy to get an idea of variable tariffs right now.

If I can help you with anything - just say a word :saluting_face:

Kind regards
Klinki

Hi Sagar

For me, this workaround doesn’t work. I get a timeout.

Greetings

Hi @yvesilknievil,

I made a PR fixing this issue.

You can try this and let me know if you still face any issues. Please remember you need to enter your personal access key from the exchangeratehost API.

Regards,
Sagar

Hi Sagar,

Thanks for the quick return.

I am not receiving any specific Entso-e errors; but i cannot see the prices neither.
Perhaps, since being new at OpenEMS, I am missing something, but when using the TimeOfUse Controller:

t 20 23:54:04 ubuntu java[70798]: java.lang.NullPointerException: Cannot invoke "com.google.common.collect.ImmutableSortedMap.isEmpty()" because "priceMap" is null
Oct 20 23:54:04 ubuntu java[70798]:         at io.openems.edge.timeofusetariff.api.utils.TimeOfUseTariffUtils.getNext24HourPrices(TimeOfUseTariffUtils.java:27)
Oct 20 23:54:04 ubuntu java[70798]:         at io.openems.edge.timeofusetariff.entsoe.TouEntsoeImpl.getPrices(TouEntsoeImpl.java:170)
Oct 20 23:54:04 ubuntu java[70798]:         at io.openems.edge.controller.ess.timeofusetariff.TimeOfUseTariffControllerImpl.modeAutomatic(TimeOfUseTariffControllerImpl.java:183)
Oct 20 23:54:04 ubuntu java[70798]:         at io.openems.edge.controller.ess.timeofusetariff.TimeOfUseTariffControllerImpl.run(TimeOfUseTariffControllerImpl.java:152)
Oct 20 23:54:04 ubuntu java[70798]:         at io.openems.edge.core.cycle.CycleWorker.forever(CycleWorker.java:114)
Oct 20 23:54:04 ubuntu java[70798]:         at io.openems.common.worker.AbstractWorker$1.run(AbstractWorker.java:154)

I guess the prices aren’t updated (yet). are the prices fetched immediately or only at 2pm?

Had some issues in my code.

Your fix works on my end! Thanks a lot!