[Release] NOAA Weather Alerts

@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.

what driver are you using with GH for audio or speech? (I want to see what HE capabilities it claims to support).

HE under capability audioNotification has command 'playTextAndRestore', which is supposed to have the device to set the volume (if provided), and restore the volume if changed).

ES has that command and another private command that does the same thing.

So part of this the question is does GH support the audioNotification capability correctly?

@nh.schottfam any idea why I would I would be seeing this?
Thanks.

Either it is unreachable, or a request for events did not get any back.

Is it happening regularly, once in a while, after a Hub reboot?

Seeing it once not an issue (could be the events I mention several notes above). If all the time you want to check your network, and / or reboot. your HE hub (nicely settings -> reboot hub)

I am using the built-in 'Chromecast Audio' driver for both a Google Home and Google Home Mini (added to Hubitat through 'Chromecast Integration (beta)').