OpenWeatherMap-Alerts-Weather-Driver

OpenWeatherMap-Alerts Weather Driver

UPDATE - 12/01/2020: You now can choose either OWM or weather.gov as the source for Weather Alerts. weather.gov only provides alerts for the United States while OWM provides global weather alerts (see link below).

UPDATE - 10/20/2020: OpenWeatherMap now provides global weather alerts. As of version V0.2.8 this driver uses OWM for all of it's data and no longer polls weather.gov (NWS) for weather alerts. This means that weather alerts are available from global sources as specified on OWM's documentation here, and alerts are no longer with limited to the United States only.

This driver is a morph of the DarkSky.net Weather Driver to use OpenWeatherMap.org and the National Weather Service (only for weather alerts).

This inital alpha release just attempts to recreate the same data as the previous driver it was created from. There are differences. Some of those are listed here:

DarkSky OpenWeatherMap Comments
Probability of Precipitation Precipitation volume OWM does not provide PoP, only volume.
Ozone ------ OWM does not provide Ozone
Moon Phase ------ OWM does not provide the Moon Phase
Nearest Storm metrics ------ OWM does not provide nearest storm metrics
Weather Alerts ------ OWM does not provide Weather Alerts

Even though OWM does provide Weather Alerts, this driver pulls that in from the National Weather Service (weather.gov). The weather alerts are only available for the US.

19 Likes

Thanks, now with Darksky in the hands of the devil and new users can't register for the API anymore, this will keep our automatons working the same way they did with the original driver!

Nice work, will report if I get into any bugs!

1 Like

@Matthew, I think you should have “the Weather guy” appended to your user name because of your awesome dedication to the service.
I’ll certainly be checking it out.
Thx :clap:t3::pray:

1 Like

Just loaded this up and it's already pulling in almost everything perfectly.

"Weathericons" seems the only thing returning weird data and I'm unlikely to need it, so it's sweet !

Thanks. I'll look at that. Some of the other dashboards look for 'weatherIcons' and they need to be specific values. I'll probably have to map those to the condition codes.

1 Like

@Matthew
How often does the illuminate value update? Will it update with the interval setup on the "External Source Poll Interval" setting or will it update even more regularly?

This is working well for me. I have to admit, I was confused seeing forecastHigh and forecastLow values following temperature as it dropped tonight. I wrongly assumed they were the forecasted min/max temps for the day. :crazy_face:

Thank you for this driver!

[UPDATED] (and so it begins .....)
V0.0.2
04/17/2020

Changes:

  • I finally got an alert so I updated the code to properly show that in the MyTile, AlertTile and weatherSummary.
  • Capitalized the condition_code displayed.
2 Likes

The NWS alerts and all OpenWeatherMap data will be polled at the same frequency you set for "External Source Poll Interval".

The only nuance on illumination/Lux is it updates the calculation and checks every five minutes to see if it is time to change the polling update frequency between 'Daytime' and 'Nighttime'. No polling in done during this update and check so weather variables used like cloud cover and condition code are not updated in this process. It does the calculation because Lux is dependent on the time of day (% of day from twilight ends to Noon and Noon to twilight begins; the closer to Noon, the higher the Lux returned).

1 Like

That seems odd to me too. The data available is:

  • daily.temp
    • daily.temp.morn Morning temperature. Unit Default: Kelvin, Metric: Celsius, Imperial: Fahrenheit.
    • daily.temp.day Day temperature. Unit Default: Kelvin, Metric: Celsius, Imperial: Fahrenheit.
    • daily.temp.eve Evening temperature. Unit Default: Kelvin, Metric: Celsius, Imperial: Fahrenheit.
    • daily.temp.night Night temperature. Unit Default: Kelvin, Metric: Celsius, Imperial: Fahrenheit.
    • daily.temp.min Min daily temperature. Unit Default: Kelvin, Metric: Celsius, Imperial: Fahrenheit.
    • daily.temp.max Max daily temperature. Unit Default: Kelvin, Metric: Celsius, Imperial: Fahrenheit.

The only thing that may make sense is to do a calculation of the min(morn, day, eve, night) for the forecast minimum and a max(morn, day, eve, night) for the forecast maximum. I'll look at those results tomorrow and see if that may be worth pursing.

1 Like

I am attempting to get weather data into Hubitat for the first time - as opposed to converting to your driver from something else. A couple questions:

  1. what do I type in the preference box "Type OpenWeatherMap.org API Key Here *"?
  2. how do I get a display like njanda showed above?

Once you sign up for a free account at Members, you will be issued an API Key that you will paste in that box. Then you can go through the preferences and select which attributes you would like the device to display. Press save preferences, and those attributes will populate once data is returned.

1 Like

So, this is different. Around midnight, the forecastHigh and forecastLow updated to realistic values and now update every three to four hours, as one would expect for a daily forecast.

At this point, I wouldn't waste any time on this as it may have sorted itself out. I'll keep watching it.

Thank you

1 Like

Could you create a version to work with met office?
https://metoffice.apiconnect.ibmcloud.com/metoffice/production/node/175

Happy to be a tester

@Matthew

Thanks this is working well so far, thanks for the time you putting in.

I probably could, but I will not. Please feel free to adapt the driver to that API on your own.

[UPDATED]
V0.0.3
04/18/2020

Changes:

  • More fixes on Alerts (hard to test this one so perfecting this may take a while).
  • Mapped traditional 'condition_code's to condition_code, weatherIcon(s) and forecastIcon for dashboards that use those.
  • Various bug fixes and formatting corrections.

Please let me know if see anything that is not working properly and I will attend to it as soon as I am able. Thanks.

1 Like

[UPDATED]
V0.0.4
04/18/2020

Changes:

  • Adjusted some icons selected by certain weather conditions.
  • Made all forecast icons appear as 'daytime', regardless of current time of day.
  • Code corrections, optimization and bug fixes by @nh.schottfam (Thank you!).
1 Like

[UPDATED]
V0.0.5
04/19/2020

Changes:

  • More code clean up and optimizations from @nh.schottfam (Thanks!)
  • Improved some logging messages when 'Extended Logging' is turned on.
1 Like

Thanks. It is working great now. I set up a separate dashboard to display all of the weather data that is provided through this one device.

1 Like