Overkiz API and Somfy API

Hi

Was this commit merged into 0.103.0? If so i wonder why re-enabling the tahoma section in configuration.yaml and deleting the somfy integration led to the same errors as appeared after the 3. December. (which were the reason for me to change to the somfy integration)

Thank you very much! Perfect :grinning:

Thanks, working.

How to make it work? I have only Somfy integration and no custom components etc.
Can someone give a directions or manual?

You will have to enable the Tahoma component then cretate a custom component like explains here: https://developers.home-assistant.io/docs/en/creating_component_loading.html
In this custom component just update the manifest.json: https://github.com/home-assistant/home-assistant/pull/29918/files#diff-f364ab0278ee3ff73b2c274a5e024904

Ah ok, will try. I made a custom component of tahoma before, but never the API.

To be sure, tahoma as custom component or the API as well?

Just modify the api version in the custom component’s manifest, you don’t have to install the api anywhere, HA will take care of it.

I’ve an error today since the update to Hassio 3.7. Am I alone ?

Error setting up entry Home Assistant Cloud for somfy
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/pymfy/api/somfy_api.py", line 123, in _request
    return getattr(self._oauth, method)(url, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/requests/sessions.py", line 546, in get
    return self.request('GET', url, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/requests_oauthlib/oauth2_session.py", line 478, in request
    url, http_method=method, body=data, headers=headers
  File "/usr/local/lib/python3.7/site-packages/oauthlib/oauth2/rfc6749/clients/base.py", line 198, in add_token
    raise TokenExpiredError()
oauthlib.oauth2.rfc6749.errors.TokenExpiredError: (token_expired) 

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 192, in async_setup
    hass, self
  File "/usr/src/homeassistant/homeassistant/components/somfy/__init__.py", line 90, in async_setup_entry
    await update_all_devices(hass)
  File "/usr/src/homeassistant/homeassistant/components/somfy/__init__.py", line 162, in update_all_devices
    data[DEVICES] = await hass.async_add_executor_job(data[API].get_devices)
  File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/local/lib/python3.7/site-packages/pymfy/api/somfy_api.py", line 61, in get_devices
    site_ids = [s.id for s in self.get_sites()] if site_id is None else [site_id]
  File "/usr/local/lib/python3.7/site-packages/pymfy/api/somfy_api.py", line 42, in get_sites
    r = self.get("/site")
  File "/usr/local/lib/python3.7/site-packages/pymfy/api/somfy_api.py", line 80, in get
    return self._request("get", path)
  File "/usr/local/lib/python3.7/site-packages/pymfy/api/somfy_api.py", line 125, in _request
    self._oauth.token = self.refresh_tokens()
  File "/usr/src/homeassistant/homeassistant/components/somfy/api.py", line 31, in refresh_tokens
    self.session.async_ensure_token_valid(), self.hass.loop
  File "/usr/local/lib/python3.7/concurrent/futures/_base.py", line 435, in result
    return self.__get_result()
  File "/usr/local/lib/python3.7/concurrent/futures/_base.py", line 384, in __get_result
    raise self._exception
  File "/usr/src/homeassistant/homeassistant/helpers/config_entry_oauth2_flow.py", line 403, in async_ensure_token_valid
    new_token = await self.implementation.async_refresh_token(self.token)
  File "/usr/src/homeassistant/homeassistant/helpers/config_entry_oauth2_flow.py", line 81, in async_refresh_token
    new_token["expires_at"] = time.time() + new_token["expires_in"]
KeyError: 'expires_in'

Anyone else getting HTTP 400 errors?

Which version of Home Assistant is installed with Hassio?

The last one : Home Assistant 0.103.0 with Hassio 3.7

I have the same issue, Home asisstant 0.103.0

Wed Dec 18 2019 09:55:12 GMT+0100 (heure normale d’Europe centrale)
Error setting up entry Home Assistant Cloud for somfy
Traceback (most recent call last):
  File "/home/homeassistant/.homeassistant/deps/lib/python3.7/site-packages/pymfy/api/somfy_api.py", line 123, in _request
    return getattr(self._oauth, method)(url, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/requests/sessions.py", line 546, in get
    return self.request('GET', url, **kwargs)
  File "/home/homeassistant/.homeassistant/deps/lib/python3.7/site-packages/requests_oauthlib/oauth2_session.py", line 478, in request
    url, http_method=method, body=data, headers=headers
  File "/home/homeassistant/.homeassistant/deps/lib/python3.7/site-packages/oauthlib/oauth2/rfc6749/clients/base.py", line 198, in add_token
    raise TokenExpiredError()
oauthlib.oauth2.rfc6749.errors.TokenExpiredError: (token_expired) 

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/homeassistant/config_entries.py", line 192, in async_setup
    hass, self
  File "/usr/local/lib/python3.7/site-packages/homeassistant/components/somfy/__init__.py", line 90, in async_setup_entry
    await update_all_devices(hass)
  File "/usr/local/lib/python3.7/site-packages/homeassistant/components/somfy/__init__.py", line 162, in update_all_devices
    data[DEVICES] = await hass.async_add_executor_job(data[API].get_devices)
  File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/home/homeassistant/.homeassistant/deps/lib/python3.7/site-packages/pymfy/api/somfy_api.py", line 61, in get_devices
    site_ids = [s.id for s in self.get_sites()] if site_id is None else [site_id]
  File "/home/homeassistant/.homeassistant/deps/lib/python3.7/site-packages/pymfy/api/somfy_api.py", line 42, in get_sites
    r = self.get("/site")
  File "/home/homeassistant/.homeassistant/deps/lib/python3.7/site-packages/pymfy/api/somfy_api.py", line 80, in get
    return self._request("get", path)
  File "/home/homeassistant/.homeassistant/deps/lib/python3.7/site-packages/pymfy/api/somfy_api.py", line 125, in _request
    self._oauth.token = self.refresh_tokens()
  File "/usr/local/lib/python3.7/site-packages/homeassistant/components/somfy/api.py", line 31, in refresh_tokens
    self.session.async_ensure_token_valid(), self.hass.loop
  File "/usr/local/lib/python3.7/concurrent/futures/_base.py", line 432, in result
    return self.__get_result()
  File "/usr/local/lib/python3.7/concurrent/futures/_base.py", line 384, in __get_result
    raise self._exception
  File "/usr/local/lib/python3.7/site-packages/homeassistant/helpers/config_entry_oauth2_flow.py", line 403, in async_ensure_token_valid
    new_token = await self.implementation.async_refresh_token(self.token)
  File "/usr/local/lib/python3.7/site-packages/homeassistant/helpers/config_entry_oauth2_flow.py", line 81, in async_refresh_token
    new_token["expires_at"] = time.time() + new_token["expires_in"]
KeyError: 'expires_in'

same here.

just a guess, but could it be that somfy changed something on their side? i deleted the integration and if i want to set it up i get an error on their website.

Just upgraded and getting the same error.

Same here. Token expired error.

@Rhadamantys @TheNr1Guest @mase @medaemon Are you all under Hass.io or HA? Which kind of integration are you using the cloud one or the custom one (using your own app created on the Somfy website)?

Hello, HA for me and I have tried both cloud integration and then created my App on Somfy dev site. In both cases I have the same error.

Hass.io with custom component.

I hade the TaHoma integration but it have stoped working so i tryed this component and i dont find any of my blinds. I have tryed what was written in the first post and have send a mail to Somfy but no answers.

So my quiestion how the hell do i get my blinds in my Home Assistant?

TaHoma doesn´t work and Somfy official api doesn´t work.

Can someone please expelain to me like i´m a three year old :slight_smile: