r-renato / ha-climacell-weather

Climacell weather provider integration is a custom component for Home Assistant. The climacell platform uses the Climacell API as a source for meteorological data for your location.
MIT License
46 stars 10 forks source link

Error 403 from Climacell API #31

Open bangcrash opened 3 years ago

bangcrash commented 3 years ago

I have created a Climacell account this morning and then set up the HA component. At the moment it is only configured with a single monitored condition of cloud_cover. My YAML is:

When I restart HA I get the following error in the logs:

`Logger: custom_components.climacell Source: custom_components/climacell/init.py:93 Integration: Climacell weather (documentation) First occurred: 15:49:51 (2 occurrences) Last logged: 16:09:53

ClimacellRealtimeDataProvider._retrieve_data error status_code 403`

and then when the sensor tries to update I get:

`Logger: custom_components.climacell.sensor Source: custom_components/climacell/sensor.py:399 Integration: Climacell weather (documentation) First occurred: 15:49:51 (5 occurrences) Last logged: 16:09:53

RealtimeSensor.update - Provider has no data for: cc climacell Cloud Cover`

On the Climacell account page it says that the API key is active and I have double and triple checked that it has been entered into my secrets.yaml file correctly with no spaces etc.

image

I know that the 403 error would normally suggest permission problems but I can't see a reason why I would be getting access denied based on everything that I have listed above.

Any ideas why this might be happening?

eboettn commented 3 years ago

I'm having the EXACT same issue, with the exact same error.

bangcrash commented 3 years ago

I have managed to resolve this.

The account that I created this morning was for the v4 API so after a bit of digging I created a second account using this link: https://developer.climacell.co/sign-in.

Once created this gave me access to a different dashboard with a different API key. I swapped the API key in my secrets.yaml and restarted HA and the error has gone and it seems to be working perfectly.

It looks like this component doesn't support the v4 API yet but Climacell are giving those out by default to new accounts

haidlogan commented 3 years ago

Worked for me too! Thanks.

eboettn commented 3 years ago

Worked for me too. Thanks!!

Get Outlook for iOShttps://aka.ms/o0ukef


From: haidlogan notifications@github.com Sent: Monday, December 21, 2020 3:51:50 PM To: r-renato/ha-climacell-weather ha-climacell-weather@noreply.github.com Cc: eboettn eric.boettner@gmail.com; Comment comment@noreply.github.com Subject: Re: [r-renato/ha-climacell-weather] Error 403 from Climacell API (#31)

Worked for me too! Thanks.

— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://github.com/r-renato/ha-climacell-weather/issues/31#issuecomment-749190345, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ABTLP4LN4PVZJHY2X6TTTBDSV6YONANCNFSM4VENNIMQ.

jig432 commented 3 years ago

If I read the website correctly, the v3 API is going away in July 2021. FYI.

haidlogan commented 3 years ago

So it won’t work if i have it set up?

On Dec 22, 2020, at 7:00 PM, jig432 notifications@github.com wrote:

 If I read the website correctly, the v3 API is going away in July 2021. FYI.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

jig432 commented 3 years ago

I also tried and found I only have a v4 key. As mentioned above, I did a v3 registration, got a key and am able to use the v3 version. But I think it will go away in July 2021, according to what I saw on the climacell web site.

I hacked on a v4 version of this HA sensor and got it to mostly work, but since I am still learning HA, and this source, it still has issues. The changes they made for the climacell v4 API have some significant changes that will need to be updated in this source: 1) condition name changes (like from wind_speed to now "windSpeed") 2) only return values in metric units (my hack didn't try to add converting to imperial) 3) don't return units in each REST API response, you have to keep your own units as a requester 4) returned data organization is different 5) appears to want the requested fields in the URL 6) wants "Z" added as suffice to UTC times maybe other things I forgot....

Hope the author of this will update it.

ITensEI commented 3 years ago

Trying to sign up on https://developer.climacell.co/sign-in just directs back to the new v4 page it seems. Having the same problem and can't find a way to get the v3 API