OpenWeatherMap-Alerts-Weather-Driver

[UPDATED V0.6.2 08/23/2022]

  • Added user selection of 2.5 or 3.5 OWM API Key

  • Moved Schedule Change log notice to Extended Logging.

image

If you have a legacy OWM 2.5 API Key the new API Key Version must be OFF (Default). If you have a new OWM 3.0 API Key the API Key Version must be ON.

If using HPM do an Update or a repair. Otherwise open the driver code and re-import the code. Thanks.

3 Likes

Feature Request :
Matthew - I would like to request an additional attribute - humiditySf - (name can be whatever!)...
You provide illuminance for a raw value and Illuminated for a value with a suffix (lx). The humidity attribute comes without a suffix variation. For my dashboard tiles it would be awesome not to have to manually add... for now I'm doing it manually:
image
Also - more of a question really, for pressure you provide a list of measurement choices - but 'pressured' attribute isn't showing - was that the intent?

1 Like

Multiple people have commented that I should remove Illuminated as it is redundant to the raw value and anyone can add the suffix if they so desire. I have left it as it has been there for a long time and removing it might break what someone is doing with that attribute. I do not plan on adding a similar setup for Humidity (or any other attribute).

'pressured' is(was?) an attribute required by some older dashboards (SharpTools.io and/or SmartTiles?) It only existed for those that wanted that attribute to populate tiles in those dashboards. Again, It has been there for a long time and removing it might break what someone is doing with that attribute.

Thanks for the update.
Just after switching to 3.0 or 2.5 of the API endpoints I was still getting "WARNING: 401:Unauthorized" errors.

After some investigation it looks like the /onecall API endpoint is only available on a subscription plan.

It would be nice to inform new users of this Driver that its dependent on a paid service.


https://openweathermap.org/api/one-call-3

1 Like

This was posted in the Weather-Display version of this driver (required a PWS and Weather-Display software, but the OWM poll is the same).

I don't know that there are any advantages of the 3.0 key versus the 2.5 key. The 2.5 key is no longer obtainable, so new users can only get a 3.0 key. In order to get a 3.0 key they must put in a payment method that will be charged should they exceed the 1,000 calls per day 'free' limit. As far as I have been able to determine the functionality is identical. A 2.5 key will only work on the 2.5 API endpoint. It will not work on the 3.0 API endpoint. A 3.0 key will only work on the 3.0 API endpoint. It will not work on the 2.5 API endpoint.

That is disappointing. Is there any free alternative for anyone (new) just looking to get some forecast data of today? I don't want to enter payment methods like credit card details.

I'm just looking for getting the temperature of today's noon/afternoon, to determine each morning whether I should let all blinds down on time, to keep the house cool.

Hello all,

I am new to this and I am having API issues. I know I have a good API key because I am able to plug it into other websites and get values returned. Any help would be appreciated. I tried both the 2.5 and 3.0 API settings on the driver.

