The Nord Pool Integration api call exactly on the hour and stability issues
integration: nordpool
### The problem
There have been some stability issues with api calls executed on the hour towards the Nord Pool API endpoint in August. The situation seems to have stabilized.
Based on the code, there seems to be a couple of bugs/logical issues in the code that might be related:
- Calls towards the Nord Pool API happens exactly on the hour. There is a risk that this will (and did?) make the Nord Pool API endpint unstable. Worst case Home Assistant calls to the endpoint will be blocked (this hasn't happend yet)
- There is a request for next day prices every hour starting at midnight every day, even though next day prices aren't published until around 13CE(S)T
As prices are updated once every day, and (as far as I know) prices are never changed after they published - it should be ok to add randomness/jitter to when the API request happens and there should be no need to request next day prices until at earliest 13CEST.
### What version of Home Assistant Core has the issue?
core-2026.8.2
### What was the last working version of Home Assistant Core?
_No response_
### What type of installation are you running?
Home Assistant Container
### Integration causing the issue
nordpool
### Link to integration documentation on our website
https://www.home-assistant.io/integrations/nordpool/
### Diagnostics information
_No response_
### Example YAML snippet
```yaml
```
### Anything in the logs that might be useful for us?
```txt
```
### Additional information
The relevant code:
<pre>
def get_next_data_interval(self, now: datetime) -> datetime:
"""Compute next time an update should occur."""
if self.has_current_day_data and self.has_tomorrow_data:
_date = get_nordpool_current_time().date() + timedelta(days=1)
_time = time()
next_run = datetime.combine(_date, _time, NORDPOOL_TIMEZONE)
else:
next_data_run = get_nordpool_current_time() + timedelta(hours=1)
next_run = next_data_run.replace(minute=0, second=0, microsecond=0)
LOGGER.debug("Next data update at %s", next_run.astimezone(NORDPOOL_TIMEZONE))
return next_run.astimezone(dt_util.UTC)
</pre>
3 条评论