OpenWeatherMap-Alerts-Weather-Driver

I just loaded and configure the driver with the needed information. Note that I removed the API and truncated the lat/log value from the below screen grab.

The city entry in the Current States list of the driver does not show the correct city name for the Zip Code entered in the driver's preferences.

Capture

The 92086 zip code is that of Warner Spring, CA US and not Aguanga.

When I query the API with the same zip code I get the correct city and weather data.

http://api.openweathermap.org/data/2.5/weather?zip=92086,us&appid=xxxxxxxxxxxxxxxxxxxxxxx

{"coord":{"lon":-116.65,"lat":33.31},"weather":[{"id":800,"main":"Clear","description":"clear sky","icon":"01d"}],"base":"stations","main":{"temp":299.12,"feels_like":296.56,"temp_min":292.15,"temp_max":303.15,"pressure":1013,"humidity":22},"visibility":10000,"wind":{"speed":1.41,"deg":309},"clouds":{"all":1},"dt":1600269192,"sys":{"type":1,"id":4635,"country":"US","sunrise":1600263071,"sunset":1600307488},"timezone":-25200,"id":0,"name":"Warner Springs","cod":200}
Search...

Looking at the driver source I noticed that you use the one call api which does not return the city name.

Note that I've truncated the lat/log values and replace my API ID with a dummy value.

https://api.openweathermap.org/data/2.5/onecall?lat=33.xxxxxx&lon=-116.yyyyyyy&exclude=minutely,hourly&mode=json&units=imperial&appid=xxxxxxxxxxxxxxxxxxxxxxxx