dev:62022-08-31 11:37:17.370 am warnOpenWeatherMap.org Weather Driver - WARNING:  401:Unauthorized
dev:62022-08-31 11:37:17.368 am warnOpenWeatherMap.org Weather Driver - WARNING:  Calling https://api.openweathermap.org/data/2.5/onecall?lat=39.833330&lon=-98.585522&exclude=minutely,hourly&mode=json&units=imperial&appid=[API]
dev:62022-08-31 11:37:17.366 am infoOpenWeatherMap.org Weather Driver - INFO:  Polling OpenWeatherMap.org
dev:62022-08-31 11:37:17.066 am infoOpenWeatherMap.org Weather Driver - INFO:  Poll OpenWeatherMap.org: [uri:https://api.openweathermap.org/data/2.5/onecall?lat=39.833330&
dev:62022-08-31 12:06:34.500 pm warnOpenWeatherMap.org Weather Driver - WARNING:  401:Unauthorized
dev:62022-08-31 12:06:34.498 pm warnOpenWeatherMap.org Weather Driver - WARNING:  Calling https://api.openweathermap.org/data/3.0/onecall?lat=39.833330&lon=-98.585522&exclude=minutely,hourly&mode=json&units=imperial&appid=[API]
dev:62022-08-31 12:06:34.496 pm infoOpenWeatherMap.org Weather Driver - INFO:  Polling OpenWeatherMap.org
dev:62022-08-31 12:06:34.102 pm infoOpenWeatherMap.org Weather Driver - INFO:  Poll OpenWeatherMap.org: [uri:https://api.openweathermap.org/data/3.0/onecall?lat=39.833330&lon=-98.585522&exclude=minutely,hourly&mode=json&units=imperial&appid=[API], timeout:20]

Unauthorized. The OWM API is not accepting your API. I took the URL provide in your error logs and plugged in my API and it returned data, so a valid API does work. Make sure your API is an OWM OneCall API. I know they offer other API services, but this driver uses only the legacy OneCall 2.5 API or the current OneCall 3.0 API.

1 Like

I've been using your driver for a while, i stayed on an old version (because i edited it to remove the bottom banner/icon so the threedayfcstTile would fit on a 2x3 dashboard tile) -- i think i was on version 0.5.3, maybe 0.5.2--

So I just updated to 0.6.2 and the 'cloud' attribute is not behaving the same. I have RMs that compare cloud attribute, and they all show null in the rule and show ? in the edit conditions page.

I dont see anything interesting in the changelog-

Is there a different way to see how cloudy it is right now?

Do you have the optional attribute of "Cloud" turned on? (it will not update if it is not turned on).

2 Likes

oh, no-- didnt even realize. I had to first toggle Display All Optional Attributes and it came right up.

works, thanks!

1 Like

Thank you, Matt. It was the API. The API key would not work until I put my credit card info in (even though you get 1000 free calls per day).

1 Like

Referring to what Inquiring_Mind just realized above, I would like to ask again:

This driver will not help you. You would be better off asking that question in new thread. Thanks.

I've recently moved from Smarthing Webcore to Hubitat Webcore. Most everything has gone smoothly, but I'm deeply struggling with weather. I registered for API key ith OpenWeatherMap. I've added that key within the settings of Hubitat Webcore. (I also haveWebcore Storage installed.) I also went to git hub and retrieved the OpenWeatherMap-Alerts-Weather-Driver and pasted that into Hubitat as a driver code. Then, I created a virtual device named Weather and assigned it to use the new driver above. I'm able to see all of the settings for this device...I entered API key again, setup all my preferences, and it pulled in all of the Current weather, so I thought all was well. However, none of the states have updated since even though I have the External Source Poll Interval set for hourly. To troublehoost, I have pressed the "Save Preference" button and "Save Device" button and rebooted my hub on three separate occasions. However, none of the weather stats being displayed are updated. What am I missing?

Turn on 'Extended Logging', hit 'Save Preferences', then do a poll. Any errors in the logs?

I've done that, and most of the items show "Info" but no "Errors". There were the following two "Warn":

[dev:65]2022-09-02 09:57:14.455 am [warn]OpenWeatherMap.org Weather Driver - WARNING: 401:Unauthorized

[dev:65]2022-09-02 09:57:14.451 am [warn]OpenWeatherMap.org Weather Driver - WARNING: Calling https://api.openweathermap.org/data/2.5/onecall?

This is your issue. OWM is not accepting your API Key as valid. Do you have a legacy OneCall 2.5 API Key, or do you have a recently acquired OneCall 3.0 API Key? You have the driver set to use the Legacy OneCall 2.5 API Key. If you have a recently acquired OneCall 3.0 API Key you need to change the setting in the driver to use the 3.0 API Key.
image

That was it! It seems to be working now. Thanks for your help with that. It defaulted to 2.5, and when I registered for the API, it wasn't clear to me which version I was registering for. Many thanks!

1 Like

Hi, I'm a bit new here. I'm moving from SmartThings to Hubitat so I have a lot of gaps. Did I set up my OpenWeatherMap-Alerts-Weather-Driver correctly?

This is what I did:

  1. Install the Driver using HPM
  2. Add a virtual device called Open Weather Map
  3. Add the virtual driver called OpenWeatherMap
  4. Registered and obtained a free key from Open Weather Map
  5. Put in my Key
  6. Competed all the remaining Preferences
  7. Save everything
  8. I waited about hour or so then pushed the refresh button

"Current States" appears as follows:

  • city : New Toronto
  • cloudiness : 100
  • country : CA
  • humidity : 87
  • pressure : 1018
  • temperature : 18
  • weather : overcast clouds
  • weatherIcons : 04d
  • windDirection : 133
  • windspeed : 0.89

Just wonder why I don't see "Feelslike"? or other attrubutes?