MatthewFlamm / nwsradar

Home assistant custom camera platform for NWS radar loops
MIT License
20 stars 2 forks source link

Unavailable Entity #12

Closed Z3r0XG closed 4 years ago

Z3r0XG commented 4 years ago

Hi, I've added this integration but I am getting an "unavailable" for the entity.

Z3r0XG commented 4 years ago

Ok, it just started working. Looks like I had to wait a while.

MatthewFlamm commented 4 years ago

How long did this take? Did you have any errors or warnings in your logs? It is possible that it was due to a temporary network outage.

Z3r0XG commented 4 years ago

I'm not sure - I came back to it the next day and it was there all of a sudden. I had a similar issue with another installation. It looks like after HACS or the normal store say something is "installed" it takes a bit more before it's actually done. I wish there was a better way to know when it's fully done - there might be I just started playing with HA.

FoxxMD commented 3 years ago

After adding the integration this is what i saw in the logs. I had the same behavior where some time later the entity started working.

2020-11-06 18:01:38 ERROR (MainThread) [custom_components.nwsradar] Timeout fetching FFC Enhanced Composite Reflectivity Loop data
... // skipped log events
2020-11-06 18:31:48 ERROR (MainThread) [custom_components.nwsradar] Unexpected error fetching FFC Enhanced Composite Reflectivity Loop data: cannot identify image file <_io.BytesIO object at 0x14763d9a78b0>
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 144, in async_refresh
self.data = await self._async_update_data()
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 132, in _async_update_data
return await self.update_method()
File "/config/custom_components/nwsradar/__init__.py", line 67, in async_update_cam
return await hass.async_add_executor_job(cam.update)
File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/usr/local/lib/python3.8/site-packages/nws_radar/nws_radar.py", line 64, in update
self._images_radar = self._update_mult_images(self.url_radar,
File "/usr/local/lib/python3.8/site-packages/nws_radar/nws_radar.py", line 108, in _update_mult_images
imag = self.retrieve_image(f)
File "/usr/local/lib/python3.8/site-packages/nws_radar/nws_radar.py", line 76, in retrieve_image
return Image.open(res.raw)
File "/usr/local/lib/python3.8/site-packages/PIL/Image.py", line 2930, in open
raise UnidentifiedImageError(
PIL.UnidentifiedImageError: cannot identify image file <_io.BytesIO object at 0x14763d9a78b0>
MatthewFlamm commented 3 years ago

@FoxxMD this is likely caused by some connection error or server error, but it should be handled better in the underlying library. Can you open an issue in https://github.com/MatthewFlamm/nws_radar ?