OpenWeatherMap-Alerts-Weather-Driver

now it says the same error for severity.. dont think that is the issue. i think their site is ffd up

I would agree. I am not getting any errors for these? I'll continue to look at these and see if removing all of the optional parameters has an impact.

1 Like

you can message me directly with a link or the new code to try thanks

Installed the new update...saved device...saved preferences...and no change for me. Still saying that the weather alerts are not available. The Dark Sky driver still seems to be working correctly though.

I can help troubleshoot if you need it.

its not the parameters in my testing anytning after the lat long gives an error so i you put a comma after longtitude it complains point parameter is incorrect..

You will get that message if the weather.gov poll is not responding as expected ( it is not returning a status of 200 ('OK')) ..... an that is what appears to me happening. I'm not going to publish any more changes on this for now as it does appear to me to be weather.gov issue. If you want to you can go into the code and remove the optional parameters from the alert poll and see if that does anything. Change line 494 from:
ParamsAlerts = [ uri: 'https://api.weather.gov/alerts/active?status=actual&message_type=alert,update&point=' + altLat + ',' + altLon +'&urgency=unknown,future,expected,immediate&severity=unknown,moderate,severe,extreme', //&certainty=unknown,possible,likely,observed',
to
ParamsAlerts = [ uri: 'https://api.weather.gov/alerts/active?status=actual&message_type=alert,update&point=' + altLat + ',' + altLon,

If you do that please report back what happens. Thanks.

i did that.. that is what i commented on above.. it still doesnt work becuse there is a comma after that that specifies the json result type.. you get an error that point is invalid..
only way it works is normal url and nothing after the longitude latitude as i mentioned.

CURRENT STATUS OF ALERTS

There are issues with the weather.gov alert API. All seems to work as expected when there is an actual current alert. However, if there are no current alert, the API is not returning a valid response.

The expected response to a 'no current alerts' condition would be a valid response to the poll with a 'null' for the current alert ('event'). When that condition is detected the code responds with 'There are no current weather alerts'. However, because there is no valid response, the code responds to that condition with a response of 'Weather alerts are not available'.

This same code use to work, so something must have changed on the weather.gov API side. I have no workaround for now. Hopefully the weather.gov site will get corrected. If not, at least for now, valid alerts do appear to show correctly, but 'Weather alerts are not available' may mean either that the weather.gov site is down or busy so alerts are not available, or, that the site is available and there are no current alerts. I have no way to distinguish between the two conditions as it is now.

UPDATE: I sent a note to weather.gov ......

Their response was

"There is some maintenance that is going on this time. Your patience is
appreciated. No estimated time of return of service is known.

Again sorry for the issue."

You can always turn off alerts and alert tiles if that is objectionable.

[UPDATED]
V0.1.6
09/08/2020

Changes:

There is a known issue with the weather.gov API at this time. It does not return a vald response when there are no alerts, so the driver will return a 'Weather alerts are not available' when this condition exists. Their reponse was: "There is some maintenance that is going on this time. Your patience is
appreciated. No estimated time of return of service is known."

PLEASE NOTE : after any update of the driver code, even if you use Hubitat Package Manager, you should open the virtual device, click 'Save Device', then click 'Save Preferences'.

1 Like

[UPDATED]
v0.1.7
09/12/2020

Changes:
Significant code refactoring by @nh.schottfam (Thanks!). Goals where to:

  • remove database accesses from the weather driver, as these do cause a lot of memory and JVM (Java Virtual Machine) resources consumption on HE.
  • Removed a lot of string creation done by the JVM. This is avoiding the creation of so many string constants for comparison.
  • Fixed some issues in variable mis-spellings
  • Cleanup of dead code based on analysis by IntelliJ.

Redesigned the threedayfcstTile, inspired by @pmasl77.
image

Other than the threedayfcstTile there are no changes to features or functions.

There is a known issue with the weather.gov API at this time. It does not return a vald response when there are no alerts, so the driver will return a 'Weather alerts are not available' when this condition exists. Their reponse was: " There is some maintenance that is going on this time. Your patience is appreciated. No estimated time of return of service is known. "

PLEASE NOTE : after any update of the driver code, even if you use Hubitat Package Manager, you should open the virtual device, click 'Save Device', then click 'Save Preferences'.

3 Likes

Hello, Is there a way to enable three day forecasts without the graphics? I only need/want the data and the graphic running off the side of the screen:

The short answer is 'no'. The tiles are not intended to be viewed in the Current States list, they are intended to be presented in a dashboard tile. If you only want to view the data in the Current States list then I would recommend you look at the individual attributes instead of the tiles. You may need to turn on some of those optional attributes for them to show in the Current States list.

As with any driver you can customize it to your liking ... you could go into the coding and remove the graphics from the tiles, but this is not something I will do for the published driver. You would have to repeat this anytime there is a driver update.

Remember that if you do turn off any attributes, like the threedayfsctTile, it will continue to show in the Current States list, but will not update. The only way to remove items from the Current States list is to remove the virtual device and create a new one and only select the attributes you want to display in the Current States listing. This is a Hubitat Platform issue and is not specific to this driver.

Turning on
image
gave me one day forecast temps, which is good enough for now.

This is REALLY helpful. I would have been banging my head against the wall wondering why the graphics weren't removed from the Current States listing. Is there a list of platform known issues somewhere?

[UPDATED]
v0.1.8
09/14/2020

Changes:
Re-worked how the api.weather.gov poll works to remove dependency on it returning a valid response code. It will now report 'No current weather alerts' if there are no alerts returned in the poll, even without a valid response code of 200 (OK).

UPDATED again at 5:00 PM EDT for a minor parentheses correction (thanks @nh.schottfam). That should not cause any errors, but it may change the logic. I did NOT increment the version. If you pulled the code prior to 5:00 EDT on 9/14/2020 you should pull it again.

2 Likes

I have RM set to speak the alert when OWM setting 'alert' changes, and speak "Weather alerts canceled" when "No current weather alerts" is set. So after installing 1.8 I was surprised when my system spoke "Weather alerts are not available" then spoke "Weather alerts canceled".

Looking in the code at line 530 provided the answer. Is this correct?

	myUpdData('alert', 'Weather alerts are not available')
	myUpdData('alertTileLink', '<a href="https://forecast.weather.gov/MapClick.php?lat=' + altLat + '&lon=' + altLon + '" target=\"_blank\">Weather alerts are not available.</a>')

The code will still return 'Weather alerts are not available' if the poll fails (the JSON return is null). The change made was when: 1) the poll does not fail, and 2) the JSON return is not null and 3) the JSON return does not contain an alert. When those conditions exist the message will be 'There are no current weather alerts.'

Hope that helps.

I don't grok this change, but yes the end result is 'There are no current weather alerts'. I will adjust my RM logic to stop the extraneous spoken messages.

But, don't you feel good knowing it's all working? :stuck_out_tongue:

(kinda like those twice every Wednesday times my weather radio explodes into a panic--of course, during work meetings the first time) :smiley:

Now that I fixed my RM, it's all good.

1 Like

I actually had done the same thing to prevent getting notices when the API website was down. :smiley:

1 Like