{"lat":33.39,"lon":-116.69,"timezone":"America/Los_Angeles","timezone_offset":-25200,"current":{"dt":1600270602,"sunrise":1600263080,"sunset":1600307499,"temp":78.89,"feels_like":73,"pressure":1013,"humidity":14,"dew_point":26.44,"uvi":9.36,"clouds":1,"visibility":10000,"wind_speed":2.62,"wind_deg":286,"weather":[{"id":800,"main":"Clear","description":"clear sky","icon":"01d"}]},"daily":[{"dt":1600282800,"sunrise":1600263080,"sunset":1600307499,"temp":{"day":82.74,"min":60.46,"max":87.22,"night":61.43,"eve":85.46,"morn":60.46},"feels_like":{"day":75.33,"night":56.28,"eve":74.68,"morn":54.97},"pressure":1014,"humidity":13,"dew_point":27.54,"wind_speed":5.59,"wind_deg":249,"weather":[{"id":800,"main":"Clear","description":"clear sky","icon":"01d"}],"clouds":1,"pop":0,"uvi":9.36},{"dt":1600369200,"sunrise":1600349519,"sunset":1600393815,"temp":{"day":88.14,"min":60.6,"max":90.99,"night":64.4,"eve":87.4,"morn":61.03},"feels_like":{"day":79.77,"night":59.23,"eve":76.37,"morn":55.65},"pressure":1013,"humidity":11,"dew_point":16.09,"wind_speed":7.34,"wind_deg":216,"weather":[{"id":803,"main":"Clouds","description":"broken clouds","icon":"04d"}],"clouds":59,"pop":0,"uvi":9.11},{"dt":1600455600,"sunrise":1600435958,"sunset":1600480132,"temp":{"day":89.8,"min":63.95,"max":91.78,"night":64.67,"eve":87.19,"morn":63.95},"feels_like":{"day":80.31,"night":61.02,"eve":76.35,"morn":59.54},"pressure":1011,"humidity":12,"dew_point":28.42,"wind_speed":10.09,"wind_deg":218,"weather":[{"id":800,"main":"Clear","description":"clear sky","icon":"01d"}],"clouds":10,"pop":0,"uvi":8.99},{"dt":1600542000,"sunrise":1600522397,"sunset":1600566448,"temp":{"day":86.59,"min":62.11,"max":89.28,"night":62.11,"eve":84.85,"morn":62.38},"feels_like":{"day":78.48,"night":59.29,"eve":75.51,"morn":59.5},"pressure":1011,"humidity":14,"dew_point":33.49,"wind_speed":7.99,"wind_deg":239,"weather":[{"id":800,"main":"Clear","description":"clear sky","icon":"01d"}],"clouds":0,"pop":0,"uvi":9},{"dt":1600628400,"sunrise":1600608837,"sunset":1600652764,"temp":{"day":83.44,"min":58.6,"max":86.11,"night":60.03,"eve":81.32,"morn":58.6},"feels_like":{"day":78.53,"night":57.92,"eve":74.43,"morn":55.99},"pressure":1012,"humidity":21,"dew_point":40.19,"wind_speed":4.59,"wind_deg":226,"weather":[{"id":800,"main":"Clear","description":"clear sky","icon":"01d"}],"clouds":0,"pop":0,"uvi":8.84},{"dt":1600714800,"sunrise":1600695276,"sunset":1600739081,"temp":{"day":81.41,"min":58.1,"max":84.61,"night":58.28,"eve":79.23,"morn":58.1},"feels_like":{"day":75.83,"night":54.9,"eve":72.37,"morn":55.81},"pressure":1012,"humidity":23,"dew_point":40.78,"wind_speed":5.97,"wind_deg":238,"weather":[{"id":800,"main":"Clear","description":"clear sky","icon":"01d"}],"clouds":0,"pop":0,"uvi":8.26},{"dt":1600801200,"sunrise":1600781716,"sunset":1600825397,"temp":{"day":78.37,"min":55.38,"max":81.57,"night":55.38,"eve":76.89,"morn":55.72},"feels_like":{"day":71.76,"night":51.55,"eve":68.9,"morn":51.87},"pressure":1014,"humidity":22,"dew_point":36.45,"wind_speed":6.62,"wind_deg":253,"weather":[{"id":800,"main":"Clear","description":"clear sky","icon":"01d"}],"clouds":0,"pop":0,"uvi":8.62},{"dt":1600887600,"sunrise":1600868156,"sunset":1600911714,"temp":{"day":79.52,"min":52.88,"max":83.48,"night":57,"eve":78.53,"morn":52.88},"feels_like":{"day":72.79,"night":54.18,"eve":70.9,"morn":48.63},"pressure":1016,"humidity":19,"dew_point":34.84,"wind_speed":6.04,"wind_deg":260,"weather":[{"id":800,"main":"Clear","description":"clear sky","icon":"01d"}],"clouds":0,"pop":0,"uvi":8.45}]}

I'm curious as to how you get the city name that is displayed in the driver pane.

Thanks

Eric

Forgot one of the screen grabs.

With the current version, it can be keyed in. Your Preferences screen shot does not agree with what I am seeing. The current version is 0.1.8

image

As @arnb, suggested, you are not using the driver from this thread. I believe you may be using the Hubitat integrated OpenWeatherMap driver? Either download the code from this first post in this thread, or use HPM to install the driver.

[UPDATED]
v0.1.9
09/16/2020

Changes:
Removing 'severity' and 'certainty' restrictions from alerts poll. This was excluding some 'minor' and 'unlikely' alerts. Now the only alerts that are excluded are 'past' alerts.

I have just installed this driver, and obtained my API key. It's great thank you! There is however something I need as data for my app, which is either Tomorrow mininum temperature forecast, or the hourly temperature forecast for the next 12 hours. Am I right in saying this driver would not offer those data in a program-readable form?

You are correct. Those are presented in the threedayfcstTile, but they are not a available as independent attributes. I'll add that enhancement to the list for a future update.

2 Likes

[UPDATED]
v0.2.0
09/21/2020

Changes:
Added forecast High/Low temp attributes for tomorrow (forecastHigh+1/forecastLow+1) and day-after-tomorrow (forecastHigh+2/forecastLow+2)

image

2 Likes

Wow that's what I call responsive development :smiley: Thank you, I will try it out tomorrow and give feedback.

