OpenWeatherMap http Response Status: 401 error Message: Unauthorized


#1

After many years with SmartThings, I’ve recently moved everything to Hubitat to keep using webCoRE.

The issue I’m asking about is related to the use of “Open Weather Map” and an error I’m getting while trying to populate $weather in webCoRE. I’m using the built-in Hubitat device driver for OWM. The device is being populated properly as far as I can tell. This is from the Weather device:

image

and this is from the Weather Device logs (I enabled debug logging on temporarily. There are no errors in the Weather Device logs:

and here’s a clip of my weather device page settings:

But the $weather variable doesn’t get populated and this error is found in webCoRE Storage logs:

I’m sure it’s something I’m doing wrong. Any ideas?


#2

In order to use OpenWeather with WebCore, you have to enable it within the WebCore app. The OpenWeather Device is a seperate entity.

Once you have the optional app installed, go to the webCore App, under Settings…there should now be an option to Enable $weather via external provider. Select OpenWeatherMap and input your key.


#3

yes

also see:

which points to:


#4

If you still have problems, PM me with more details.

Also you might remove your api key from the first image.


#5

Thank you for your response. I had already installed webCoRE Storage (I double-checked and my installed version matched the one you linked. Also, I had previously enabled $weather as shown here:


#6

Awesome, almost there…

That image is still referencing the OpenWeather Device…not the WebCore App

Go to your App list…Click on WebCore (or whatever you called your instance)…then Settings and you’ll find the option to enable that I was referencing above


#7

I apologize. I didn’t post this image in my original post, but I had set up the $weather variable in webCoRE too (the key shown is not my key):

image

When I go to the webCoRE Storage app and click on it and then click on dump weather structure, I get this:
image


#8

I’ve been following this, and have tried to setup myself. I’m confused that there seem to be 2 options.
You can setup an openweathermap device in HE, which I think is what the OP has done. This works in HE, and you can add it as a device to webcore & access its values.
I’m not sure about setting up openweathermap in webcore. I’ve done that, created the webcore weather device, but it shows no weather data in HE or a webcore piston. Is there a missing step?
Also, why do you need this, if the openweathermap device from HE can be used?
I don’t see the webcore storage app, so cant check the data in there, however HPM says its installed?


#9

Ah, your setup looks correct. I am assuming you are using the same Key for both the device and webCore? I’ve heard of people trying to use keys before openweather activates resulting in the Unauthroized errror, but that wouldnt make sense if it is working on the device.

@E_Sch any ideas?


#10

You are correct, you can use the device if you choose. The option built into webCore provides more data than the built-in driver. There is also a community maintained driver that expands on the stock driver data points and has the option of using weather.gov data. Ultimately it is your preference. The biggest downside to the built-in driver is lack of forecast data which both the community driver and webCore provide.
https://community.hubitat.com/t/openweathermap-alerts-weather-driver/38249?u=fieldsjm


#11

Yes, I AM using the same key for both the HE device and webCoRE.


#12

Are you using the openweathermap api 2.5 or 3.0?

Currently webcore is using 2.5…this really depends on when you created your key.


#13

Thanks, I wondered if it might be the case that webcore returned more data.
Just need to get it working now. It could be the api version for me, as I only created the key today. Also, is my webcore strange ok? I dont see it as an app, but HPM says its installed.


#14

we found in the original it was a incorrect api key

webcore uses onecall so get a key that works for onecall.


#15

Thanks to the assistance and guidance of @E_Sch, he was able to determine that my entire issue was that I needed to be signed up for OneCall - instead of the tier below it, and I was not aware of that. Once I signed up for OneCall 3.0, webCoRE’s $weather is working fine now.


#16

Can you confirm which subscription is required? I have the one all 3.0 (free) it works with the HE device, but webcore and the community weather driver dont return any data. On my account it says

|Weather|Current weather and forecast|Free plan|Hourly forecast: unavailable
Daily forecast: unavailable
Calls per minute: 60
3 hour forecast: 5 days|view|


#17

webcore uses onecall part of the api.

I think they grant 1000 free per day. Typically webcore is one 1 per 30 mins, so it would use 50 or so a day.


#18

I originally did the same as you. The one you need is the one above the one you currently have. As @E_Sch says, the first 1,000 calls/ day are free.

It’s this one:

It includes the functionality of the one you have too.


#19

Make a web request to the One CAll API and parse the data you need to variables until the community driver supports One Call 3.0. For most uses, OneCall 3.0 provides much more useful data.