viktak / ha-cc-openweathermap_all

Home Assistant custom component combining multiple OpenWeatherMap API calls
GNU General Public License v3.0
22 stars 2 forks source link

Too much Calls #10

Closed kamm0r closed 2 years ago

kamm0r commented 2 years ago

Hi, OpenWeather sent a mail with this text. I suppose that >1000 calls per day are a lot (for my purpose) It is normal? How I can solve? Where is possible to limit the calls to (i.e.) 3 per hour?

One Call API usage alert Dear Customer! Thank you for choosing OpenWeather! We have noticed that your account is currently using One Call API quite intensively and exceed the account limit of 1000 calls per day. [cut]

thanks a lot

Marco alias Kamm0r

viktak commented 2 years ago

Hi, yes, I also got this notification this morning. Looking at it...

viktak commented 2 years ago

I pushed out a new version that temporarily uses a workaround:

  1. Sets a 10 minute poll interval
  2. Removes the UVI sensor (that caused the problem)

Everything else should work as expected.

I'll try to find a permanent fix soon. Until then I'll leave this issue open.

nicocoetzee commented 2 years ago

Mine just started working again for some reason. I got the API limit notification this morning too.

nicocoetzee commented 2 years ago

Ha, this is why... Screen Shot 2022-02-23 at 8 28 56 AM .

viktak commented 2 years ago

Yepp, that explains a lot... :)

viktak commented 2 years ago

I just re-enabled 'onecall', so that UV values are also reported again.

I have been testing it overnight and it seems that the polling happens every 10 minutes or so. Each time it sends 3 queries to api.openweathermap.org. This means that on a regular day it will make 2463=432 calls. This is well below the limit of 60 calls/minute allowed by the free plan of OpenWeatherMaps.

For people who have their APIs temporarily blocked: Please update your component to the latest, and the block should be lifted automatically after a day or so. If not (or don't want to wait), contact OpenWeatherMaps and ask for help doing so.