mawinkler / astroweather

Asynchronous Astro Weather Forecast for Home Assistant
GNU General Public License v3.0
69 stars 9 forks source link

Temperature missing #22

Closed Repsionu closed 1 year ago

Repsionu commented 1 year ago

Installed via HACS, all entities OK except weather.astro... Log shows: `Logger: homeassistant.components.weather Source: components/weather/init.py:131 Integration: Weather (documentation, issues) First occurred: 19:36:30 (4 occurrences) Last logged: 19:36:51

Error adding entities for domain weather with platform astroweather
Error while setting up astroweather platform for weather

Traceback (most recent call last): File "/home/pi/homeassistant/lib/python3.8/site-packages/homeassistant/helpers/entity_platform.py", line 382, in async_add_entities await asyncio.gather(*tasks) File "/home/pi/homeassistant/lib/python3.8/site-packages/homeassistant/helpers/entity_platform.py", line 613, in _async_add_entity await entity.add_to_platform_finish() File "/home/pi/homeassistant/lib/python3.8/site-packages/homeassistant/helpers/entity.py", line 748, in add_to_platform_finish self.async_write_ha_state() File "/home/pi/homeassistant/lib/python3.8/site-packages/homeassistant/helpers/entity.py", line 505, in async_write_ha_state self._async_write_ha_state() File "/home/pi/homeassistant/lib/python3.8/site-packages/homeassistant/helpers/entity.py", line 540, in _async_write_ha_state attr.update(self.state_attributes or {}) File "/home/pi/homeassistant/lib/python3.8/site-packages/homeassistant/components/weather/init.py", line 209, in state_attributes if self.temperature is not None: File "/home/pi/homeassistant/lib/python3.8/site-packages/homeassistant/components/weather/init.py", line 131, in temperature return self._attr_temperature AttributeError: 'AstroWeatherWeather' object has no attribute '_attr_temperature'`

Maybe it is needed to wait 3 hrs and try to reload integration? Best, JR

mawinkler commented 1 year ago

I cannot replicate this. Which versions of Home Assistant and AstroWeather are you using?

Repsionu commented 1 year ago

Running HA is over a year old (2021.12.10) so Python is 3.8 :-( , astroweather is latest. Best, JR

mawinkler commented 1 year ago

Likely the problem is that AstroWeather is using the current sensor temperature conversions that changed in Core summer last year. Reference: https://developers.home-assistant.io/blog/2021/08/12/sensor_temperature_conversion/ I adapted AstroWeather with release v0.22.2 to comply with these changes.

So an update to a more recent version of Home Assistant would fix the problem, I assume.

Repsionu commented 1 year ago

Thanks a lot :-) upgrade path must be taken :-( Best, JR