Bringing electricity information from eloverblik.dk and energidataservice.dk into Openhab

Yep, works for me too now.

I also got a reply from Energidataservice now, saying they created a ticket for me and they will process it as soon as possible :rofl:

1 Like

Looks like I have the issue with too many requests again:

2024-09-02 13:00:30.567 [WARN ] [nal.handler.EnergiDataServiceHandler] - Error
retrieving spot prices: The request failed with HTTP error 429
2024-09-02 14:00:30.725 [WARN ] [nal.handler.EnergiDataServiceHandler] - Error
retrieving spot prices: The request failed with HTTP error 429

Would like to ask how is the request managed? Can I trigger request from rules?
Many thanks in advance!

Can you try to enable trace logging so we can figure out what causes this in the first place?

You cannot manually trigger a request from rules, but if you disable and enable the Thing, a new request will be made. This can be done from rules also. However, it will be counter-productive trying to make more requests while being rejected with 429.

1 Like

Thanks I’m not disable enable things in rules - BTW how to do that with DSL I actually need to try this with another problematic binding (Unifi).
Which package should I enable trace log? Based on the log I can see it logs the error every hour, I assume if something else triggers http I should say more errors in log?

log:set TRACE org.openhab.binding.energidataservice

The interesting part is what is logged before you start getting the 429. So we will need to wait until you are allowed to call the service again, and then wait until the issue reoccurs to check what happened prior to that.

I’m getting very rusty in DSL after having migrated most of my rules to JavaScript, so unfortunately I don’t know how to do that, and if it’s even possible.

Ok, I will play with log4j and maybe redirect trace log to another file. Will report when I see this again, thanks a lot!

There is one way I could see something like this happen. Do you use any Thing actions from rules, and in that case, how often do you call them? Actions will use cached prices, but if prices are not available, they will directly try to download them. This could happen multiple times during a period of missing/delayed prices. So if such rules would have a misbehaving trigger logic, they could be causing a lot of calls in such a scenario.

Trace logs should pinpoint this, so let’s hope it will give some clarity about the cause.

Thanks I have now enabled trace log to a separate file so hopefully I can reproduce the issue.
To your question: I do use action to find cheapest period for consumption (heat water, charge car etc), but it is not very often. In face I checked my code I only call the actions when:

  1. scheduled time (4 times a day)
  2. when the car arrives home

Besides I use the below action every hour:

when  Time cron "30 0 * * * ? *"
then
    val actions = getActions("energidataservice", "energidataservice:service:energidataservice")
    var priceMap = actions.getPrices(null)
.......

The issue was resolved today when I restart OH, and immediately I received tomorrow’s prices after restart. I will report and provide the trace log file again when I see the 429 error again.

Good night!

1 Like

Hi @laursen and all:

Has anybody noticed the below errors? It started since yesterday and the price didn’t come around 13:00. Today is 2nd day with no price:

2025-02-07 13:00:19.396 [WARN ] [al.provider.ElectricityPriceProvider] - Spot prices are not available, retry scheduled (see details in Thing properties)

Is the energidataservice down?

It’s a good idea to check https://www.energidataservice.dk/ before asking here. :wink:

1 Like

Thanks sorry I should have searched

Doesn’t work for me either. Checked the site https://www.energidataservice.dk/news, it currently says:

We’re having trouble getting data from our supplier, which may cause temporary gaps in the Elspot Prices dataset. We’re working to fix it as soon as possible. Sorry for the inconvenience, and thanks for your patience!

It’s more stable now - I get price 1pm or latest 2pm past week.
@laursen : a feature request to add support for https://www.carnot.dk/ which can be used to predict future spot prices, not sure how accurate it is and I saw it when I tried HA this week.
Thanks and have a great weekend all!

This should not be implemented in the Energi Data Service binding, but rather as a separate integration.