[Release] NOAA Weather Alerts

I thought that the NOAA App logged if a message had already been broadcast to the devices?
I seem to have an issue where when a new alert is issued, it runs through all active alerts in the area (15 here currently) and that leaves me with my google homes going crazy for about 10 min, with them playing 1/2 a message, and then being cut off by the next one starting.

This started happening last night, after I updated by hub and the NOAA app via HPM. At first I thought, okay maybe it resets whenever you make a change to the app or restart the hub. But this time it fired off all this mess when the alert was issued.

Here the log file:
Log File

I have released a couple of updates

  • address some of the alert consistency
  • ability to select severity unknown, which for some is how air quality alerts are severity tagged from NOAA.
  • reduced overhead of the tile device when alerts are active
    • you can also disable the tiles device if you are not using it for dashboards.

I need a few testers, so if you use HPM, do a 'repair' to get the latest version.

Also - if you do use the tile device, it is a good idea to reduce the number of stored events and state for the tile driver (do your HE DB a favor):

See HE console -> devices -> NOAA Tile ->. ( suggest small numbers like:). then hit save device

Screen Shot 2021-02-20 at 12.59.24 PM

1 Like

Just repaired/updated my C5 to the latest version- no problems so far. Is there anything specific that you need tested? I'll let you know if I experience anything wonky.

Ok I did the update to my C4. I do see some snow forecasted hopefully the NWS will trigger a few alerts.

Update: Got the darn stack overflow on the Tile device again.

The interesting thing is I am running the one release back on two C7's and never received any stack overflows.

@gopher.ny - any thoughts on stack overflow?

The test message is not very big...

Have you tried setting your events history for the db smaller?

Yep did that the last time set very small:

image

Can you PM me with your hub id? Can't find it by community email address.
Stack would have a reference to string, not string itself. I'm going to increase stack size per thread in 2.2.6 a bit to avoid these.

1 Like

I don't get a full stack trace for some reason, but it's getting a stack overflow trying to parse or process some regular expression. There are repeating lines like these, going on for many pages:

at java.util.regex.Pattern$CharProperty.match(Pattern.java:3777)
at java.util.regex.Pattern$Branch.match(Pattern.java:4604)
at java.util.regex.Pattern$GroupHead.match(Pattern.java:4658)
at java.util.regex.Pattern$Loop.match(Pattern.java:4785)
at java.util.regex.Pattern$GroupTail.match(Pattern.java:4717)
at java.util.regex.Pattern$BranchConn.match(Pattern.java:4568)
at java.util.regex.Pattern$CharProperty.match(Pattern.java:3777)

I see there is an update to the NOAA app:

It reduces significantly the overhead of active events in the tile driver.

It also allows disabling use of the tile
It handles better display / changes of events as new ones arrive with existing ones
It allows to gather 'unknown' labeled events, (such as air quality alerts)
Fixes some issues in multi-instance deployments.
Allow selection of 60 minute polling interval

4 Likes

The latest version is giving me problems.

First I tried to test alert configuration and display API response, and it gave me this error in the logs:

app:532 2021-02-24 10:26:29.839 pm error java.lang.NullPointerException: Cannot invoke method size() on null object on line 456 (SettingsPage)

