Code Monkey home page Code Monkey logo

nws_alerts's People

Contributors

303bryan avatar conorsham avatar eracknaphobia avatar finity69x2 avatar firstof9 avatar kreene1987 avatar mdecourcy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

nws_alerts's Issues

Alerts ignored for late alpha states when /alerts/count truncates response

2022-07-24 Have been trying to debug an issue where no alerts show up in my part of Texas even though a straight zone call shows them. While debugging, I saw a truncation message in the /alerts/count response. After digging further into the code I realized that the TX zone and county alerts were being cut off. When I went back to try and capture the truncated output for repro instructions the /alert/count call was suddenly allowing 323 alerts in the response. Would it be possible to skip the /alerts/count call and go straight to the /alerts?zone= call to avoid any future truncation issues?

Enhancement Idea: Add alert type filtering

In my area (and likely many others) there are 'alerts' that the NWS publishes that aren't really severe weather alerts. For example right now there are 3 "Hydrologic Outlooks" that have been active for the last few days... They aren't indicating any urgent severe weather, but probability based river flooding forecasts for the spring. It would be nice if this integration could give the option to filter out certain alert types or "events" that the user doesn't care about for display/automatons... It could be a user entered list so each user could ignore different types if they wish.

Recent nws_alerts_custom_package.yaml update removes sensor

I noticed the other day that my alerts were not working so I checked to see if there were any updates around and I saw that your nws_alerts_custom_package.yaml was updated. However, in the file you removed the nws_alerts integration and replaced it with the weatheralerts integration. By doing this, sensor.nws_alerts is removed and sensor. is added.

Just curious if the nws_alerts integration is broken? If that is the case shouldn't there be some indication that sensor.nws_alerts has been replaced and the code updated to the new data being recieved? I am guessing the weatheralerts sensor could just be renamed to sensor.nws_alerts but looking at the data sent by both integrations there are some discrepancies such as "title" being sent as "event_id" in nws_alerts and in weatheralerts the data appears to be 1:1.

Missing Custom Package?

