AdyRock / com.weatherunderground

Homey app for Weather Underground
GNU General Public License v3.0
3 stars 3 forks source link

Can't find station id or wrong api-key #8

Closed pjmpessers closed 4 years ago

pjmpessers commented 4 years ago

I saw that my PWS was only updating ones every 4 minutes. So i removed my device and edited a new one on wunderground. I tried to change the station id from station id ITILBU34 to ITILBU42 but i got HTTPS error 404, not found. So i removed the pws device and try to install ir again on homey. Gave it the right station id ITILBU42 and the api key. But i only get :"Can't find the station-id location or wrong api-key can't be found."

I got this when i tryed to connect.

https://api.weather.com/v3/location/search?query=ITILBU42&locationType=pws&language=en-US&format=json&apiKey=*****

Can you help me?

AdyRock commented 4 years ago

Did you create a new API key in WU for the ITILBU42 and enter that with the new station ID?

pjmpessers commented 4 years ago

Yes. I did. Same problem. But with this api key and also the other one i can connect with other PWS. So the api key works.

pjmpessers commented 4 years ago

The problem still excist. But i noticed something. They changed something in WU. When i look at the logging when i try to connect to my PWS i see that the adress is

"https://api.weather.com/v3/location/search?query=ITILBU42&locationType=pws&language=en-US&format=json&apiKey=***".

And as you can see in the adress it is version 3. When i place this adress in a webbrowser the message is:

{"errors":[{"error":{"code":"LOCATION-SERVICES:404","message":"The resource requested could not be located. Please verify the URL and try again later."}}]}

Now i connect to another PWS and with this the readout is fine and data is comming in. In the logging i see

https://api.weather.com/v2/pws/observations/current?numericPrecision=decimal&stationId=ITILBURG76&format=json&units=m&apiKey=****

As you can see this is version V2 what WU is using. Now i tryed something. I change the URL and as you can see i placed my PWS. So it looked like:

https://api.weather.com/v2/pws/observations/current?numericPrecision=decimal&stationId=ITILBU42&format=json&units=m&apiKey=*****

And wow. This worked. I got:

{"observations":[{"stationID":"ITILBU42","obsTimeUtc":"2020-05-11T08:08:48Z","obsTimeLocal":"2020-05-11 10:08:48","neighborhood":"Tilburg","softwareType":"EasyWeatherV1.4.9","country":"NL","solarRadiation":613.8,"lon":5.087,"realtimeFrequency":null,"epoch":1589184528,"lat":51.548,"uv":5.0,"winddir":59,"humidity":43.0,"qcStatus":1,"metric":{"temp":10.3,"heatIndex":10.3,"dewpt":-1.7,"windChill":10.3,"windSpeed":8.7,"windGust":13.0,"pressure":1004.44,"precipRate":0.00,"precipTotal":0.30,"elev":16.5}}]}

So WU did something, Maybe a better security/firewall. But i think that everybody that gone install a new PWS on WU and are gone use your great app will be effected.

Have a safe day.

AdyRock commented 4 years ago

What you mention in the other topic about V3 and V2:

https://docs.google.com/document/d/1KGb8bTVYRsNgljnNH67AMhckY8AQT2FVwZ9urj8SWBs/edit https://docs.google.com/document/d/1xSpijI9MgWWfHaFX4wo_tB0GjtNeHZqGyp3XVOaAPl4/edit

So the URL's are correct. I also confirmed that using V2 in the discovery does fail for me and V3 works (when using my station ID and API key).

If I use your station ID ITILBU34 then it also works but your station ID ITILBU42 fails. The search alos fails on the WU site as well so it is like that ID has not reached the database yet. When did you add the station to WU?

pjmpessers commented 4 years ago

I added this PWS about 8 hours ago.

pjmpessers commented 4 years ago

Station ID ITILBU34 is still there. But as you can see it is offline. I removed it and can't get it back goes i lost the PWS key

pjmpessers commented 4 years ago

The ITILBU34 on WU indeed got no data anymore. But ITILBU42 does.

Verzonden vanuit Mailhttps://go.microsoft.com/fwlink/?LinkId=550986 voor Windows 10

