NOAA WARNINGS not working now

WHat else needs to be changed, NWS Alerts (weather.gov)
Above URL shows flood warning, changing the Zone to GAC109 and clicking go shows
GAC109
There are no active watches, warnings or advisories

Brian may need to change look up api and update a zip…also check that flood warning is a current one and not archived

I have been in touch with Brian and advised him of the problem and the Saratoga template solution to it. He is away, but will look at it when he gets back.

Jim

1 Like

Thank you for this info

I’ve been struggling with the same issue for a few weeks as well. After Brain updates WD, it would be good to clarify if this NOAA change is only for warnings or forecasts/warnings.

suggests it’s only alerts?

What changed was alerts.weather.gov which stopped offering XML format ATOM alerts on the site in favor of offering alerts in JSON or CAP XML on api.weather.gov instead, using both a new host and query URI.

As I understand it, WD uses ftp to get zone forecasts and zone alerts (raw text) from tgftp.nws.noaa.gov. that capability still exists and is not being phased out (AFAIK).
A forecast zone like for my CAZ513 zone is at:
https://tgftp.nws.noaa.gov/data/forecasts/zone/ca/caz513.txt
which is a Zone, not a Point forecast so is more general.

The alerts for CAZ513 that WD uses in the NOAA Warnings setup is the old alerts.weather.gov query format:

https://alerts.weather.gov/cap/wwaatmget.php?x=CAZ513&y=1

The new format is

https://api.weather.gov/alerts/active.atom?zone=CAZ513

But… they changed the ATOM format to omit an <event>...</event> entry where there are not any active alerts in the area. For the nws-alerts program, I had to detect that and insert XML with the missing <event>...</event> so the rest of Curly’s code would work normally. (I was too lazy to just rewrite it).
The missing part I’d inserted was in this function from nws-alerts:

// FUNCTION - generate fake no-data alert for CAP 1.2 no alerts entries
function gen_no_alert($zData) { // Added in V2.00
global $noted,$doDebug;
$output = '';

/* input CAP1.2 with no <event> entry:

<feed xmlns="http://www.w3.org/2005/Atom" xmlns:cap="urn:oasis:names:tc:emergency:cap:1.2">
    <id>https://api.weather.gov/alerts.atom?zone%5B0%5D=CAZ513&amp;limit=500&amp;active=1</id>
    <generator>NWS CAP Server</generator>
    <updated>2024-01-23T00:30:00+00:00</updated>
    <author>
        <name>[email protected]</name>
    </author>
    <title>Current watches, warnings, and advisories for Santa Clara Valley Including San Jose (CAZ513) CA</title>
    <link rel="self" href="https://api.weather.gov/alerts.atom?zone%5B0%5D=CAZ513&amp;limit=500&amp;active=1"/>
</feed>

Need something in <event> section like:

  	<entry>
  	<id>https://alerts.weather.gov/cap/wwaatmget.php?x=CAZ513&amp;y=0</id>
  	<updated>2024-01-29T16:13:41+00:00</updated>
  	<author>
  	<name>[email protected]</name>
  	</author>
  	<title>There are no active watches, warnings or advisories</title>
  	<link href="https://alerts.weather.gov/cap/wwaatmget.php?x=CAZ513&amp;y=0"/>
  	</entry> 
*/

  $id = isset($zData->id)?(string)$zData->id:'';
	$id = str_replace('&','&amp;',$id);
	$updated = isset($zData->updated)?(string)$zData->updated:'';
	$author = isset($zData->author->name)?(string)$zData->author->name:'';
	$link = $id;
	
$rawXML = '<entry>
  <id>'.$id.'</id>
  <updated>'.$updated.'</updated>
  <author>
    <name>'.$author.'</name>
  </author>
  <title>There are no active watches, warnings or advisories</title>
  <link href="'.$link.'"/>
	<noalert>1</noalert>
</entry>
'; 
  $output = simplexml_load_string($rawXML);
	if($doDebug) {$noted .= "<!-- gen_no_entry generated \n".print_r($output,true)." -->\n"; }
  return($output);
}

I think Brian will have to update the NOAA Warnings program to use/handle the new alerts URL.

I appreciate the clarifications and updates all

Did anyone try the new zipped version Brian updated for NWS Alerts. It is not finding any codes for my State - Tried New Hampshire and got the same. California appeared to find some zones that worked. I did try other states and it appeared hit or miss. Will test on my second system.

Do you not need to enter counties rather than zones now?

It worked once,now failing Tried both old zones format an then county format…

You’ll need county codes not the zone. Stand by, the work is in progress.

Jim

As I said in post…tried BOTH…

worked for a while then not…with old zone formats and new county format…

I think Brian may soon be making more changes?

Yes, he is making the needed changes. I am testing them for him, but its not done yet and not ready for prime time. Like i said: Stand by.

You cannot make the old version work. NOAA has changed the format of the warning. Brian will release something as soon as its ready. I prefer he release something that actually works. STAND BY.

2 Likes

Thanks Brian…that is working now. Will there be an eventual change to the custom tag for %NOAAEvent%? to coincide with this new process?

Did not find my State, nor zip but I knew my county code and that did work by manually entering it.

Use the address lookup if you don’t know your code.

Jim

there is a new field with ver 7 of wdwarning email exe for postal address