OpenWeatherMap-Alerts-Weather-Driver

Sounds like you have devices / drivers confused. I don't see anything like your screen shot for the code in this thread.

1 Like

Your screen shot is from the Weather-Display version of the driver. If you do not have your own Persanal Weather Station (PWS) that is using Weather-Display software, you cannot use that version. I am guessing you installed the Weather Display version in error. If that is the case, you should uninstall that version and install the OpenWeatherMap-NWS-Alerts-Weather-Driver that does not requires a PWS.

1 Like

This is really slick! I've got it all set up, with tiles on dashboard, etc. Curious though, is there a way to specify a forecast for a certain time range? My goal would be to determine the high/low for each night (like 10pm-5am,) so that I can control my window actuators.

Basic logic will be, "if it's going to be cool enough tonight, leave the A/C off and open the windows BEFORE everyone goes to bed to prevent waking them up. Otherwise, close the windows and let the A/C run."

I can SORT of do this with forecastLow and forecastLow+1 but that's not precise enough. Something like tonightLOW and morningLOW+1 would be perfect for me.

OWM excludes the Hourly data, so not without modifying the app or creating an app for your specific requirements.

ParamsOWM = [ uri: 'https://api.openweathermap.org/data/2.5/onecall?lat=' + altLat + '&lon=' + altLon + '&exclude=minutely,hourly&mode=json&units=imperial&appid=' + apiKey ]

Should both the AC and Window Actuators be controllable with IR or RF, an app or RM could be created using the current outside and inside temperature and humidity as part of a dynamic algorithm controlling the AC and Actuators with a Broadlink IR / RF device or something similar.

There have been discussions about pulling in hourly data in the past, going back the DarkSky driver that this one was spawned from. I did a poll on the community to see if there was any interest in the hourly data and to give some scope of the amount of data that that would require the driver to parse. I don't remember the exact numbers (you can look in the old DarkSky thread if you are interested), but I believe it more than tripled the amount of data returned in the JSON file. The overwhelming response from the community was that they did not want to exchange that resource load requirement for the few bits of additional data that may have been useful. Nothing has changed along these line, so I will not be adding in an hourly data poll to the published driver. You could certainly alter the driver to do so if you wanted to.

Yeah, the windows are actuated, and are fully-controlled. I was asking about the nightly forecast so that I could build a better predictive model. I already do process inside-vs-outside, with a cut-off time before those criteria are met.

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