Hello, thank you for creating this NWS alert system. I am a complete noobie (don't you love us, lol) and was going to utilize/investigate your NWS Custom Package to see if I could get the alerts to do popups/notifications/etc. But the link seems to be broken in your instructions.

"The sensor that is created is used in my "NWS Alerts Custom" package - https://github.com/finity69x2/NWS-Alerts-Custom-Package"

Wondering if you still have this working and available. Thanks again.

Feature Request: Easier way to access new alerts / severe alerts

Looking through the code I saw that you had some template sensors to alert for severe weather or multiple alerts. I was wondering if there was a way to do two things:

  1. A separate NWS sensor that is on when there is a severe weather alert (severe weather, hurricane, tornado, wild fire)
  2. A easier way to push only new alert(s) to TTS, Telegram, notify service.

Right now it would take quite a bit of work for me to figure out how to get a severe weather alert and a TTS message only when there is a new alert. I'm sure eventually I can look at your template sensors and get something working in nodered. However, an integrated solution would be very appreciated.

Thanks!

Task exception was never retrieved error since update to version 2.6

I have two active alerts right now, getting lots of these errors in my HA log:

This error originated from a custom integration.

Logger: homeassistant
Source: custom_components/nws_alerts/sensor.py:135
Integration: nws_alerts (documentation, issues)
First occurred: 5:52:44 PM (27 occurrences)
Last logged: 8:53:48 PM

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'

I was not getting these errors prior to updating the NWS integration in HACS. I see you listed a possible breaking change, but I don't know if I need to do something on my end, or if this is an issue in the integration.

Unable to connect after HA update to 2022.5.0

Since I have updated to home assistant 2022.5.0, I get the following error in from the HA logs. I am on HA Blue with HA OS. I forgot to add. The integration version reports version 2.4.2.

This error originated from a custom integration.

Logger: custom_components.nws_alerts
Source: helpers/update_coordinator.py:223
Integration: NWS Alerts (documentation, issues)
First occurred: 5:47:52 AM (1 occurrences)
Last logged: 5:47:52 AM

Error fetching NWS Alerts data: Cannot connect to host api.weather.gov:443 ssl:default [Network unreachable]

Additional Attributes?

Hey, this works pretty well! THANK YOU! Is there any chance more of the attributes can be added from the feed? severity, certainty, and instruction are a few of them I'd be interested in.

API Errors Cause Integration State To Bounce Frequently

Errors returned from the NWS API cause the integration state to become "unavailable" until the next successful data fetch. At a poll frequency of one minute, this intermittent behavior can happen frequently.

State Unavailable

The logged error is:

NWS Error

The data returned from the NWS API is something like:

An error occurred while processing your request.
Reference #102.ef3b2f17.1698861160.43265ae2

If this happens when no alerts are active it is hardly noticed. However, if an alert is active, any templates looking for a state (count) of ">0" will no longer evaluate to True. In my case, this sets my alert entity back to idle, causing automations to declare the alert "expired", only to declare a "new" alert a minute later when the API again responds with good data. When notifications are issued each time this happens, especially in the middle of the night, it can be extremely annoying.

I will propose a potential solution for this by way of a PR. If anyone has a workaround for this problem I would love to hear it.

Request to expand spoken attributes for sensor

Thanks for the NWS Alert integration, its a great addition.

If I could make a suggestion, it would be expanding the attributes of the nws sensor.
When using with TTS, the current spoken_desc (from nws headline field) provides very limited information about the alert. More information about the alert is included in the display_desc, but it is complicated to parse the info to only include nws description for TTS to read. (display_desc combines multiple fields from alert)

Would it be possible to add an extended_spoken_desc using only the NWS description, without the added nws fields that the display_desc contains?

I wish I was able to contribute and make it happen, unfortunately its not in my ability.
Many thanks-

i.e. https://api.weather.gov/alerts/urn:oid:2.49.0.1.840.0.7e5dd3ad6b9cc589d0bf16ed0c774aa633a5a081.001.1

Documentation information

Your example uses custom cards but there are no links to them. Please put links to them in your documentation.

type: custom:vertical-layout
type: custom:stack-in-card
type: custom:entity-attributes-card

Thanks

Enhancement: Alert targeting using FIPS zone alone results in false alarm potential

Problem: Using the NWS FIPS code results in monitoring relatively large geographic areas in some parts of the country. This results in the possibility of false triggers when the hazardous weather is not a threat to your location.

Here's a crude example of the issue I commonly encounter:
image
Yellow Star = Home Location (example only)
Purple Box = FIPS Zone
Blue Cloud = Storm System / Example Polygon
Blue Arrow = Direction of storm travel (the assumption that future alerts would be issued along this path)

Potential Solutions: The NWS includes alert area polygon data in issued alerts. The NWS API also allows for point-based queries for severe threats. However, as others have pointed out in the Home Assistant Community, there are drawbacks to using this data/implementing a solution.

Reference:
NWS Watch, Warning, and Advisory Geolocation

Add display (lovelace config) info to the readme.

Thank you for this integration. Initially didn't see anything in this repo for how to use this integration.

zone_id configuration being ignored

I have changed the zone_id from the default local zone TXZ158 to TXC163 and verified that the change is visible in const,py. But when I turn the logging level down I see that the process is calling out with TXZ158.

2022-08-28_19-24-30
2022-08-28_19-26-00
2022-08-28_19-25-22

Change to Arrays

I recently cloned this and modified it to use Arrays.
I added and slightly changed some of the attribute fields including headline, expiration, and instruction
I also updated the persistent and push notifications to be cleared once they expire.

If there's interest from @finity69x2, I can put it into a PR. Obviously it would be a large change and likely break all existing automations, scripts, etc.

I did not update the lovelace tab but could if needed.

If not, no worries at all, just figured I'd put it out there.

Errors with variables and attribute split

I seem to be having an issue running the nws_alerts_custom_package_full.yaml. I'm getting the errors below. I've tried it with both the HACS add on and plugging in my zone_id manually.

2022-07-11 16:40:35 ERROR (MainThread) [homeassistant.helpers.template] Template variable error: 'int object' has no attribute 'split' when rendering '{{ (trigger.to_state.attributes.event_id).split('-')[0] }}' 2022-07-11 16:40:35 ERROR (MainThread) [homeassistant.components.automation.nws_update_event_id_variable] NWS Update Event ID Variable: Error executing script. Error for call_service at pos 2: Error rendering data template: UndefinedError: 'int object' has no attribute 'split' 2022-07-11 16:40:35 ERROR (MainThread) [homeassistant.components.automation.nws_update_event_id_variable] Error while executing automation automation.nws_update_event_id_variable: Error rendering data template: UndefinedError: 'int object' has no attribute 'split' 2022-07-11 16:40:38 ERROR (MainThread) [homeassistant.helpers.template] Template variable error: 'int object' has no attribute 'split' when rendering '{{ (state_attr('sensor.nws_alerts', 'event_id').split('-')[0] not in states.variable.nws_alerts_event_ids.attributes.values()|list) and (state_attr('sensor.nws_alerts', 'event_id').split('-')[0] != states('variable.nws_alerts_event_ids')) }}' 2022-07-11 16:40:38 WARNING (MainThread) [homeassistant.components.automation] Error evaluating condition in 'NWS Weather Alert Pop Up Control': In 'condition' (item 3 of 3): In 'template' condition: UndefinedError: 'int object' has no attribute 'split' 2022-07-11 16:40:38 ERROR (MainThread) [homeassistant.helpers.template] Template variable error: 'int object' has no attribute 'split' when rendering '{{ (state_attr('sensor.nws_alerts', 'event_id').split('-')[0] not in states.variable.nws_alerts_event_ids.attributes.values()|list) and (state_attr('sensor.nws_alerts', 'event_id').split('-')[0] != states('variable.nws_alerts_event_ids')) }}' 2022-07-11 16:40:38 WARNING (MainThread) [homeassistant.components.automation] Error evaluating condition in 'NWS Notification Weather Alert': In 'condition' (item 3 of 3): In 'template' condition: UndefinedError: 'int object' has no attribute 'split' 2022-07-11 16:40:38 ERROR (MainThread) [homeassistant.helpers.template] Template variable error: 'int object' has no attribute 'split' when rendering '{{ (state_attr('sensor.nws_alerts', 'event_id').split('-')[0] not in states.variable.nws_alerts_event_ids.attributes.values()|list) }}' 2022-07-11 16:40:38 ERROR (MainThread) [homeassistant.helpers.template] Template variable error: 'int object' has no attribute 'split' when rendering '{{ (state_attr('sensor.nws_alerts', 'event_id').split('-')[0] != states('variable.nws_alerts_event_ids')) }}' 2022-07-11 16:40:38 WARNING (MainThread) [homeassistant.components.automation] Error evaluating condition in 'NWS Announce Weather Alert': In 'condition': In 'and' (item 4 of 5): In 'template' condition: UndefinedError: 'int object' has no attribute 'split' In 'and' (item 5 of 5): In 'template' condition: UndefinedError: 'int object' has no attribute 'split' 2022-07-11 16:40:38 ERROR (MainThread) [homeassistant.helpers.template] Template variable error: 'int object' has no attribute 'split' when rendering '{{ (state_attr('sensor.nws_alerts', 'event_id').split('-')[0] not in states.variable.nws_alerts_event_ids.attributes.values()|list) }}' 2022-07-11 16:40:38 ERROR (MainThread) [homeassistant.helpers.template] Template variable error: 'int object' has no attribute 'split' when rendering '{{ (state_attr('sensor.nws_alerts', 'event_id').split('-')[0] != states('variable.nws_alerts_event_ids')) }}' 2022-07-11 16:40:38 WARNING (MainThread) [homeassistant.components.automation] Error evaluating condition in 'NWS Announce Weather Alert for MBR': In 'condition': In 'and' (item 4 of 6): In 'template' condition: TypeError: argument of type 'NoneType' is not iterable In 'and' (item 5 of 6): In 'template' condition: UndefinedError: 'int object' has no attribute 'split' In 'and' (item 6 of 6): In 'template' condition: UndefinedError: 'int object' has no attribute 'split' 2022-07-11 16:40:38 ERROR (MainThread) [homeassistant.helpers.template] Template variable error: 'int object' has no attribute 'split' when rendering '{{ (trigger.to_state.attributes.event_id).split('-')[0] }}' 2022-07-11 16:40:38 ERROR (MainThread) [homeassistant.components.automation.nws_update_event_id_variable] NWS Update Event ID Variable: Error executing script. Error for call_service at pos 2: Error rendering data template: UndefinedError: 'int object' has no attribute 'split' 2022-07-11 16:40:38 ERROR (MainThread) [homeassistant.components.automation.nws_update_event_id_variable] Error while executing automation automation.nws_update_event_id_variable: Error rendering data template: UndefinedError: 'int object' has no attribute 'split'

Detected I/O inside the event loop

I just wanted to share this issue from the HA logs.
If this can be ignored, feel free to close this issue.

Thanks,
DeadEnd

Log Details (WARNING)
Logger: homeassistant.util.async_
Source: util/async_.py:120
First occurred: 9:08:45 AM (1 occurrences)
Last logged: 9:08:45 AM

Detected I/O inside the event loop. This is causing stability issues. Please report issue to the custom component author for nws_alerts doing I/O at custom_components/nws_alerts/sensor.py, line 126: r = requests.get(url, headers=headers)

Multiple alerts concatenated into long strings

In my region we frequently get overlapping alerts with the same data, but this occurs even with multiple distinct alerts. I've checked upstream and they are being issued as separate items.

For example, due to the wildfires there are several overlapping air quality emergencies as well as special weather statements with the same information. Instead of receiving an array with each alert as an 'object', it is only returning single long strings:

title: Air Quality Alert - Air Quality Alert - Special Weather Statement - Air Quality Alert - Air Quality Alert - Special Weather Statement - Air Quality Alert - Air Quality Alert
message_type: Alert - Alert - Alert - Alert - Alert - Alert - Alert - Alert - Alert
event_status: Actual - Actual - Actual - Actual - Actual - Actual - Actual - Actual - Actual

I would expect arrays of attributes, similar to other multi-value integrations (especially weather). I haven't come across any other cases where I need to deserialize data from a sensor.

Feature Request: Expose "severity" an an attribute

Currently there is a severity in the display_desc text. It would be useful to have severity broken out as an attribute, similar to message_type and event_status.

This would be to enable automations to behave differently for Minor vs. Critical or Extreme severity.

In the alert response, severity shows up as one of the properties, see below.

There may be other fields that would be useful in determining how to handle and/or present alerts like certainty, urgency, and response, but I don't know enough yet/have enough experience.

Is there any current significance to the order of alerts?

Right now, the my first alert is Minor severity while the next two are Extreme.

If Severity was exposed as an attribute, I'd be expecting to see Minor - Extreme - Extreme that could be split the same way title, message_type, and event_status.

    "properties": {
        "@id": "https://api.weather.gov/alerts/urn:oid:2.49.0.1.840.0.3196c222a05cacdfbc32bebf8f2fdd3eb24e93c2.001.2",
        "@type": "wx:Alert",
        "id": "urn:oid:2.49.0.1.840.0.3196c222a05cacdfbc32bebf8f2fdd3eb24e93c2.001.2",
        "areaDesc": "Northern New London; Southern New London; Northeast Suffolk; Southeast Suffolk",
        "geocode": { ... },  
        "affectedZones": [
            "https://api.weather.gov/zones/forecast/CTZ008",
            "https://api.weather.gov/zones/forecast/CTZ012",
            "https://api.weather.gov/zones/forecast/NYZ079",
            "https://api.weather.gov/zones/forecast/NYZ081"
        ],
        "references": [],
        "sent": "2022-01-28T09:59:00-05:00",
        "effective": "2022-01-28T09:59:00-05:00",
        "onset": "2022-01-28T19:00:00-05:00",
        "expires": "2022-01-28T17:00:00-05:00",
        "ends": "2022-01-29T19:00:00-05:00",
        "status": "Actual",
        "messageType": "Alert",
        "category": "Met",
        "severity": "Extreme",
        "certainty": "Likely",
        "urgency": "Expected",
        "event": "Blizzard Warning",
        "sender": "[email protected]",
        "senderName": "NWS Upton NY",
        "headline": "Blizzard Warning issued January 28 at 9:59AM EST until January 29 at 7:00PM EST by NWS Upton NY",

Updated alerts not removed

Issue: Updated alerts are no removed. I have three active while weather.gov is only showing two (as is dark sky)

Reproduction: When an alert is updated it should show as a new alert. I did a diff on both alerts and found a few minor changes.

Expected Result: When an alert is updated, the number of alerts should remain the same. The entity is updated which can be used to trigger automatons for weather alert updates (instead of new weather alerts).

Side note: Thanks for the integration. I needed something with alerts to replace DarkSky for when the API is no longer free.

spoken_desc attribute ... double entry... bug?

I am not sure if this is expected behavior or if there is an issue, but,..... I have two events, and both events have a spoken_desc attribute. Instead of spliting the attribute for each event, it's listing the same attribute for both, showing both. If you need it, I have both the output generated by the sensor state and the raw nws api output. Example below.

Code:
{{ state_attr('sensor.wx_alerts', 'spoken_desc')}}

Result:

HEAT ADVISORY NOW IN EFFECT UNTIL 1 PM CDT SUNDAY... ...EXCESSIVE HEAT WARNING IN EFFECT FROM 1 PM TO 8 PM CDT SUNDAY

-

HEAT ADVISORY NOW IN EFFECT UNTIL 1 PM CDT SUNDAY... ...EXCESSIVE HEAT WARNING IN EFFECT FROM 1 PM TO 8 PM CDT SUNDAY

Multiple alerts only speak / show first received alert.

I have been noticing that when there are alerts, the only alert that gets "processed" by automations is the first received.

For example:

{{states.sensor.nws_alert_count.state}}
{{states.sensor.nws_alert_event.state}}

Outputs

2
Special Weather Statement

In this case, there is a Special Weather Statement AND a Tornado Watch, but the watch doesn't appear visible - from what I can see.

Is there a way to process all alerts via the automations, spoken and notified.

NWS creating multiple sensors, which then become unavailable. Especially happening on restarts

Using NWS Alerts 2.1 on a HA OS install which is running in a VirtualBox hosted on a Win10 Pro dedicated PC.

System Health

version core-2021.8.8
installation_type Home Assistant OS
dev false
hassio true
docker true
user root
virtualenv false
python_version 3.9.6
os_name Linux
os_version 5.10.53
arch x86_64
timezone America/New_York
Home Assistant Community Store
GitHub API ok
Github API Calls Remaining 4761
Installed Version 1.14.0
Stage running
Available Repositories 879
Installed Repositories 66
AccuWeather
can_reach_server ok
remaining_requests 14
Home Assistant Cloud
logged_in true
subscription_expiration September 16, 2021, 8:00 PM
relayer_connected true
remote_enabled true
remote_connected true
alexa_enabled true
google_enabled true
can_reach_cert_server ok
can_reach_cloud_auth ok
can_reach_cloud ok
Home Assistant Supervisor
host_os Home Assistant OS 6.2
update_channel stable
supervisor_version supervisor-2021.06.8
docker_version 20.10.6
disk_total 30.8 GB
disk_used 19.1 GB
healthy true
supported true
board ova
supervisor_api ok
version_api ok
installed_addons Terminal & SSH (9.1.3), ADB - Android Debug Bridge (0.8.0), ESPHome (2021.8.0), Visual Studio Code (3.6.2), Let's Encrypt (4.11.0), Node-RED (10.0.0), Home Assistant Google Drive Backup (0.104.3), MariaDB (2.4.0), Check Home Assistant configuration (3.8.0), Glances (0.13.0), Vaultwarden (Bitwarden) (0.13.0), Portainer (2.0.0), Tautulli (2.3.0), phpMyAdmin (0.5.0), php-nginx Docker Image (latest), rest980 Docker Image (20200205), ioBroker (0.8.0), eufy_security_addon (0.3.3)
Lovelace
dashboards 2
resources 50
views 28
mode storage

For a few weeks now, I've been seeing multiple NWS Alert sensors showing up which seem to work for a short time, then become unavailable. These sensors are named the same as my primary sensor, with a number appended to the end. It's wasn't a major issue to me as the primary valid sensor is still working, so I was just deleting the unavailable ones, thinking that it might just be a small bug that would get cleared up in a new version. It seemed to happen most often when I restarted HA or rebooted the host VBox, though I've seen it happen while HA was up and stable as well.

I tried reinstalling (via HACS) as well as uninstalling/installing (again via HACS) to see if that would fix it but no go. I upped the integration's logging level to debug, but all I see is the standard messages that show the regular updates of data. Never had this issue with the integration in the past and while it's getting a little annoying to keep deleting the unavailable/invalid sensors, my main concern is there is some bug that I should report instead of just ignoring it.

Not finding anything of value in the debug logs of the integration, can you suggest other components I should be debugging or other procedure I can add to add some value to my issue? Like I said, I'm not seeing anything in the logs ATM besides standard update messages but I'll rerun the debug logs again and post them if you think it might help.

Thanks! NWS Alerts is important to me and it's always been solid up to now. Even rolling back didn't seem to help, but I'll gladly do it again if you need the data. (Maybe I didn't roll back far enough?)

New error on 2023.2 on the integration which states it will fail in 2023.3

I am sure you know about it from the pull, but I did not see anyone post from the 2023.2 logs yet. Sorry if this is just noise.

Logger: homeassistant.helpers.frame
Source: helpers/frame.py:77
First occurred: 8:48:09 PM (3 occurrences)
Last logged: 8:49:25 PM

Detected integration that called async_setup_platforms instead of awaiting async_forward_entry_setups; this will fail in version 2023.3. Please report issue to the custom integration author for nws_alerts using this method at custom_components/nws_alerts/init.py, line 68: hass.config_entries.async_setup_platforms(entry, PLATFORMS)
Detected integration that called async_setup_platforms instead of awaiting async_forward_entry_setups; this will fail in version 2023.3. Please report issue to the custom integration author for auto_backup using this method at custom_components/auto_backup/init.py, line 192: hass.config_entries.async_setup_platforms(entry, PLATFORMS)
Detected integration that called async_setup_platforms instead of awaiting async_forward_entry_setups; this will fail in version 2023.3. Please report issue to the custom integration author for garmin_connect using this method at custom_components/garmin_connect/init.py, line 40: hass.config_entries.async_setup_platforms(entry, PLATFORMS)

Unavailable

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'

No 'version' key

Home Assistant is throwing a warning about not having a version key.

No 'version' key in the manifest file for custom integration 'nws_alerts'. As of Home Assistant 2021.6, this integration will no longer be loaded. Please report this to the maintainer of 'nws_alerts'

Won't trigger automations

I've been running this integration for quite some time. I updated to 3.0 and noticed the last set of storms that ran though, the integration was not triggering the automations. I reinstalled all of my automations using your [nws_alerts_package.yaml].

If I trigger the automation manually, everything works fine. Push notifications and HA persistent notification don't follow restrictive templates.

I have downgraded to version 2.8 thinking the update broke something I haven't found yet but we just entered a Tornado Watch and still nothing, unless I manually run the automations.

I'm aware this may not be directly caused by your integration and I'm trying to test everything I can but since we are heading into some very bad weather today, now's the time to make sure everything is working.

Any ideas what would cause the automations not to trigger.

Attribute Value Data?

Question about this integration. Wasn't sure where else to ask the question. I see that the integration outputs the following attribute products:

  • Title
  • Event ID
  • Message Type
  • Event Status
  • Event Severity
  • Event Expires
  • Display Desc (Display Description)
  • Spoken Desc (Spoken Description)
  • icon: mdi:alert

I just set this integration up but I would like to set up automations for Severe Thunderstorm Warnings, Tornado Warnings, Tornado Watches, Severe Thunderstorm Watches, etc. Does anyone have screen shots of this integration and the attribute data that is populated for these attributes? Currently it just has 'null' as the attribute values obviously because there hasn't been a weather watch/warning issued since the setup. Just would like a little insight into the data values that will be populated. Thank you!

image

Request expiration timestamp be added

In the older version where there was two separate automations / sensors that would expose expiration field of the alert, example below. Is there any way to get it added back so it can be referenced in automations/templates.

{{
    as_timestamp(state_attr('sensor.nws_alert_event',
    'features')[0].properties.expires)| timestamp_custom('%-I:%M %p on
    %-m-%-d-%Y') }}.

UndefinedError: 'None' has no attribute 'split'

Having issue with this Code

and I get UndefinedError: 'None' has no attribute 'split' , I have Variables and I have changed sensor to My Alerts with my location
but not sure why I am getting the error??
and for some reason the title Parsing will not show up in my entities after adding to config.yaml

#########################################################################################
title: "Alerts"

type: custom:vertical-layout
layout:
max_cols: 4
cards:

  • type: custom:stack-in-card
    cards:
    • type: entities
      title: Severe Weather Alerts
      show_header_toggle: false
      entities: sensor.nws_alerts

    • type: conditional
      conditions:

      • entity: sensor.nws_alerts
        state_not: '0'
        card:
        type: markdown
        content: >

        NWS First Active Alert

        {% if state_attr('sensor.nws_alerts', 'title') != None and state_attr('sensor.nws_alerts', 'title').split(' - ')[0] is defined %}

        {{ states.sensor.nws_alerts.attributes.title.split(' - ')[0] }}

        {{ state_attr('sensor.nws_alerts', 'display_desc').split('\n\n-\n\n')[0] }}

        {% else %}
        none
        {% endif %}

    • type: conditional
      conditions:

      • entity: sensor.nws_alerts
        state_not: "0"

      • entity: sensor.nws_alerts
        state_not: "1"
        card:
        type: markdown
        content: >

        NWS Second Active Alert

        {% if state_attr('sensor.nws_alerts', 'title').split(' - ')[1] is defined %}

        {{ states.sensor.nws_alerts.attributes.title.split(' - ')[1] }}

        {{ state_attr('sensor.nws_alerts', 'display_desc').split('\n\n-\n\n')[1] }}

        {% else %}
        none
        {% endif %}

    • type: conditional
      conditions:

      • entity: sensor.nws_alerts
        state_not: "0"

      • entity: sensor.nws_alerts
        state_not: "1"

      • entity: sensor.nws_alerts
        state_not: "2"
        card:
        type: markdown
        content: >

        NWS Third Active Alert

        {% if state_attr('sensor.nws_alerts', 'title').split(' - ')[2] is defined %}

        {{ states.sensor.nws_alerts.attributes.title.split(' - ')[2] }}

        {{ state_attr('sensor.nws_alerts', 'display_desc').split('\n\n-\n\n')[2] }}

        {% else %}
        none
        {% endif %}

    • type: conditional
      conditions:

      • entity: sensor.nws_alerts
        state_not: "0"

      • entity: sensor.nws_alerts
        state_not: "1"

      • entity: sensor.nws_alerts
        state_not: "2"

      • entity: sensor.nws_alerts
        state_not: "3"
        card:
        type: markdown
        content: >

        NWS Fourth Active Alert

        {% if state_attr('sensor.nws_alerts', 'title').split(' - ')[3] is defined %}

        {{ states.sensor.nws_alerts.attributes.title.split(' - ')[3] }}

        {{ state_attr('sensor.nws_alerts', 'display_desc').split('\n\n-\n\n')[3] }}

        {% else %}
        none
        {% endif %}

    • type: conditional
      conditions:

      • entity: sensor.nws_alerts
        state_not: "0"

      • entity: sensor.nws_alerts
        state_not: "1"

      • entity: sensor.nws_alerts
        state_not: "2"

      • entity: sensor.nws_alerts
        state_not: "3"

      • entity: sensor.nws_alerts
        state_not: "4"
        card:
        type: markdown
        content: >

        NWS Fifth Active Alert

        {% if state_attr('sensor.nws_alerts', 'title').split(' - ')[4] is defined %}

        {{ states.sensor.nws_alerts.attributes.title.split(' - ')[4] }}

        {{ state_attr('sensor.nws_alerts', 'display_desc').split('\n\n-\n\n')[4] }}

        {% else %}
        none
        {% endif %}

    • type: entities
      title: NWS Alerts History
      show_header_toggle: false
      state_color: true
      entities:

      • variable.nws_alerts_event_ids
      • type: custom:entity-attributes-card
        heading_name: Name
        heading_state: State
        entity: variable.nws_alerts_event_ids
        filter:
        include:
        - variable.nws_alerts_event_ids.history_1
        - variable.nws_alerts_event_ids.history_2
        - variable.nws_alerts_event_ids.history_3
        - variable.nws_alerts_event_ids.history_4
        - variable.nws_alerts_event_ids.history_5
        - variable.nws_alerts_event_ids.history_6
        - variable.nws_alerts_event_ids.history_7
        - variable.nws_alerts_event_ids.history_8
        - variable.nws_alerts_event_ids.history_9
        - variable.nws_alerts_event_ids.history_10

Test Alerts not filtered out

Duplicate from HA forum.
A method to be able to filter out test alerts would be nice.

attribution: Data provided by Weather.gov
title: Tsunami Warning - Tsunami Warning
event_id: >-
  https://api.weather.gov/alerts/urn:oid:2.49.0.1.840.0.71d7d0751a32f5aaaf1f8459b0400eed5df86808.001.1-https://api.weather.gov/alerts/urn:oid:2.49.0.1.840.0.1fa001cb9ac3633f7dea41e5f4847966f7a7a14e.001.1
message_type: AlertAlert
display_desc: |-

  >
  Headline: Tsunami Warning
  Message Type: Alert
  Severity: Extreme
  Certainty: Likely
  Description: PZZ530-AKZ017>029-135-131-125-121-171-181-185-187-191-195-
  BCZ130-230-250-260-280-160-142-141-150-121-122-220-210-922-
  912-921-911-110-WAZ503-506>511-001-514>517-021-ORZ001-002-
  021-022-CAZ039>043-087-034-035-530-006-506-508-509-529-505-
  002-001-549-550-151717-
  /T.NEW.PAAQ.TS.W.9013.210715T1617Z-210715T1717Z/
  Alaska, British Columbia, Washington, Oregon and California
  coastal areas

  ...THIS_MESSAGE_IS_FOR_TEST_PURPOSES_ONLY...

  ...THIS IS A TEST TO DETERMINE TRANSMISSION TIMES INVOLVED IN THE
  DISSEMINATION OF TSUNAMI INFORMATION...


  RESPONSES ARE REQUIRED FROM
  ---------------------------
  * All Coastal Weather Forecast Offices in Alaska, Washington,
  Oregon and California

  * USAF 11th Rescue Coordination Center at Elmendorf AFB

  * California, Oregon, Washington and Alaska State Warning Points

  * Emergency Management British Columbia

  * The Pacific Storm Prediction Centre in British Columbia

  * Joint Typhoon Warning Center in Hawaii

  * U.S. Coast Guard 11th, 13th, 17th District Offices

  * U.S. Coast Guard Kodiak COMMSTA and CAMSPAC Point Reyes, CA

  * Canadian Coast Guard MCTS COMOX and/or Victoria

  * FAA Regional Operations Center in Seattle

  * All Pacific Coast Tsunamiready Community Warning Points.


  RESPONSES SHOULD INCLUDE
  ------------------------
  * Time-of-receipt
  * Agency name
  * Email address
  * Phone number


  Weather Service Offices should respond in accordance with local
  directives. All others should reply by one of the available methods
  below.


  SEND RESPONSE BY
  ----------------
  * Web - ntwc.arh.noaa.gov/commtest/index.html
  * Email address - [email protected]
  * AFTN address  - PAAQYQYX
  * AWIPS         - TMA
  * Fax           - 907-745-6071

  ...THIS_MESSAGE_IS_FOR_TEST_PURPOSES_ONLY...

  ...THIS IS A TEST TO DETERMINE TRANSMISSION TIMES INVOLVED IN THE
  DISSEMINATION OF TSUNAMI INFORMATION...
  Instruction: 

  -


  >
  Headline: Tsunami Warning
  Message Type: Alert
  Severity: Extreme
  Certainty: Likely
  Description: PZZ530-AKZ017>029-135-131-125-121-171-181-185-187-191-195-
  BCZ130-230-250-260-280-160-142-141-150-121-122-220-210-922-
  912-921-911-110-WAZ503-506>511-001-514>517-021-ORZ001-002-
  021-022-CAZ039>043-087-034-035-530-006-506-508-509-529-505-
  002-001-549-550-151717-
  /T.NEW.PAAQ.TS.W.9013.210715T1617Z-210715T1717Z/
  Alaska, British Columbia, Washington, Oregon and California
  coastal areas

  ...THIS_MESSAGE_IS_FOR_TEST_PURPOSES_ONLY...

  ...THIS IS A TEST TO DETERMINE TRANSMISSION TIMES INVOLVED IN THE
  DISSEMINATION OF TSUNAMI INFORMATION...


  RESPONSES ARE REQUIRED FROM
  ---------------------------
  * All Coastal Weather Forecast Offices in Alaska, Washington,
  Oregon and California

  * USAF 11th Rescue Coordination Center at Elmendorf AFB

  * California, Oregon, Washington and Alaska State Warning Points

  * Emergency Management British Columbia

  * The Pacific Storm Prediction Centre in British Columbia

  * Joint Typhoon Warning Center in Hawaii

  * U.S. Coast Guard 11th, 13th, 17th District Offices

  * U.S. Coast Guard Kodiak COMMSTA and CAMSPAC Point Reyes, CA

  * Canadian Coast Guard MCTS COMOX and/or Victoria

  * FAA Regional Operations Center in Seattle

  * All Pacific Coast Tsunamiready Community Warning Points.


  RESPONSES SHOULD INCLUDE
  ------------------------
  * Time-of-receipt
  * Agency name
  * Email address
  * Phone number


  Weather Service Offices should respond in accordance with local
  Instruction: 
spoken_desc: |-
  Tsunami Warning

  -

  Tsunami Warning
friendly_name: NWS Alerts
icon: mdi:alert


NWS Update Event ID Variable stopped working

After HA 105 update the Variable ID automation no longer worked for me.
Here is a fix for the Issue.

  • alias: NWS Update Event ID Variable
    initial_state: 'on'
    trigger:
    • platform: state
      entity_id: sensor.nws_alerts
      condition:
    • condition: template
      value_template: "{{ trigger.from_state.state != 'Unknown' }}"
      action:
      service: variable.set_variable
      data:
      variable: nws_alerts_event_ids
      attributes_template: >
      {
      "history_1":"{{states('variable.nws_alerts_event_ids')}}",
      "history_2":"{{state_attr('variable.nws_alerts_event_ids','history_1')}}",
      "history_3":"{{state_attr('variable.nws_alerts_event_ids','history_2')}}",
      "history_4":"{{state_attr('variable.nws_alerts_event_ids','history_3')}}",
      "history_5":"{{state_attr('variable.nws_alerts_event_ids','history_4')}}",
      "history_6":"{{state_attr('variable.nws_alerts_event_ids','history_5')}}",
      "history_7":"{{state_attr('variable.nws_alerts_event_ids','history_6')}}",
      "history_8":"{{state_attr('variable.nws_alerts_event_ids','history_7')}}",
      "history_9":"{{state_attr('variable.nws_alerts_event_ids','history_8')}}",
      "history_10":"{{state_attr('variable.nws_alerts_event_ids','history_9')}}"
      }

    data_template:

    value: "{{ (trigger.to_state.attributes.event_id).split('-')[0] }}" 
    

Please consider adding 'onset' as an attribute

The integration is fantastic and I'm using it for automations, but I've noticed that we'll often times have an alert long before the event in question. This is especially common for "watch" alerts.

I use this integration to trigger charging up my batteries to full and also certain other safety related items. Sometimes the onset is set as 24-36 hours after the alert starts, even when the alert is marked as severe. With the onset, I could decide when to start filling the batteries and also trigger certain automations for closer to the event vs the 1-2 days before where it's still sunny.

Expiration processing / removal of outdated and cancelled alerts.

I was looking into duplicated alerts again. While looking the alerts that were duplicated because updated alerts were issued, an alert cancellation was issued. The cancellation removed all current alerts from the NWS forecast page for my area. Home Assistant is currently showing 6 alerts, (3 x 2) because the integration is set up to look for alerts for county NYC103 and zone NYZ081.

I believe this is related to the discussion in #8.

I wanted to capture the data in case it is helpful for figuring this out.

At first glance it looks like `.features[n].parameters.expiredReferences[] contains IDs of previous alerts that should be considered expired/replaced.

"expiredReferences": [
  "
 [email protected],urn:oid:2.49.0.1.840.0.4688160938185b3b61ccc50f1d56ed5d0d33a948.005.1,2022-10-02T08:15:00-04:00
 [email protected],urn:oid:2.49.0.1.840.0.4688160938185b3b61ccc50f1d56ed5d0d33a948.004.1,2022-10-02T08:15:00-04:00
 [email protected],urn:oid:2.49.0.1.840.0.9586416e336141a79ccdbec3e789ec5afc45b378.004.1,2022-10-02T02:40:00-04:00
 [email protected],urn:oid:2.49.0.1.840.0.9586416e336141a79ccdbec3e789ec5afc45b378.003.1,2022-10-02T02:40:00-04:00
 [email protected],urn:oid:2.49.0.1.840.0.acbfc7b3a49ccd7490e1c9e1e7366841b1fe0315.004.1,2022-10-02T04:20:00-04:00 
 [email protected],urn:oid:2.49.0.1.840.0.acbfc7b3a49ccd7490e1c9e1e7366841b1fe0315.003.1,2022-10-02T04:20:00-04:00
 [email protected],urn:oid:2.49.0.1.840.0.46e51765ce159f09a54f1155df6ae93315e3a5a7.004.1,2022-10-01T17:10:00-04:00
 [email protected],urn:oid:2.49.0.1.840.0.46e51765ce159f09a54f1155df6ae93315e3a5a7.003.1,2022-10-01T17:10:00-04:00"

(Somewhat tangential note: It also looks like the ID could be used to coalesce duplicates between the county alerts and zone alerts.)

Just looking at zone NYZ081, the count API says there are 3 active alerts. If I look at https://alerts.weather.gov/cap/wwaatmget.php?x=NYZ081&y=1 it now shows "There are no active ..."

Raw json returned for "https://api.weather.gov/alerts/active?zone=NYZ081"

{
    "@context": [
        "https://geojson.org/geojson-ld/geojson-context.jsonld",
        {
            "@version": "1.1",
            "wx": "https://api.weather.gov/ontology#",
            "@vocab": "https://api.weather.gov/ontology#"
        }
    ],
    "type": "FeatureCollection",
    "features": [
        {
            "id": "https://api.weather.gov/alerts/urn:oid:2.49.0.1.840.0.21ca73679d00b1d530bd0b88dfdf7b73ba58959b.003.1",
            "type": "Feature",
            "geometry": null,
            "properties": {
                "@id": "https://api.weather.gov/alerts/urn:oid:2.49.0.1.840.0.21ca73679d00b1d530bd0b88dfdf7b73ba58959b.003.1",
                "@type": "wx:Alert",
                "id": "urn:oid:2.49.0.1.840.0.21ca73679d00b1d530bd0b88dfdf7b73ba58959b.003.1",
                "areaDesc": "Northwest Suffolk; Northeast Suffolk; Southeast Suffolk",
                "geocode": {
                    "SAME": [
                        "036103"
                    ],
                    "UGC": [
                        "NYZ078",
                        "NYZ079",
                        "NYZ081"
                    ]
                },
                "affectedZones": [
                    "https://api.weather.gov/zones/forecast/NYZ078",
                    "https://api.weather.gov/zones/forecast/NYZ079",
                    "https://api.weather.gov/zones/forecast/NYZ081"
                ],
                "references": [],
                "sent": "2022-10-02T17:47:00-04:00",
                "effective": "2022-10-02T17:47:00-04:00",
                "onset": "2022-10-02T17:47:00-04:00",
                "expires": "2022-10-02T18:02:36-04:00",
                "ends": "2022-10-02T20:00:00-04:00",
                "status": "Actual",
                "messageType": "Alert",
                "category": "Met",
                "severity": "Minor",
                "certainty": "Observed",
                "urgency": "Past",
                "event": "Coastal Flood Advisory",
                "sender": "[email protected]",
                "senderName": "NWS Upton NY",
                "headline": "The Coastal Flood Advisory has been cancelled.",
                "description": "The Coastal Flood Advisory has been cancelled and is no longer in effect.",
                "instruction": null,
                "response": "AllClear",
                "parameters": {
                    "AWIPSidentifier": [
                        "CFWOKX"
                    ],
                    "WMOidentifier": [
                        "WHUS41 KOKX 022147"
                    ],
                    "NWSheadline": [
                        "COASTAL FLOOD ADVISORY IS CANCELLED"
                    ],
                    "BLOCKCHANNEL": [
                        "EAS",
                        "NWEM",
                        "CMAS"
                    ],
                    "VTEC": [
                        "/O.CAN.KOKX.CF.Y.0016.000000T0000Z-221003T0000Z/"
                    ],
                    "eventEndingTime": [
                        "2022-10-03T00:00:00+00:00"
                    ],
                    "expiredReferences": [
                        "[email protected],urn:oid:2.49.0.1.840.0.4688160938185b3b61ccc50f1d56ed5d0d33a948.005.1,2022-10-02T08:15:00-04:00 [email protected],urn:oid:2.49.0.1.840.0.4688160938185b3b61ccc50f1d56ed5d0d33a948.004.1,2022-10-02T08:15:00-04:00 [email protected],urn:oid:2.49.0.1.840.0.9586416e336141a79ccdbec3e789ec5afc45b378.004.1,2022-10-02T02:40:00-04:00 [email protected],urn:oid:2.49.0.1.840.0.9586416e336141a79ccdbec3e789ec5afc45b378.003.1,2022-10-02T02:40:00-04:00 [email protected],urn:oid:2.49.0.1.840.0.acbfc7b3a49ccd7490e1c9e1e7366841b1fe0315.004.1,2022-10-02T04:20:00-04:00 [email protected],urn:oid:2.49.0.1.840.0.acbfc7b3a49ccd7490e1c9e1e7366841b1fe0315.003.1,2022-10-02T04:20:00-04:00 [email protected],urn:oid:2.49.0.1.840.0.46e51765ce159f09a54f1155df6ae93315e3a5a7.004.1,2022-10-01T17:10:00-04:00 [email protected],urn:oid:2.49.0.1.840.0.46e51765ce159f09a54f1155df6ae93315e3a5a7.003.1,2022-10-01T17:10:00-04:00"
                    ]
                }
            }
        },
        {
            "id": "https://api.weather.gov/alerts/urn:oid:2.49.0.1.840.0.4688160938185b3b61ccc50f1d56ed5d0d33a948.004.1",
            "type": "Feature",
            "geometry": null,
            "properties": {
                "@id": "https://api.weather.gov/alerts/urn:oid:2.49.0.1.840.0.4688160938185b3b61ccc50f1d56ed5d0d33a948.004.1",
                "@type": "wx:Alert",
                "id": "urn:oid:2.49.0.1.840.0.4688160938185b3b61ccc50f1d56ed5d0d33a948.004.1",
                "areaDesc": "Northeast Suffolk; Southwest Suffolk; Southeast Suffolk",
                "geocode": {
                    "SAME": [
                        "036103"
                    ],
                    "UGC": [
                        "NYZ079",
                        "NYZ080",
                        "NYZ081"
                    ]
                },
                "affectedZones": [
                    "https://api.weather.gov/zones/forecast/NYZ079",
                    "https://api.weather.gov/zones/forecast/NYZ080",
                    "https://api.weather.gov/zones/forecast/NYZ081"
                ],
                "references": [
                    {
                        "@id": "https://api.weather.gov/alerts/urn:oid:2.49.0.1.840.0.9586416e336141a79ccdbec3e789ec5afc45b378.003.1",
                        "identifier": "urn:oid:2.49.0.1.840.0.9586416e336141a79ccdbec3e789ec5afc45b378.003.1",
                        "sender": "[email protected]",
                        "sent": "2022-10-02T02:40:00-04:00"
                    },
                    {
                        "@id": "https://api.weather.gov/alerts/urn:oid:2.49.0.1.840.0.acbfc7b3a49ccd7490e1c9e1e7366841b1fe0315.003.1",
                        "identifier": "urn:oid:2.49.0.1.840.0.acbfc7b3a49ccd7490e1c9e1e7366841b1fe0315.003.1",
                        "sender": "[email protected]",
                        "sent": "2022-10-02T04:20:00-04:00"
                    }
                ],
                "sent": "2022-10-02T08:15:00-04:00",
                "effective": "2022-10-02T08:15:00-04:00",
                "onset": "2022-10-02T15:00:00-04:00",
                "expires": "2022-10-02T16:15:00-04:00",
                "ends": "2022-10-02T20:00:00-04:00",
                "status": "Actual",
                "messageType": "Update",
                "category": "Met",
                "severity": "Minor",
                "certainty": "Likely",
                "urgency": "Expected",
                "event": "Coastal Flood Advisory",
                "sender": "[email protected]",
                "senderName": "NWS Upton NY",
                "headline": "Coastal Flood Advisory issued October 2 at 8:15AM EDT until October 2 at 8:00PM EDT by NWS Upton NY",
                "description": "* WHAT...Up to one foot of inundation above ground level\nexpected in vulnerable areas near the waterfront and shoreline.\n\n* WHERE...Northeast Suffolk, Southwest Suffolk and Southeast\nSuffolk Counties.\n\n* WHEN...From 3 PM this afternoon to 8 PM EDT this evening.\n\n* IMPACTS...Minor flooding is expected in the more vulnerable\nlocations near the waterfront and shoreline. Some roads and\nlow lying properties including parking lots, parks, lawns, and\nhomes and businesses with basements near the waterfront will\nexperience minor flooding.\n\n* ADDITIONAL DETAILS...Minor to localized moderate flooding may\nbe possible with the Monday afternoon and early evening high\ntide cycle.",
                "instruction": "If travel is required, allow extra time as some roads may be\nclosed. Do not drive around barricades or through water of\nunknown depth. Take the necessary actions to protect flood-prone\nproperty.",
                "response": "Monitor",
                "parameters": {
                    "AWIPSidentifier": [
                        "CFWOKX"
                    ],
                    "WMOidentifier": [
                        "WHUS41 KOKX 021215"
                    ],
                    "NWSheadline": [
                        "COASTAL FLOOD ADVISORY REMAINS IN EFFECT FROM 3 PM THIS AFTERNOON TO 8 PM EDT THIS EVENING"
                    ],
                    "BLOCKCHANNEL": [
                        "EAS",
                        "NWEM",
                        "CMAS"
                    ],
                    "VTEC": [
                        "/O.CON.KOKX.CF.Y.0016.221002T1900Z-221003T0000Z/"
                    ],
                    "eventEndingTime": [
                        "2022-10-03T00:00:00+00:00"
                    ],
                    "expiredReferences": [
                        "[email protected],urn:oid:2.49.0.1.840.0.46e51765ce159f09a54f1155df6ae93315e3a5a7.003.1,2022-10-01T17:10:00-04:00"
                    ]
                }
            }
        },
        {
            "id": "https://api.weather.gov/alerts/urn:oid:2.49.0.1.840.0.46e51765ce159f09a54f1155df6ae93315e3a5a7.003.1",
            "type": "Feature",
            "geometry": null,
            "properties": {
                "@id": "https://api.weather.gov/alerts/urn:oid:2.49.0.1.840.0.46e51765ce159f09a54f1155df6ae93315e3a5a7.003.1",
                "@type": "wx:Alert",
                "id": "urn:oid:2.49.0.1.840.0.46e51765ce159f09a54f1155df6ae93315e3a5a7.003.1",
                "areaDesc": "Northeast Suffolk; Southwest Suffolk; Southeast Suffolk",
                "geocode": {
                    "SAME": [
                        "036103"
                    ],
                    "UGC": [
                        "NYZ079",
                        "NYZ080",
                        "NYZ081"
                    ]
                },
                "affectedZones": [
                    "https://api.weather.gov/zones/forecast/NYZ079",
                    "https://api.weather.gov/zones/forecast/NYZ080",
                    "https://api.weather.gov/zones/forecast/NYZ081"
                ],
                "references": [],
                "sent": "2022-10-01T17:10:00-04:00",
                "effective": "2022-10-01T17:10:00-04:00",
                "onset": "2022-10-02T15:00:00-04:00",
                "expires": "2022-10-02T01:15:00-04:00",
                "ends": "2022-10-02T20:00:00-04:00",
                "status": "Actual",
                "messageType": "Alert",
                "category": "Met",
                "severity": "Minor",
                "certainty": "Likely",
                "urgency": "Expected",
                "event": "Coastal Flood Advisory",
                "sender": "[email protected]",
                "senderName": "NWS Upton NY",
                "headline": "Coastal Flood Advisory issued October 1 at 5:10PM EDT until October 2 at 8:00PM EDT by NWS Upton NY",
                "description": "* WHAT...Up to one half foot of inundation above ground level\nexpected in vulnerable areas near the waterfront and shoreline.\n\n* WHERE...Northeast Suffolk, Southwest Suffolk and Southeast\nSuffolk Counties.\n\n* WHEN...From 3 PM to 8 PM EDT Sunday.\n\n* IMPACTS...Minor flooding is expected in the more vulnerable\nlocations near the waterfront and shoreline. Some roads and low\nlying properties including parking lots, parks, lawns, and homes\nand businesses with basements near the waterfront will\nexperience minor flooding.\n\n* ADDITIONAL DETAILS...Minor to localized moderate flooding may be\npossible with the Monday afternoon and early evening high tide\ncycle.",
                "instruction": "If travel is required, allow extra time as some roads may be\nclosed. Do not drive around barricades or through water of\nunknown depth. Take the necessary actions to protect flood-prone\nproperty.",
                "response": "Monitor",
                "parameters": {
                    "AWIPSidentifier": [
                        "CFWOKX"
                    ],
                    "WMOidentifier": [
                        "WHUS41 KOKX 012110"
                    ],
                    "NWSheadline": [
                        "COASTAL FLOOD ADVISORY IN EFFECT FROM 3 PM TO 8 PM EDT SUNDAY"
                    ],
                    "BLOCKCHANNEL": [
                        "EAS",
                        "NWEM",
                        "CMAS"
                    ],
                    "VTEC": [
                        "/O.NEW.KOKX.CF.Y.0016.221002T1900Z-221003T0000Z/"
                    ],
                    "eventEndingTime": [
                        "2022-10-03T00:00:00+00:00"
                    ]
                }
            }
        }
    ],
    "title": "current watches, warnings, and advisories for Southeast Suffolk (NYZ081) NY",
    "updated": "2022-10-02T21:47:42+00:00"
}

Not showing up in integrations ui

Integration is not showing up in the HA Integrations UI nor did it create any entities. Using HA version 2023.3.6. I've restarted HA several times with no success.

Open up commits?

Hi there, I was having issues with the NWS_Alerts tab. Wanted to commit and create a PR with my changes but was met with a 403 forbidden. Thanks for providing this integration!

Feature Request

Greetings. First, want to thank you for developing this. It has come in very handy for helping us with spring tornado warnings and other weather conditions.

Would it be possible to add all attributes returning from the API in properties: references? Some of them are there and know there is some concatenation for display description and spoken description, but would be nice to have them all individually as well to fine tune in automations.

Existing:

  • expires
  • messageType
  • severity
  • event (as title)

Not included; request to add:

  • sent
  • received
  • onset
  • ends
  • status
  • category
  • certainty
  • urgency
  • sender
  • senderName
  • headline
  • description
  • instruction
  • response

Unable to complete setup via the Homeassistant UI.

After installing through hacs and restarting, I went to configuration>integrations>add integration and found NWS Alerts. It populated the zone ID's automatically, but when I press submit I get an error that says Malformed User input: Expected STR for data zone ID.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.