briis / hass-weatherflow

Home Assistant Integration for WeatherFlow Stations
MIT License
67 stars 11 forks source link

Unexpected error fetching weatherflow data: 'precip_icon' #2

Closed joseftsch closed 2 years ago

joseftsch commented 3 years ago

Successfully installed this integration via HACS custom repository into HA 2021.11.5 today. After enabling I received the following error in HA (in addition all items became unavailable)

Logger: custom_components.weatherflow
Source: custom_components/weatherflow/__init__.py:113
Integration: WeatherFlow Weather (documentation, issues)
First occurred: 20:06:34 (7 occurrences)
Last logged: 20:10:32

Unexpected error fetching weatherflow data: 'precip_icon'
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 187, in _async_refresh
    self.data = await self._async_update_data()
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 147, in _async_update_data
    return await self.update_method()
  File "/config/custom_components/weatherflow/__init__.py", line 113, in async_update_forecast
    data: ForecastDescription = await weatherflowapi.update_forecast()
  File "/usr/local/lib/python3.9/site-packages/pyweatherflowrest/api.py", line 297, in update_forecast
    precip_icon=item["precip_icon"],
KeyError: 'precip_icon'

I am happy to provide more information if needed

briis commented 3 years ago

Would you mind sharing your Station ID, then I can get the raw data and see what goes wrong.

joseftsch commented 3 years ago

Sure, it is 31976

briis commented 3 years ago

I can see there is some data missing on the first forecast entry. I don't know why, it is not the same for my station. But the datafield is not used by Home Assistant, so I will simply remove it. I will post an update tomorrow. (It is night here where I am)

joseftsch commented 3 years ago

Awesome! Thank you :) yeah, pretty late on my end as well :D

briis commented 2 years ago

I have released 0.1.8, which should fix this issue. Closing this issue, re-open if it is still not working.

joseftsch commented 2 years ago

Thanks! I'll give it a try today and let you know

joseftsch commented 2 years ago

Working perfectly! thank you :)

briis commented 2 years ago

Wonderful. Thanks for letting me know.