Closed BaltasarParreira closed 1 year ago
Same, seeing lots of these in the logs:
Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 182, in _handle_refresh_interval
await self._async_refresh(log_failures=True, scheduled=True)
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 330, in _async_refresh
self.async_update_listeners()
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 135, in async_update_listeners
update_callback()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 559, in async_write_ha_state
self._async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 600, in _async_write_ha_state
state = self._stringify_state(available)
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 565, in _stringify_state
if (state := self.state) is None:
File "/usr/src/homeassistant/homeassistant/components/sensor/__init__.py", line 470, in state
value = self.native_value
File "/config/custom_components/astroweather/sensor.py", line 387, in native_value
return getattr(self.coordinator.data[SENSOR_NAME], self._sensor, None)
File "/usr/local/lib/python3.10/site-packages/pyastroweatherio/dataclasses.py", line 106, in wind10m_speed
return float(WIND10M_SPEED[self._wind10m.get("speed", 0)])
IndexError: list index out of range
Update: Right now almost all the 43 entities from astroweather are down giving the same error:
and many more.
So I lost the most important to me that I was using, the moon phase. : (
It looks like 7timer is returning odd values for the 10m_wind_speed and that is causing the issue with the integration, see below:
"wind10m" : { "direction" : "-9999", "speed" : -9999 }
Same issue, card stopped working with an error when attempting to read wind speed
Error while setting up astroweather platform for weather
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 442, in async_add_entities
await asyncio.gather(*tasks)
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 717, in _async_add_entity
await entity.add_to_platform_finish()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 807, in add_to_platform_finish
self.async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 559, in async_write_ha_state
self._async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 602, in _async_write_ha_state
attr.update(self.state_attributes or {})
File "/usr/src/homeassistant/homeassistant/components/weather/__init__.py", line 673, in state_attributes
if (wind_speed := self.native_wind_speed) is not None:
File "/config/custom_components/astroweather/weather.py", line 268, in native_wind_speed
return self._current.wind10m_speed
File "/usr/local/lib/python3.10/site-packages/pyastroweatherio/dataclasses.py", line 106, in wind10m_speed
return float(WIND10M_SPEED[self._wind10m.get("speed", 0)])
IndexError: list index out of range```
You're right, the problem is caused by the odd values for the wind. The fix needs to be in pyastroweatherio and astroweather will need a dependency update. Working on it.
I did a quick fix, but there is no new release yet since I want to double-check for any other possibilities astroweather failing if the 7timer API delivers odd values.
If you can, please change the requirements key in the custom_components/astroweather/manifest.json
to "pyastroweatherio==0.22.5"
and restart Home Assistant.
It would be cool if you report back success or failure.
"Quick fix" worked for me, thank you.
Yep, that worked!
Correct, that code change fixed everything for me as well. Great, thanks !!!
Yes, works!!
Recently in one or two days I started getting this error for the following entities:
sensor.astroweather_10m_wind_speed sensor.astroweather_10m_wind_speed_plain weather.astroweather_38_731_9_1373
Because of this my custom:astroweather-card stopeed working and it only show this:
this is the code I'm using on the card itself: