finity69x2 / nws_alerts

An updated version of the nws_alerts custom integration for Home Assistant
84 stars 29 forks source link

Unavailable #48

Closed wormuths closed 1 year ago

wormuths commented 1 year ago

That's what I get. "Unavailable".

I've reloaded the integration, restarted Home Assistant, reconfigured the integration. Nothing works. The integration went offline at 9:00 AM yesterday and hasn't worked since.

Logger: homeassistant.components.sensor
Source: custom_components/nws_alerts/sensor.py:135
Integration: Sensor (documentation, issues)
First occurred: 11:38:52 AM (4 occurrences)
Last logged: 11:44:49 AM

Error adding entities for domain sensor with platform nws_alerts
Error while setting up nws_alerts platform for sensor
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 428, in async_add_entities
    await asyncio.gather(*tasks)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 692, in _async_add_entity
    await entity.add_to_platform_finish()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 789, in add_to_platform_finish
    self.async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 545, in async_write_ha_state
    self._async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 586, in _async_write_ha_state
    attr.update(self.extra_state_attributes or {})
  File "/config/custom_components/nws_alerts/sensor.py", line 135, in extra_state_attributes
    attrs["title"] = self.coordinator.data["event"]
KeyError: 'event'

And...

This error originated from a custom integration.

Logger: homeassistant
Source: custom_components/nws_alerts/sensor.py:135
Integration: NWS Alerts (documentation, issues)
First occurred: 11:39:52 AM (10 occurrences)
Last logged: 11:49:51 AM

Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 168, in _handle_refresh_interval
    await self._async_refresh(log_failures=True, scheduled=True)
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 316, in _async_refresh
    self.async_update_listeners()
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 121, in async_update_listeners
    update_callback()
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 381, in _handle_coordinator_update
    self.async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 545, in async_write_ha_state
    self._async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 586, in _async_write_ha_state
    attr.update(self.extra_state_attributes or {})
  File "/config/custom_components/nws_alerts/sensor.py", line 135, in extra_state_attributes
    attrs["title"] = self.coordinator.data["event"]
KeyError: 'event'
finity69x2 commented 1 year ago

As mentioned in the forum thread...

Are you on the latest HA version (2022.12.x)?

I ask because I'm not having any issues but I'm still on last months release.

wormuths commented 1 year ago

Yes I am... The issue began while I was on 2022.12. I updated to 2022.12.1 but that didn't fix it. It had been working. It just dropped offline without having updating anything. No issues before that.

wormuths commented 1 year ago

Codes are NYC111,NYZ063,NYZ064 and I set it to update every 2 minutes with a 120 second timeout.

wormuths commented 1 year ago

Versions

wormuths commented 1 year ago

I completely deleted the integration, re-added, and now it shows 2 alerts.

finity69x2 commented 1 year ago

I just installed it on a HA version 2022.12.1 with the same location codes and I'm also getting 2 alerts.

So I guess it's now working and this can be closed?

wormuths commented 1 year ago

I believe so... I'll let you know if it drops again for no reason... Right now it's working fine again. I see you posted a new update also. Thanks for all your work on this... This is one of those integrations that could very well save lives depending on the alert.

It's appreciated!