Overkiz API and Somfy API

I agree. Unreliable and no innovation. Release Notes.
The “My Position” (predefined personal setting, still not supported through the API.
As internet connection is required for all the options, I solely rely on IFTTT calling specific Tahoma predefined scenarios. That has been reasonable reliable for the last few years.

I too have pulled the plug on this piece of utmost crap, the ‘Official API’, and have reverted to the old Tahoma integration - which at least works, and is pretty trustworthy.

Since yesterday my integration has stopped working. After upgrading to version 0.107, covers are no longer recognized. I tried to reinstall version 0.106.6, but the problem persists, even removing and recreating the integration. Has Somfy changed anything in the API?
below is the error log:

Logger: homeassistant.components.cover
Source: components/somfy/cover.py:29
Integration: Scuri (documentation, issues)
First occurred: 7:23:46 (1 occurrences)
Last logged: 7:23:46
Error while setting up somfy platform for cover
Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.8/site-packages/homeassistant/helpers/entity_platform.py", line 179, in _async_setup_platform
    await asyncio.wait_for(asyncio.shield(task), SLOW_SETUP_MAX_WAIT)
  File "/usr/lib/python3.8/asyncio/tasks.py", line 483, in wait_for
    return fut.result()
  File "/srv/homeassistant/lib/python3.8/site-packages/homeassistant/components/somfy/cover.py", line 35, in async_setup_entry
    async_add_entities(await hass.async_add_executor_job(get_covers), True)
  File "/usr/lib/python3.8/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/srv/homeassistant/lib/python3.8/site-packages/homeassistant/components/somfy/cover.py", line 27, in get_covers
    return [
  File "/srv/homeassistant/lib/python3.8/site-packages/homeassistant/components/somfy/cover.py", line 29, in <listcomp>
    cover, hass.data[DOMAIN][API], hass.data[DOMAIN][CONF_OPTIMISTIC]
KeyError: 'optimisitic'

You are right, I got the same issue. This is due to the last modification: https://github.com/home-assistant/core/pull/31407
Sadly I didn’t the new code on my own installation. I will warn the auhor.

Issue created: https://github.com/home-assistant/core/issues/32971

I will try to find free time to fix it if the author of the PR does not do it quickly.

Same issue here, I hope the ‘optimisitic’ error gets fixed soon :slight_smile:

+1 same here
0.107 broke it
Erik

1 Like

Just updated to 0.107 and have the same issue.
Hope this gets fixed soon.
Boris

Same problem here.

The fix will be available soon with the 0.107.2.

2 Likes

Wonderful, thanks Etienne !

When comes the update?

0.107.2 has been released. I think there’s been an issue with the build though so it’s not available just yet. It will be available to update to once this file includes 0.107.2.

Edit: never mind, just took longer than usual. The Somfy integration works again.

It looks like 107.2 just broke my installation (Web interface not accessible) :frowning:

Not sure if just me, but in 107.4 it seems to be broken again (it worked with 107.3)

oauthlib.oauth2.rfc6749.errors.TokenExpiredError: (token_expired)

Your token probably expired during the component was ko. Try to remove the integration and add it again.

Integration is not working because the certificate expired!
Valid until Sat, 21 Mar 2020 12:00:00 UTC (expired 5 hours and 32 minutes ago) EXPIRED

requests.exceptions.SSLError: HTTPSConnectionPool(host=‘api.somfy.com’, port=443): Max retries exceeded with url: /api/v1/site (Caused by SSLError(SSLError(“bad handshake: Error([(‘SSL routines’, ‘tls_process_server_certificate’, ‘certificate verify failed’)])”)))

How can we disable certificate check from the integration…

They score a T! What a security:
https://www.ssllabs.com/ssltest/analyze.html?d=api.somfy.com&hideResults=off

Same here. This just appeared and I am still on 106.1

Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/urllib3/contrib/pyopenssl.py", line 485, in wrap_socket
    cnx.do_handshake()
  File "/usr/local/lib/python3.7/site-packages/OpenSSL/SSL.py", line 1934, in do_handshake
    self._raise_ssl_error(self._ssl, result)
  File "/usr/local/lib/python3.7/site-packages/OpenSSL/SSL.py", line 1671, in _raise_ssl_error
    _raise_current_error()
  File "/usr/local/lib/python3.7/site-packages/OpenSSL/_util.py", line 54, in exception_from_error_queue
    raise exception_type(errors)
OpenSSL.SSL.Error: [('SSL routines', 'tls_process_server_certificate', 'certificate verify failed')]

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/urllib3/connectionpool.py", line 672, in urlopen
    chunked=chunked,
  File "/usr/local/lib/python3.7/site-packages/urllib3/connectionpool.py", line 376, in _make_request
    self._validate_conn(conn)
  File "/usr/local/lib/python3.7/site-packages/urllib3/connectionpool.py", line 994, in _validate_conn
    conn.connect()
  File "/usr/local/lib/python3.7/site-packages/urllib3/connection.py", line 360, in connect
    ssl_context=context,
  File "/usr/local/lib/python3.7/site-packages/urllib3/util/ssl_.py", line 370, in ssl_wrap_socket
    return context.wrap_socket(sock, server_hostname=server_hostname)
  File "/usr/local/lib/python3.7/site-packages/urllib3/contrib/pyopenssl.py", line 491, in wrap_socket
    raise ssl.SSLError("bad handshake: %r" % e)
ssl.SSLError: ("bad handshake: Error([('SSL routines', 'tls_process_server_certificate', 'certificate verify failed')])",)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/requests/adapters.py", line 449, in send
    timeout=timeout
  File "/usr/local/lib/python3.7/site-packages/urllib3/connectionpool.py", line 720, in urlopen
    method, url, error=e, _pool=self, _stacktrace=sys.exc_info()[2]
  File "/usr/local/lib/python3.7/site-packages/urllib3/util/retry.py", line 436, in increment
    raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='api.somfy.com', port=443): Max retries exceeded with url: /api/v1/site (Caused by SSLError(SSLError("bad handshake: Error([('SSL routines', 'tls_process_server_certificate', 'certificate verify failed')])")))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 215, 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 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 516, in request
    method, url, headers=headers, data=data, **kwargs
  File "/usr/local/lib/python3.7/site-packages/requests/sessions.py", line 533, in request
    resp = self.send(prep, **send_kwargs)
  File "/usr/local/lib/python3.7/site-packages/requests/sessions.py", line 646, in send
    r = adapter.send(request, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/requests/adapters.py", line 514, in send
    raise SSLError(e, request=request)
requests.exceptions.SSLError: HTTPSConnectionPool(host='api.somfy.com', port=443): Max retries exceeded with 

Good catch, it seems really crazy! I will contact them. Sadly, they are in France, where we are currently in quarantine due to the covid 19.
Currently I don’t see any easy way to bypass this issue. I will have to upgrade my library to ignore ssI error but that’s really the worst solution.

1 Like

Worst or not but at least my domotica is working again :wink:

Everybody is in lockdown but changing a SSL certificate is peanuts…