Yep, working fine with my app, thank you very much :slight_smile:

1 Like

What is the process to update this driver?

Do I just Import the latest code using the link at the top of the comments and Save over the top of the existing driver? Do I then need to delete and recreate my 'Weather' virtual device?

Thx

Copy the latest code over the old code (replace it), and save the driver. It may not be necessary, but I always open the virtual driver and click 'Save', then 'Save preferences' just to make sure the new code is being used and the settings/schedules are reset to you preferences. There is no need to delete the old virtual driver and replace it unless you want reduce the number of de-selected optional attributes reported in Current States. From the driver notes ....

ATTRIBUTES CAUTION
The way the 'optional' attributes work:

  • Initially, only the optional attributes selected will show under 'Current States' and will be available in dashboards.
  • Once an attribute has been selected it too will show under 'Current States' and be available in dashboard. <*** HOWEVER ***> If you ever de-select the optional attribute, it will still show under 'Current States' and will still show as an attribute for dashboards BUT IT'S DATA WILL NO LONGER BE REFRESHED WITH DATA POLLS. This means what is shown on the 'Current States' and dashboard tiles for de-selected attributes may not be current valid data.
  • To my knowledge, the only way to remove the de-selected attribute from 'Current States' and not show it as available in the dashboard is to delete the virtual device and create a new one AND DO NOT SELECT the attribute you do not want to show.

Hi - I was just looking at this for my Android dashboard and was wondering if you could also break out the icon URL's as well? I see them in the threedayfcstTile but not anywhere else. My hope was to display something like this in a tile.. the forecastHigh+X values are perfect - just was hoping to get the icons too if possible.
image

Already there .... it is an Optional Attribute, just turn it on.
image

I noticed that - but was looking for a condition_icon_url+1 and condition_icon_url+2 if that makes sense.. to match the forecastHigh+1/forecastLow+1 fields that were added. Unless I'm missing it all I see is:

"condition_icon_url" : "https://tinyurl.com/y6xrbhpf/32.png"

Ahhhh. Those are not there. I'll add them in the next release.

1 Like

sorry, 1 more question (an easy one!) -- which of the optional attributes results in adding the weather state?

I'm using that weather attribute in my app to detect the built-in Hubitat weather device.. so I don't have to look for the device name = "weather" or something like that. I can look for another unique attribute but I know I saw 'weather' in there when I checked a whole bunch of optional attributes.. now, I can't figure out which one added it :slight_smile:

(update: here's what I'm talking about.. I use the MakerAPI to get back attributes for a given device. The weather one below isn't sent by default so I'm assuming it's one of the optional settings.

...
        "temperature" : "70",
        "weather" : "Clear sky",
        "humidity" : "48",

Also, FWIW - when I uncheck all optional attributes the Hub still displays all of the ones that it had before. I think that's expected (reading above posts) -- but, is there a way to clear them all out?

I did delete and re-add the device once.. if that's the only way to start over I can do it but wondering if another way existed

There is a 'weather' attribute/tile that is built into Hubitat.
image
It will work with my driver, but it is not part if my driver. If you want to use this turn on the optional attribute:
image

My driver has several pre-built tiles for dashboards:

myTile:
image

threedayfcstTile:
image

alertTile:
image

weatherSummary:
image

These tiles also have optional attributes that will need to be turned.

Hope that helps.

yep, that's what I was looking for -- the "Hubitat and OpenWeatherMap" one!

EDIT: Actually, it's the "Dash - SmartTiles" option that returns weather for me
image


The threedayfcstTile data is what I'm ultimately looking for - but I'm working on a native Android app and want to make all of the tiles native UI widgets (not using the default Hubitat dashboard - so I can't use the css/html code).

thanks!

[UPDATED]
v0.2.1
09/22/2020

Changes:
Added forecast icon url attributes for tomorrow (condition_icon_url1) and day-after-tomorrow (condition_icon_url2).

1 Like