Ernst79 / degree-days

Integration that determines (weighted) degree days, gas consumption per degree day and a gas prognose for the current year based on weather info from the KNMI and your gas consumption.
MIT License
10 stars 5 forks source link

Retrying setup: No columns to parse from file #15

Closed srkoster closed 1 year ago

srkoster commented 1 year ago

Since a day or two this integration stopped working for me. I can't relate it to an upgrade of the component or Home Assistant.

In the devices -> integrations screen, I'm faced with the message Retrying setup: No columns to parse from file. In the Home Assistant log files I've this message


Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 239, in _async_refresh
    self.data = await self._async_update_data()
  File "/config/custom_components/degree_days/__init__.py", line 113, in _async_update_data
    data = 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/degree_days/knmi/__init__.py", line 18, in __init__
    data = self.get_degree_days()
  File "/config/custom_components/degree_days/knmi/__init__.py", line 37, in get_degree_days
    df = self.get_daily_data_df(self.startdate.replace(str(year), str(int(year) - 20), 1), enddate, [station_code],
  File "/config/custom_components/degree_days/knmi/__init__.py", line 126, in get_daily_data_df
    df = self.parse_result_to_df(r)
  File "/config/custom_components/degree_days/knmi/__init__.py", line 206, in parse_result_to_df
    df = pd.read_csv(StringIO(r))
  File "/usr/local/lib/python3.10/site-packages/pandas/util/_decorators.py", line 311, in wrapper
    return func(*args, **kwargs)
  File "/usr/local/lib/python3.10/site-packages/pandas/io/parsers/readers.py", line 680, in read_csv
    return _read(filepath_or_buffer, kwds)
  File "/usr/local/lib/python3.10/site-packages/pandas/io/parsers/readers.py", line 575, in _read
    parser = TextFileReader(filepath_or_buffer, **kwds)
  File "/usr/local/lib/python3.10/site-packages/pandas/io/parsers/readers.py", line 934, in __init__
    self._engine = self._make_engine(f, self.engine)
  File "/usr/local/lib/python3.10/site-packages/pandas/io/parsers/readers.py", line 1236, in _make_engine
    return mapping[engine](f, **self.options)
  File "/usr/local/lib/python3.10/site-packages/pandas/io/parsers/c_parser_wrapper.py", line 75, in __init__
    self._reader = parsers.TextReader(src, **kwds)
  File "pandas/_libs/parsers.pyx", line 551, in pandas._libs.parsers.TextReader.__cinit__
pandas.errors.EmptyDataError: No columns to parse from file```

**What I've tried already**
- Reloading the integration
- Setting a different weather station
- Deleting the integration and re-adding it
- Redownloading the integration through HACS and re-adding the integration in HA

**My assumption**
It looks like the integration fails to retrieve data from KNMI. Following the URL from the code to https://www.daggegevens.knmi.nl/klimatologie/daggegevens brings me to a `503 Service Temporarily Unavailable` page. The site seems to be down.

Can you confirm my assumption? And do you know if it's a temporary thing or that the KNMI has shut it down for good (in which case the code needs a refactoring to another KNMI API).
Skevdude commented 1 year ago

Same problem for me.

Ernst79 commented 1 year ago

Looks like the KNMI service is down.

I've checked the KNMI website, but they still refer to the same site. https://www.knmi.nl/kennis-en-datacentrum/achtergrond/data-ophalen-vanuit-een-script

I guess we need to ask the KNMI what is wrong.

Ernst79 commented 1 year ago

Looks like it is online again.