home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
73.43k stars 30.67k forks source link

Somfy Integration constantly gives Quota limit exceeded #62166

Closed dennisbrouwer91 closed 2 years ago

dennisbrouwer91 commented 2 years ago

The problem

The standard Somfy integration constantly gives back a Quota error in the logs.

What version of Home Assistant Core has the issue?

core-2021.12.1

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant Supervised

Integration causing the issue

Somfy

Link to integration documentation on our website

https://www.home-assistant.io/integrations/somfy/

Example YAML snippet

No response

Anything in the logs that might be useful for us?

2021-12-17 08:59:07 ERROR (MainThread) [homeassistant.components.somfy] Unexpected error fetching somfy device update data: error_code: policies.ratelimit.QuotaViolation, fault_string: Rate limit quota violation. Quota limit exceeded.
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/somfy/coordinator.py", line 52, in _async_update_data
    devices = await self.hass.async_add_executor_job(
  File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 52, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/local/lib/python3.9/site-packages/pymfy/api/somfy_api.py", line 65, in get_devices
    response = self.get(f"/site/{site_id}/device")
  File "/usr/local/lib/python3.9/site-packages/pymfy/api/somfy_api.py", line 85, in get
    return self._request("get", path)
  File "/usr/local/lib/python3.9/site-packages/pymfy/api/somfy_api.py", line 134, in _request
    self._check_response(response)
  File "/usr/local/lib/python3.9/site-packages/pymfy/api/somfy_api.py", line 147, in _check_response
    raise CLIENT_ERROR.get(message, ClientException)(response.json())
pymfy.api.error.SetupNotFoundException: message: setup_not_found, data: None
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 187, in _async_refresh
    self.data = await self._async_update_data()
  File "/usr/src/homeassistant/homeassistant/components/somfy/coordinator.py", line 58, in _async_update_data
    return await self._async_update_data()
  File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 52, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/local/lib/python3.9/site-packages/pymfy/api/somfy_api.py", line 46, in get_sites
    response = self.get("/site")
  File "/usr/local/lib/python3.9/site-packages/pymfy/api/somfy_api.py", line 85, in get
    return self._request("get", path)
  File "/usr/local/lib/python3.9/site-packages/pymfy/api/somfy_api.py", line 134, in _request
    self._check_response(response)
  File "/usr/local/lib/python3.9/site-packages/pymfy/api/somfy_api.py", line 144, in _check_response
    raise SERVER_ERROR.get(error_code, ServerException)(response.json())
pymfy.api.error.QuotaViolationException: error_code: policies.ratelimit.QuotaViolation, fault_string: Rate limit quota violation. Quota limit exceeded.

Additional information

No response

probot-home-assistant[bot] commented 2 years ago

somfy documentation somfy source (message by IssueLinks)

probot-home-assistant[bot] commented 2 years ago

Hey there @tetienne, mind taking a look at this issue as it has been labeled with an integration (somfy) you are listed as a code owner for? Thanks! (message by CodeOwnersMention)

tetienne commented 2 years ago

Hi, about this quota issue, I’m out of ideas. I already try several fixes, contact Somfy to ask them if they can change their policy (they did), but it’s still not stable... I invite you to install https://github.com/iMicknl/ha-tahoma instead which I maintain with 2 other people. You will have more feature and more device supported.

dennisbrouwer91 commented 2 years ago

Thanks for the quick response. Just checking : Isn't this Somfy traffic going through Home Assistant Cloud? I thought i saw that when setting it up. So maybe that is the issue?

tetienne commented 2 years ago

Home Assistant Cloud is just used to store the Application key and secret. Next the traffic is only between your machine and Somfy.

joostthehost commented 2 years ago

I'm experiencing the same problem (sometimes). After the changes in polling rate that were made earlier this year (after consulting the Somfy devs), I was hopeful that the Somfy integration/Somfy's Open API would become more stable.

I keep on hoping that Somfy will include a (minimal) local API in their devices 🤞, but that hope is fading by the day...

@tetienne , could you explain why the ha-tahoma component does appear to work? What is different there, and why can't we port these differences/changes to the official Somfy integration?


edit: Somfy integration is up again, I noticed some errors in the log about an unreachable URL, so perhaps (for me) it was a temporary hickup this time.

tetienne commented 2 years ago

@joostthehost ha-tahoma and the Somfy integration use a totally different API. ha-tahoma uses the undocumented and unofficial API (the same use by your hub/box), while the Somfy integration call the official API. So behind, the behavior and the capabilities are not the same at all.

dennisbrouwer91 commented 2 years ago

Also, i'm pretty sure the ha-tahoma doesn't work when you only have a Somfy Alarm. At least, i cannot get my account to work.

tetienne commented 2 years ago

If you have a Tahoma, you can open an issue to our repo.

OrbitingOcelot commented 2 years ago

I am unfortunately getting the same issue again and again every couple of days: pymfy.api.error.QuotaViolationException: error_code: policies.ratelimit.QuotaViolation, fault_string: Rate limit quota violation. Quota limit exceeded.

Is there any email contact where I can reach out to Somfy and ask for increasing the quota? Maybe if the requests dont all come from one guy we increase the chance they will listen? ;)

