NOAA weather alerts from weather.gov aka US National Weather Service

I committed the new manifest.json and fixed my goof on reverting the changes made by claytonjn.
I am taking down my docker instance nad updating HA to test it now.

Oh, just noticed you probably also need an empty __init__.py file under custom_components/noaa_alerts.

Bad news it also failed for me. even with an init.py

alright everyone, Got it up and running. Believe it or not it simply did not like having @dcshoecomp as code owners. It probably needed to be in quotes or something, but i just removed it.
I updated my github to reflect this change.
{
ā€œdomainā€: ā€œnoaa_alertsā€,
ā€œnameā€: ā€œNoaa Alertsā€,
ā€œdocumentationā€: ā€œhttps://github.com/dcshoecomp/noaa_alertsā€,
ā€œrequirementsā€: [ā€œnoaa_sdkā€],
ā€œdependenciesā€: [],
ā€œcodeownersā€: []
}

I now feel like i am spamming this post. I did a bunch of work to fix the mistakes i made in the past and merged the best of 2 ideas into one. In theory this now will dump all alerts, along with giving you the most severe alert in the attributes.
I hope this lives up to everyoneā€™s expectations.

Well Iā€™m running hassio in a generic linux install and now after the latest changes it seems to work.
I now get a sensor.noaa_alerts_MYZONEID.
I put it in a sensor card and will check the next time storms are on the way!

Thanks for the effort on this.

Iā€™m not sure if the question above was just missed in the recent fray butā€¦

Do you have any intention of implementing the ability to include more than one zone?

Right now in my current custom_component I use two zones:

INZ009 for the zone
INC033 for the county

is that possible with your component?

Sorry got lost in the mess. Yes that is actually my next step to add the ability to do multiple zones, as now the sensors are named by zoneid.

So actually i went back and decided to try it because i thought it might actually work. If you actually just add another sensor with a new zoneid it seems to work fine. but this would make multiple calls to noaa. Also within the county alerts probably contains the zone alert?
sensor:

  • platform: noaa_alerts
    zoneid: VAC087
  • platform: noaa_alerts
    zoneid: TXZ237

Thanks for taking a look.

I think it would be better if they could be contained in one sensor. If there is a way (I havenā€™t looked into it yetā€¦) to make an actionable automation out of the sensor then it would simplify the code to have all of the zones related to the same geographical area contained within the same sensor.

I agree. That will be the next step I take.

I really like the formatting and layout of this sensor better than the one that scrapes the website by @eracknaphobia. Has anyone reworked the automations and persistent notifications to work with this sensor? And if so can you please link to examples.

Once the multi-zone sensor gets created I will likely start looking at doing that for my NWS package that currently uses the other component that Iā€™ve linked to in other threads. Just to see how the two components compare in functionality.

I have to ask, tho, why you like this one better? What do you see as the drawback of the other component? Iā€™ve literally never had any issues with it and which is why I still use it till the present moment.

The only thing that causes me any concern about the other component is that there doesnā€™t seem to be any active development on it which this one has.

However, conversely, I donā€™t see that as a defacto ā€œproblemā€ because if the other one works as it is (and it obviously does or I wouldnā€™t still be using it) and this one still needs work to get it up to the functionality of the other then there is no reason it should be worked on just for the sake of working on it with no real gain in functionality.

Here is one of my simple automatons i setup. It just pop a persistent notification and sends the headline through my speakers.

  • id: ā€˜1559443229980ā€™
    alias: Noaa Alert - TTS home
    trigger:
    • entity_id: sensor.noaa_alerts_(yourzoneid)
      from: ā€˜0ā€™
      platform: state
      condition: []
      action:
    • data_template:
      message: ā€˜{{ states.sensor.noaa_alerts_(yourzoneid).attributes.description }}ā€™
      service: persistent_notification.create
    • data_template:
      entity_id: media_player.downstairs_speakers
      message: ā€˜{{ states.sensor.noaa_alerts_(yourzoneid).attributes.headline }}ā€™
      service: tts.google_translate_say

I just installed this component and that brings up a question related to the above postā€¦

I see above in your screen shot that it seems the state there is the severity level of the first alert.

In your docs on github you state:

states: sensor will return the number of current alerts,

And it looks like right now my sensor is showing 0 as the state since I have no active alerts.

Does that mean that if there is an alert that the state will be a number showing how many alerts there are as it seems to say in the docs? Or will the state change to show the severity level of the most severe alert like in your screen shot above?

Sorry you must have checked it right before i updated the docs to reflect the new change. State is the number, as it will now dump the entire json of alerts, so if you wanted to deal with lots of alerts you could with the alerts_string

I am also trying to wrap my head around the county and zone request. Check out my github enhancement request note. Let me know if thatā€™s what you had in mind.

Did you see this? Full noaa_sdk data and unlimited alerts supprt by claytonjn Ā· Pull Request #1 Ā· dcshoecomp/noaa_alerts Ā· GitHub

Not really. I was hoping you could combine them into one sensor.

Right now the way the REST API works you can poll the website with multiple codes in the request and it will show all of the alerts for all of those zones/counties.

An example of a properly formatted REST request is:

https://api.weather.gov/alerts/active?zone=INZ009,INC033

The current alert component Iā€™m using (from eracknaphobia) responds the same way. I have it set up for multiple zones and it combines them all into one sensor.

I like the idea of the state being the number of alerts. it should make it pretty easy to transition my alerts package to your component.

Hey @dcshoecomp I just submitted a PR based on the results of this thread:

If you could take a look and see what you think I would appreciate it.

EDIT:

Nevermindā€¦

I didnā€™t realize that you added the ā€œalertsā€ attribute back in a couple of days after I updated.

But as I mentioned in the other thread linked above, this is a very good example of a need to have this in an update tracker like HACS.

Iā€™ll close that PR.