OpenWeatherMap-Alerts-Weather-Driver

This is understandable, if the returned data would be overwhelming. Just to make sure I'm not missing something, but there's no 'night' 'morning' etc forecast data, right? Where I live, I can definitely use the daily low and that's definitely at night, but there's no way to know if the low is early this morning, or late this night. Anyhow, I know it's first-world-problem stuff.

I just looked and it does look like OWM has made some changes to their 'One Call' API. I am not sure if this is a change, or one that I just never incorporated before, but they do offer in their 'Daily' stats the following:

  • daily.temp.morn Morning temperature.
  • daily.temp.day Day temperature.
  • daily.temp.eve Evening temperature.
  • daily.temp.night Night temperature.
  • daily.temp.min Min daily temperature.
  • daily.temp.max Max daily temperature.

Right now I am only using the min and max, but I could pull in the other elements if desired. I did not see a definition on how they define those time periods ('Morning', 'Day', 'Evening', Night')

I also saw where they have added Weather Alerts to the One Call API:
alerts Government weather alerts data from major national weather warning systems

  • alerts.sender_name Name of the alert source
  • alerts.event Alert event name
  • alerts.start Date and time of the start of the alert, Unix, UTC
  • alerts.end Date and time of the end of the alert, Unix, UTC
  • alerts.description Description of the alert

I will look at that data and see if it can replace the current NWS (Weather.gov) alerting that this driver uses.

2 Likes

That would be awesome! Yeah I saw the alerts, and wasn't sure how that overlapped with the NWS stuff you guys had integrated.

I just polled the OWM data to see if the weather alerts were there. The results were not good. At least for my location, there was no indication of an alert in the return JSON, and the NWS API does show a current alert for my location.

I will monitor this to see if they do implement it as a free option in their 'One Call' API. I did see where they are now offering a ' Global Weather Alerts Push notifications' service (for $125/mo.) In that service it does appear they source the alerts from many different countries (details here). If they ever do implement a usable weather alert into their One Call API, I will pull that into this driver.

[UPDATED]
v0.2.7
10/19/2020

Changes:
Added forecast 'Morn', 'Day', 'Eve' and 'Night' temperatures for current day and tomorrow.
image

You must have the Optional Attribute of 'Forecast High/Low Temperatures' selected for these to show up.
image

3 Likes

[UPDATED]
v0.2.8
10/20/2020

Changes:

  • Now pulls weather alerts from OpenWeatherMap instead of weather.gov.
  • Various cleanups and bug fixes (from @nh.schottfam, Thanks!)

OpenWeatherMap now provides " Government weather alerts data from major national weather warning systems" This driver now uses that as the source for all weather alerts. This means that alerts are no longer exclusive the the United States. For the list of all sources that OWM claims is uses look here.

At this time only the first alert is shown, even if there are multiple alerts. I will look into displaying more than one alert if those exist in a future release.

Additional attributes available include:
alertDescr = The first 1,024 characters of the detailed alert description.
alertSender = The source of the alert.

3 Likes

[UPDATED]
v0.2.9
10/20/2020

Changes:
Corrected some Tile displays

Clicking the alert link for details brings up a map with the local temperatures in C. Please change the link back to the NWS link where the alerts could be viewed in detail, or an OWS link with the alert details.

1 Like

Very nice feature, thanks for adding this for the rest of the world so we can have alerts also.

1 Like

OWS does have a page with the forecast and any alerts. However, it uses a numerical city code that is not included with the returned API data.

Example for a city near me
https://openweathermap.org/city/5101405

That is one of the issues I noticed too. However because the alerts are now sourced globally from OWM, it does not make sense to provide the URL in the alert to weather.gov that is exclusive to the United States. In the old DarkSky alert poll they actually provided the URL to ther alert details (if available) in the JSON return. I am hoping that OWM will continue to mature and add that feature.

I did look for a short time to see if there was a better OWM URL that I could programatically point to that would show the alert details, and perhaps the user's preferred metric (imperial or metric), but I did not find that. I will continue to look for a a better URL to use. If you know what it is, please share.

Thanks.

What we would need is a way to get to that page by using the lat/lon coordinates. I'll look further into this and see if I can find a way to get there.

Thanks.

I think this may work? When I type in just https://openweathermap.org/city/ into a fresh browser (cache cleared) it prompts me to allow location to be used on that site, If I allow it, it comes up with my local city details and I can see the current alert listed, which as you showed will open a dialog box with expanded details on the alert. There is also a selector in the header of the page to choose Imperial or Metric.

Good find. I'll change the URL on the alerts to this in the next update.

Thanks.

1 Like

[UPDATED]
v0.3.0
10/21/2020

Changes:
Updated URLs in the dashboard tile hyperlinks to take you to a OWM location specific page for details, including any weather alerts. (Thanks @arnb)

1 Like

[UPDATED]
v0.3.1
10/21/2020

Changes:

  • Updated URLs in the dashboard tile hyperlinks to take you to a OWM location specific page for details, including any weather alerts. This update attempts to use the specific city code found by the latitude/longitude coordinates. If no city code is found (or returned) then it will use the generic site URL which will use your geolocation (if available in your browser), or , you can input your city to search. (Thanks @arnb)
  • Various code optimizations and bug fixes (Thanks @nh.schottfam)
1 Like

Heck yeah, the morn/night thing is going to be nice. I found that was already in the WebCore stuff as well, but I love having it as an actual device that can be used in other automations.

Thanks!!

Thank-you, Thank-you, Thank-you. I had been using Darksky for sometime, and was not even aware there was an upcoming end date, till I few days ago. For me, this driver does everything I could want, especially now that I will receive Weather Alerts (I live in Canada).

Just made a rule for the LED's on my Inovelli switches to Pulse Red when there is a weather alert for my city. Awesome.

Thank you! This works really well. Just received a "Special Weather Statement", clicked on the link and it took me directly to the town page with the link button for the full alert text.

Please help me understand why the app is using a "tinyurl" on the link(s).

link went to wrong location. i am in londonderry nh, usa,, map showed london england

I use tinyurl,com in dashboard tiles if it will reduce the number of characters used in the tile. Tiles are limited to 1,024 characters and some of the hyperlink URLs can be quite long. Tinyurl.com allows me to save characters for other data/formatting in the tile.