Van: AdyRockmailto:notifications@github.com Verzonden: maandag 11 mei 2020 11:01 Aan: AdyRock/com.weatherundergroundmailto:com.weatherunderground@noreply.github.com CC: Pietermailto:pieterpessers@hotmail.com; Authormailto:author@noreply.github.com Onderwerp: Re: [AdyRock/com.weatherunderground] Can't find station id or wrong api-key (#8)

What you mention in the other topic about V3 and V2:

https://docs.google.com/document/d/1KGb8bTVYRsNgljnNH67AMhckY8AQT2FVwZ9urj8SWBs/edit https://docs.google.com/document/d/1xSpijI9MgWWfHaFX4wo_tB0GjtNeHZqGyp3XVOaAPl4/edit

So the URL's are correct. I also confirmed that using V2 in the discovery does fail for me and V3 works (when using my station ID and API key).

If I use your station ID ITILBU34 then it also works but your station ID ITILBU42 fails. The search alos fails on the WU site as well so it is like that ID has not reached the database yet. When did you add the station to WU?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/AdyRock/com.weatherunderground/issues/8#issuecomment-626570908, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AIHBC5GCC3STXGTVXLAIXC3RQ65FDANCNFSM4M5QFNFQ.

AdyRock commented 4 years ago

The problem is, the app needs the Place ID which is fetched by calling the location search URL but at the moment that is failing because it appears it has not been added to the database yet. I don't know how long it normally takes so I can't say if 8 hours is too long or not. All I can suggest is to keep trying to give it 24 hours. As you say, it does return data, so it is registered.

pjmpessers commented 4 years ago

Thank you, Ady.

With my first setup of the PWS and your app it went rather smooth. But somehow now i see other problems. But maybe your right. I will just wait and let you now if it was improved and problem is gone in a day. 😉

Verzonden vanuit Mailhttps://go.microsoft.com/fwlink/?LinkId=550986 voor Windows 10

Van: AdyRockmailto:notifications@github.com Verzonden: maandag 11 mei 2020 11:17 Aan: AdyRock/com.weatherundergroundmailto:com.weatherunderground@noreply.github.com CC: Pietermailto:pieterpessers@hotmail.com; Authormailto:author@noreply.github.com Onderwerp: Re: [AdyRock/com.weatherunderground] Can't find station id or wrong api-key (#8)

The problem is, the app needs the Place ID which is fetched by calling the location search URL but at the moment that is failing because it appears it has not been added to the database yet. I don't know how long it normally takes so I can't say if 8 hours is too long or not. All I can suggest is to keep trying to give it 24 hours. As you say, it does return data, so it is registered.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/AdyRock/com.weatherunderground/issues/8#issuecomment-626579969, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AIHBC5FDSZUY7CAYNRYNLVLRQ67CLANCNFSM4M5QFNFQ.

AdyRock commented 4 years ago

I guess you could keep trying the search in WU: image As you can see from the picture it only goes up to 40 at the moment.

pjmpessers commented 4 years ago

Your right. This one is also mine. Like i said. I made a big mess. I will wait if it comes back up. Thanks Ady.

Verzonden vanuit Mailhttps://go.microsoft.com/fwlink/?LinkId=550986 voor Windows 10

Van: AdyRockmailto:notifications@github.com Verzonden: maandag 11 mei 2020 11:38 Aan: AdyRock/com.weatherundergroundmailto:com.weatherunderground@noreply.github.com CC: Pietermailto:pieterpessers@hotmail.com; Authormailto:author@noreply.github.com Onderwerp: Re: [AdyRock/com.weatherunderground] Can't find station id or wrong api-key (#8)

I guess you could keep trying the search in WU: [image]https://user-images.githubusercontent.com/38184396/81547233-7b74dd80-9373-11ea-806b-6ad53b588985.png As you can see from the picture it only goes up to 40 at the moment.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/AdyRock/com.weatherunderground/issues/8#issuecomment-626591525, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AIHBC5DOJ7ROTIN2XIDP3E3RQ7BS3ANCNFSM4M5QFNFQ.

pjmpessers commented 4 years ago

I found out the problem. In WU home & favorites i changed by "Manage your home location" "autodetect my location" to "select home location". After setting it back everything is okay again.

Can be closed.

pjmpessers commented 4 years ago

Sorry to bother you with a issue that i created myself. All is working fine again. There was never a problem at WU site or with your APP. I close this issue. Thanks again.