briis / hass-weatherflow

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

Unexpected error fetching weatherflow data: list index out of range #14

Closed dhover closed 2 years ago

dhover commented 2 years ago

A small problem and hopefully easy to fix. The battery of my Tempest weatherstation has died. Now the integration doesn't initialize.

2021-12-13 19:59:48 ERROR (MainThread) [custom_components.weatherflow] Unexpected error fetching weatherflow data: list index out of range
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 105, in async_update_data
data: ObservationDescription = await weatherflowapi.update_observations()
File "/usr/local/lib/python3.9/site-packages/pyweatherflowrest/api.py", line 183, in update_observations
obervations: dict = data['obs'][0]
IndexError: list index out of range
briis commented 2 years ago

Is the device up and running again? What would you have liked to happen? I can make a more graceful exit, but without any data, I cannot continue setting it up.

briis commented 2 years ago

I have now made a more graceful handling of this, and instead of a crash log you will not get a warning in the log file and on the Integration page you will get this image. It will retry the connection with some Interval.

Could that work?

Skærmbillede 2021-12-14 kl  11 23 03

:

briis commented 2 years ago

I pushed out release 0.1.14. Should be available in HACS with the next hour. Closing this issue.

dhover commented 2 years ago

I have now made a more graceful handling of this, and instead of a crash log you will not get a warning in the log file and on the Integration page you will get this image. It will retry the connection with some Interval.

Could that work?

Skærmbillede 2021-12-14 kl 11 23 03

:

Yes that works fine. Thanks for that. Now I am waiting for the new Tempest station. It will be replaced!

One remark about the new integration: I compared the sensors from the old smartweather integration and the new one. I found one sensor is missing e.g. "Station information". Did you do that on purpose?

briis commented 2 years ago

Glad that this worked for you.

Now I am waiting for the new Tempest station. It will be replaced!

Hope you get it soon.

"Station information". Did you do that on purpose?

Yes. But just to see if anyone actually noticed 😁. I wanted to clean out sensors that nobody used, and I was not sure if this was used by anyone. Can I ask you to create a new issue, where you want this sensor back?

dhover commented 2 years ago

Yes. But just to see if anyone actually noticed 😁. I wanted to clean out sensors that nobody used, and I was not sure if this was used by anyone. Can I ask you to create a new issue, where you want this sensor back?

I don't need it. It was only a remark in case you hadn't noticed it.

briis commented 2 years ago

I think I will do it anyway. Thanks.