Then I removed the app and added again (didn't remove/uninstall the code, just the user app). When I did that, the test alert configuration started working, but I couldn't filter for specific weather events in the advanced settings page. When I click the drop-down, nothing appears.

So I have looked into this, and it appears the NOAA folks have broken the API used to query the types list.

I have reported this to them. I have not found an alternate source for this types list.

I will look at hard coding something in as a fallback. It is now posted

April 2021 update - NOAA folks seem to have now corrected their API also

I just updated and went to Advanced Alert Settings, where I chose Severe Thunderstorm Warning and Tornado Warning. The options are back in that list now.

Then I went to Settings and chose the test feature, and it gave me an error:

Unexpected Error

An unexpected error has occurred trying to load the app. Check Logs for more information.

Error: Cannot invoke method size() on null object

Now the settings page only lists that error.

My logs have this:

[app:760] 2021-02-25 09:47:47.104 am [error] java.lang.NullPointerException: Cannot invoke method size() on null object on line 458 (SettingsPage)
[app:760] 2021-02-25 09:47:39.760 am [error] java.lang.NullPointerException: Cannot invoke method size() on null object on line 458 (SettingsPage)
[app:760] 2021-02-25 09:46:32.923 am [warn] The API Weather.gov did not return a response. (exception), java.lang.NullPointerException: Cannot invoke method size() on null object
[app:760] 2021-02-25 09:45:44.668 am [warn] The API Weather.gov did not return a response. groovyx.net.http.HttpResponseException: Not Found

This is basically what happened after the update to 4.0.010, prior to me removing and replacing the user app.

sorry about that, new kit posted

If you use HPM, do an HPM repair to force it to update

I haven't seen an update in HPM past 4.0.011. I did a complete uninstall, removing everything, then installed from HPM. Here are all my logs after adding the app again and turning on debug:

Summary

app:7632021-02-25 04:42:49.390 pm errororg.codehaus.groovy.runtime.typehandling.GroovyCastException: Cannot cast object '{}' with class 'java.util.LinkedHashMap' to class 'java.util.List' due to: groovy.lang.GroovyRuntimeException: Could not find matching constructor for: java.util.List(java.util.LinkedHashMap) on line 374 (ahttpreq)
app:7632021-02-25 04:42:49.377 pm warnThe API Weather.gov did not return a response.
app:7632021-02-25 04:42:49.042 pm debugConnecting to weather.gov service.
app:7632021-02-25 04:42:49.039 pm debugURI: https://api.weather.gov/alerts?point=39.415768%2C-77.378460&status=actual&message_type=alert,update&severity=Severe,Extreme
app:7632021-02-25 04:40:48.823 pm errororg.codehaus.groovy.runtime.typehandling.GroovyCastException: Cannot cast object '{}' with class 'java.util.LinkedHashMap' to class 'java.util.List' due to: groovy.lang.GroovyRuntimeException: Could not find matching constructor for: java.util.List(java.util.LinkedHashMap) on line 455 (SettingsPage)
app:7632021-02-25 04:40:48.806 pm warnThe API Weather.gov did not return a response. groovyx.net.http.HttpResponseException: Bad Request
app:7632021-02-25 04:40:48.511 pm debugConnecting to weather.gov service.
app:7632021-02-25 04:40:48.508 pm debugURI: https://api.weather.gov/alerts?point=39.415768%2C-77.378460&status=actual&message_type=alert,update&severity=Severe,Extreme
app:7632021-02-25 04:40:40.167 pm infoCreating data information for tile display.
app:7632021-02-25 04:40:39.454 pm errororg.codehaus.groovy.runtime.typehandling.GroovyCastException: Cannot cast object '{}' with class 'java.util.LinkedHashMap' to class 'java.util.List' due to: groovy.lang.GroovyRuntimeException: Could not find matching constructor for: java.util.List(java.util.LinkedHashMap) on line 374 (ahttpreq)
app:7632021-02-25 04:40:39.442 pm warnThe API Weather.gov did not return a response.
app:7632021-02-25 04:40:39.102 pm infoDebug messages set to automatically disable in 15 minute(s).
app:7632021-02-25 04:40:39.089 pm debugConnecting to weather.gov service.
app:7632021-02-25 04:40:39.086 pm debugURI: https://api.weather.gov/alerts?point=39.415768%2C-77.378460&status=actual&message_type=alert,update&severity=Severe,Extreme
app:7632021-02-25 04:40:39.054 pm warnNOAA Weather Alerts application state is reset.
app:7632021-02-25 04:40:39.029 pm warnThe API Weather.gov did not return a response. groovyx.net.http.HttpResponseException: Not Found
app:7632021-02-25 04:40:38.606 pm warnNOAA Weather Alerts application state is being reset.
app:7632021-02-25 04:39:28.819 pm errororg.codehaus.groovy.runtime.typehandling.GroovyCastException: Cannot cast object '{}' with class 'java.util.LinkedHashMap' to class 'java.util.List' due to: groovy.lang.GroovyRuntimeException: Could not find matching constructor for: java.util.List(java.util.LinkedHashMap) on line 374 (ahttpreq)
app:7632021-02-25 04:39:28.812 pm warnThe API Weather.gov did not return a response. (exception), org.codehaus.groovy.runtime.typehandling.GroovyCastException: Cannot cast object '{}' with class 'java.util.LinkedHashMap' to class 'java.util.List' due to: groovy.lang.GroovyRuntimeException: Could not find matching constructor for: java.util.List(java.util.LinkedHashMap)
app:7632021-02-25 04:39:28.099 pm infoDebug logs disabled.
app:7632021-02-25 04:39:28.026 pm warnNOAA Weather Alerts application state is reset.
app:7632021-02-25 04:39:27.550 pm warnThe API Weather.gov did not return a response. groovyx.net.http.HttpResponseException: Not Found

I removed my Lat/Lon from the URI and replaced it with our closest airport weather station.

When I checked that URI, it gave me this error:
"Parameter "severity" is invalid: This value does not match any of the valid values."

Removing &severity=Severe,Extreme from the URI gave me a valid response. Also, changing to &severity=severe,extreme (lowercase) gave a valid response:

https://api.weather.gov/alerts?point=39.415768%2C-77.378460&status=actual&message_type=alert,update&severity=severe,extreme

should be fixed now...sorry

Looks good, seems to be working!

For those of you who own a Lametric Time device, and have the driver installed, you can send weather alerts to it. Just select it as a PushOver device...


...and then customize the alert message to send the parameters needed by the Lametric...

Here's mine...

{"model":{"cycles": 3,"frames":[{"text":"NOAA Weather Alert >>>>>>>>>> Severity: {alertseverity} .......... Urgency: {alerturgency} .......... Certainty: {alertcertainty} .......... Weather Alert for the following counties: {alertarea} .......... {alertheadline} .......... {alertdescription} .......... {alertinstruction} ...........................","icon":8644}],"sound": {"category":"notifications","id":"letter_email"}},"priority":"warning"}

Thanks for working on this great app!

(Hopefully?) quick feature request:

Is it possible to have the TTS notification volume set a specific volume, but return to whatever volume it was before after the alert? I have GH devices in a couple of rooms, but their volumes are all different due to room size, placement, etc.