I will try the tahoma integration when I have some time (I think had been using it over a year back, but Somfy disabled the tahomalink for my connexxoon box without advance warning so I had to switch).

OrbitingOcelot commented 2 years ago

@tetienne is there a way to locally reduce the polling rate in a config file etc.? I do not really care about correct position in HA as I hardly use HA to set blinds interactively. Having a highly reliable way to send open/close/position commands (from automations, switches etc.) is way more important to me, so I could comfortably live with a higly reduced polling rate, to make Somfy servers happy...

tetienne commented 2 years ago

@OrbitingOcelot you cannot update the polling interval through configuration file. You have to edit the integration file but I'm not sure it will fix the issue.

I will contact them Monday.

Meanwhile, have a try with https://github.com/iMicknl/ha-tahoma

birse29 commented 2 years ago

Hey Guys,

Facing the same issue. Any update or workaround ?

tetienne commented 2 years ago

Use Overkiz integration instead far way stable and reactive.

OrbitingOcelot commented 2 years ago

@tetienne just out of interest, did you hear anything back from Somfy? I did not get anything from them, quite disappointing.

However, my setup has been working for the past few weeks, so fingers crossed. If it stops again, I will move to Overkiz...

I am amazed that suppliers like Somfy are not more willing to provide (or support) good integrations for their products. Nobody wants to use a different app for each of their smart home components nowadays.

mr-77 commented 2 years ago

Hey guys, any updates? Getting this Error since last week. I need to pause my somfy integration for 1-2 days then it is working 2 days until the next quota violation :(

_Logger: homeassistant.components.somfy Source: components/somfy/coordinator.py:45 Integration: Somfy (documentation, issues) First occurred: 27. März 2022, 17:25:14 (6 occurrences) Last logged: 27. März 2022, 17:29:41 Unexpected error fetching somfy device update data: error_code: policies.ratelimit.QuotaViolation, faultstring: Rate limit quota violation. Quota limit exceeded.

Can I somehow restrict my somfy calls to make it work longer than 1-2 days?

OrbitingOcelot commented 2 years ago

Hey guys, any updates?

Hey there! My integration stopping working again after my last post here. I completely gave up on this and have now moved to the overkiz version which @tetienne recommended above. Seems really good and stable so far, let's hope Somfy does not break it. I have zero trust left in Somfy as this is now the third integration I had to move to to keep my stuff running.

Can I somehow restrict my somfy calls to make it work longer than 1-2 days?

As per info a few messages up, you would have to edit some config file. I'm not sure it's worth it to be honest. Which box do you have? Try the overkiz version, might be best solution for you. Good luck!

mr-77 commented 2 years ago

As per info a few messages up, you would have to edit some config file. I'm not sure it's worth it to be honest. Which box do you have? Try the overkiz version, might be best solution for you. Good luck!

I have bought a Somfy Connexoon io Box last month, will this one work with Overkiz too?

OrbitingOcelot commented 2 years ago

I have bought a Somfy Connexoon io Box last month, will this one work with Overkiz too?

Yes

mr-77 commented 2 years ago

Try the overkiz version, might be best solution for you. Good luck!

Intstalled Overkiz and it's working like a charm :) thank you! Also the integration into HomeKit is a lot faster/better, too bad Siri isn't working with my Somfy shutters anymore since I updated iOS to 15.4

margatemarcel commented 2 years ago

I have been experiencing this issue too, so reached out to Somfy UK support last week. I've just received this reply, although not being a developer, I'm not quite sure of the implications:

Hi Marcel,

This Wednesday Open API will be replaced by Local API Access, if you are registered on our developer list (https://developer.somfy.com/), then you will receive further information on the date of the change.

Kind regards, (removed) Technical Support – B2B

OrbitingOcelot commented 2 years ago

Oh wow, interesting... Curious to see what this actually means. For me "Local API" means gateway device becomes directly accessible via API, without any cloud/network dependency, but that sounds a bit too good to be true. There is currently one device I know of that offers local API for RS IO standard, the Velux KLF 200, see https://velcdn.azureedge.net/~/media/com/api/klf200/technical%20specification%20for%20klf%20200%20api-ver3-16.pdf

iMicknl commented 2 years ago

Local API will probably be based on the same structure as the Overkiz integration. For now I would advise to use the Overkiz integration (via cloud) and after they introduce local support, we will integrate this in the Overkiz integration as well.

iMicknl commented 2 years ago

Somfy Developer Mode (a.k.a. Local API) has been announced, together with the deprecation of the Somfy Open API. Somfy will continue to support this API until June 21st 2022.

In Home Assistant that would mean that you should switch to the Overkiz integration, where local support will be added in the future. (https://github.com/home-assistant/core/issues/69558).

OrbitingOcelot commented 2 years ago

Unfortunately only for Tahoma, not for the Connexxoon I bought. So I assume I can continue to use Overkiz cloud API in the future?

margatemarcel commented 2 years ago

Unfortunately only for Tahoma, not for the Connexxoon I bought. So I assume I can continue to use Overkiz cloud API in the future?

That's annoying - I had only recently bought a Connexoon RTS too.

raman325 commented 2 years ago

closing by request of @iMicknl