Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Weathermap Precipitation raises PIL.UnidentifiedImageError #181

Open
ChristianForstner opened this issue Feb 11, 2025 · 4 comments
Open

Comments

@ChristianForstner
Copy link

Hi @FL550 ,

first of all, thank you for this great integration. It has worked flawlessly ever since I started using it and I really like the weathermap precipitations. Since a few weeks however, the weathermaps stopped working. As it seems (#160 (comment)) I'm not the only one affected by this. Since this issue, is not really related to #160, I thought of opening a new one. What is strange is that in the last two or three days, one of my weathermaps worked again fine but starting today it stopped working again.

Version of home_assistant

2025.2.2

How are you running home_assistant

HAOS on HA Yellow

Version of the custom_component

2.1.27

Describe the bug

All entries of Weathermap Precipitation raise PIL.UnidentifiedImageError

Log

Logger: custom_components.dwd_weather
Quelle: helpers/update_coordinator.py:380
Integration: Deutscher Wetterdienst (Dokumentation, Probleme)
Erstmals aufgetreten: 12:29:57 (22 Vorkommnisse)
Zuletzt protokolliert: 12:44:02

Unexpected error fetching DWD Map Coordinator data
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 380, in _async_refresh
    self.data = await self._async_update_data()
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 281, in _async_update_data
    return await self.update_method()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/dwd_weather/connector.py", line 871, in async_update
    return await self._hass.async_add_executor_job(self._update)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/concurrent/futures/thread.py", line 59, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/config/custom_components/dwd_weather/connector.py", line 878, in _update
    self._update_loop()
    ~~~~~~~~~~~~~~~~~^^
  File "/config/custom_components/dwd_weather/connector.py", line 969, in _update_loop
    maploop = dwdmap.ImageLoop(
        self._configdata[CONF_MAP_WINDOW]["longitude"] - radius,  # type: ignore
    ...<13 lines>...
        dark_mode=self._configdata[CONF_MAP_DARK_MODE],
    )
  File "/usr/local/lib/python3.13/site-packages/simple_dwd_weatherforecast/dwdmap.py", line 225, in __init__
    self._full_reload()
    ~~~~~~~~~~~~~~~~~^^
  File "/usr/local/lib/python3.13/site-packages/simple_dwd_weatherforecast/dwdmap.py", line 240, in _full_reload
    self._images.append(self._get_image(self._last_update))
                        ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/simple_dwd_weatherforecast/dwdmap.py", line 270, in _get_image
    image = Image.open(BytesIO(request.content))
  File "/usr/local/lib/python3.13/site-packages/PIL/Image.py", line 3532, in open
    raise UnidentifiedImageError(msg)
PIL.UnidentifiedImageError: cannot identify image file <_io.BytesIO object at 0x7f6bcff100>
@FL550
Copy link
Owner

FL550 commented Feb 11, 2025

@ChristianForstner Thanks for reporting! It looks like some kind of network issue on DWD side. I'll have a look

@f4b0
Copy link

f4b0 commented Feb 12, 2025

Hi,
jurst for information, i have the same problem for about 2 weeks...

i tried different versions of Home Assistant (in Docker and HAOS) and DWD without success...

Thanks for your work!

@user-08-151
Copy link

Try reducing the age/amount of images shown to 5 mins until the root cause is fixed (FL550/simple_dwd_weatherforecast#25):

Image

@f4b0
Copy link

f4b0 commented Feb 12, 2025

Hi, the image is back but it's static.

Thanks so far!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants