CLOSED - Platform Alpha Vantage - Periodic errors

Hi ,

Periodic errors are present in the home-assistant.log :

2020-12-15 04:57:59 ERROR (MainThread) [homeassistant.helpers.entity] Update for sensor.eur_usd fails
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 278, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 474, in async_device_update
    raise exc
  File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/src/homeassistant/homeassistant/components/alpha_vantage/sensor.py", line 212, in update
    self.values, _ = self._foreign_exchange.get_currency_exchange_rate(
  File "/usr/local/lib/python3.8/site-packages/alpha_vantage/alphavantage.py", line 218, in _format_wrapper
    call_response, data_key, meta_data_key = func(
  File "/usr/local/lib/python3.8/site-packages/alpha_vantage/alphavantage.py", line 160, in _call_wrapper
    return self._handle_api_call(url), data_key, meta_data_key
  File "/usr/local/lib/python3.8/site-packages/alpha_vantage/alphavantage.py", line 339, in _handle_api_call
    raise ValueError(json_response["Information"])
ValueError: Thank you for using Alpha Vantage! Our standard API call frequency is 5 calls per minute and 500 calls per day. Please visit https://www.alphavantage.co/premium/ if you would like to target a higher API call frequency.

=> Seems to be linked to changes from release 0.115 or 0.116 or a bit earlier as I do not recall exactly.

Is it a know issue or just me ?
Thank you

The error tells you what the problem is, you make to many API request for the free tier. The docs state that you can have maybe 1-2 tickers with the free tier, how many do you have?

Thanks @Burningstone for your reply.

Yes I know the problem is too many API requests ( > 5) , but in the integration documentation , there is no such setup ( max API requests or interval between requests ).

Yes, you can’t configure this, however the docs state that you can only have 1-2 tickers with the free tier.

The doc state that “Alpha Vantage offers two tiers of the API key, one free and one paid for. If you are using the free version you will be limited to five queries per minute”

=> Five queries max per minute for the Free API key is fine for my need
=> Question is how the Platform Alpha_Vantage is managing the dialog to Alpha Vantage to garantee 5 requests max per minute ?

The docs state:

This means that you’ll likely only be able to have one or two ticker entries.

I have 2 tickers , either I live with the error or i remove 1 ticker

Discussion CLOSED
Thanks

You could open an issue on github and ask the dev to add a possibility to choose the update interval.