JaccoR / hass-entso-e

Integration for Home Assistant to fetch day ahead energy prices from European countries via ENTSO-e Transparency Platform
159 stars 25 forks source link

Feature Request: Handle no data error #40

Closed SVH-Powel closed 1 year ago

SVH-Powel commented 1 year ago

Entso-e didn't have prices for "Norway NO2" zone today 25.10.2022 and that makes this integration fail with an error

`Logger: custom_components.entsoe.coordinator Source: custom_components/entsoe/coordinator.py:121 Integration: ENTSO-e Transparency Platform (documentation, issues) First occurred: 07:08:24 (4 occurrences) Last logged: 07:09:31

Unexpected error fetching ENTSO-e coordinator data: Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 205, in _async_refresh self.data = await self._async_update_data() File "/config/custom_components/entsoe/coordinator.py", line 93, in _async_update_data data = await self.fetch_prices(today, tomorrow) File "/config/custom_components/entsoe/coordinator.py", line 109, in fetch_prices resp = await self.hass.async_add_executor_job( File "/usr/local/lib/python3.10/concurrent/futures/thread.py", line 58, in run result = self.fn(*self.args, **self.kwargs) File "/config/custom_components/entsoe/coordinator.py", line 121, in api_update return client.query_day_ahead_prices( File "/usr/local/lib/python3.10/site-packages/entsoe/decorators.py", line 106, in year_wrapper raise NoMatchingDataError entsoe.exceptions.NoMatchingDataError `

ThorAlex87 commented 1 year ago

I have the same issue in NO3.

2022-10-25 07:11:11.990 ERROR (MainThread) [custom_components.entsoe.coordinator] Unexpected error fetching ENTSO-e coordinator data: File "/config/custom_components/entsoe/coordinator.py", line 93, in _async_update_data File "/config/custom_components/entsoe/coordinator.py", line 109, in fetch_prices File "/config/custom_components/entsoe/coordinator.py", line 121, in api_update File "/usr/local/lib/python3.10/site-packages/entsoe/decorators.py", line 106, in year_wrapper entsoe.exceptions.NoMatchingDataError

jpulakka commented 1 year ago

Same thing in FI. It's the ENTSO-E API crapping out.

Maybe hass-entso-e could handle NoMatchingDataError in more controlled way, but it can't invent the missing prices..