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

Running into a "too many requests error" - code 429 since move to v4 API #52

Open bigcookie opened 3 years ago

bigcookie commented 3 years ago

Hi, I do have 5 location I want to request information from. All of them require daily and real time information (but in intervals of 15 min or 60min) and one which requires realtime (every 15 min), daily (every 3hours) and hourly (every 15 min). In HA I get a 400 and 429 error.

Details from log view:

Logger: custom_components.climacell.data_provider
Source: custom_components/climacell/data_provider.py:235
Integration: Climacell weather (documentation)
First occurred: 9:39:16 (5 occurrences)
Last logged: 9:39:17

ClimacellTimelineDataProvider._retrieve_data error status_code 400
ClimacellTimelineDataProvider._retrieve_data error status_code 429

Is there a chance to put some delay between the requests? Or whatever is required? Thank...

bigcookie commented 3 years ago

The issue might have come by me configuring and trying again, or it might have come as some data could not be retrieved and the component tried again. After reading some other issues, I noticed, that some field names changed or disappeared, causing no data for any field in one request being returned. I corrected that (trial and error a bit), now I can receive all data.

It would be great, to get a list of available fields. Somehow the field naming in the component vs climacell API differs (WindSpeed vs wind_speed) at least in some fields and it is unclear to me in which I can use the Climacell name and in which I have to use a different name.

Anyway, this is great work and many thanks for your dedication and work!!!!!

jazzyisj commented 3 years ago

I noticed, that some field names changed or disappeared.

You do realize the API completely changed right? I suggest thoroughly reading the documentation.

It would be great, to get a list of available fields.

https://docs.climacell.co/reference/data-layers-core

bigcookie commented 3 years ago

Yes, I do. And my question still sticks as the documented fields in the API are not (always?) aligned with the required yaml field specification. E.g api says „WindSpeed“, integration example uses „wind_speed“. Or can I always use the API field specification and it would also work defining „WindSpeed“ in yaml?