Overkiz integration - Local API [Development / Testers topic]

Thank you :heart:

As I don’t want to use Somfy cloud API which is not really stable, I did switch from the Overkiz PR to HA <-> Homebridge with Tahoma plugin <-> Tahoma. I will see if it works stable. If you want to try, make sur to switch homebridge from Bonjour-HAP to Ciao, otherwise it will not be well discovered in HA.

I use this configuration in native Homekit, it works rock solid. The only painful stuff was to add a second homebridge instance, as it is not possible to connect twice to an homekit bridge. Will tell u in coming days if it’s a reliable solution, waiting the local API get native support here in Overkiz integration (which is definitely a must have in HA Core :wink: )

One possible explanation and/or solution may be found here:

This looks interesting, how can i access this settings? oO

So that solution is exactly what is the problem.
I just changed the configuration code file of the integration from tahomalink.com to www.tahomalink.com and it works again.

Just edited the file:
lib/python3.9/site-packages/pyoverkiz/const.py

And updated Somfy europe configuration

    "somfy_europe": OverkizServer(  # uses https://ha101-1.overkiz.com
        name="Somfy (Europe)",
        endpoint="https://www.tahomalink.com/enduser-mobile-web/enduserAPI/",
        manufacturer="Somfy",
        configuration_url="https://www.tahomalink.com",
    ),

Endpoint before pointed to tahomalink.com

So tahomalink.com points to 178.32.15.131, but that address doesn’t even listen on port 443 needed for https. www.tahomalink.com points to 217.182.125.204 and that works just fine.

Interesstingly the server behind 217.182.125.204 also has a valid https configuration/certificate for tahomalink.com (without the www). It might just work if people override dns resolution of tahomalink.com to point to 217.182.125.204 (i have not tested this).

So maybe they just forgot to update the DNS record for tahomalink.com itself.
Not sure, we could reach out to Somfy. Or we could just change the code in HA to use www.tahomalink.com (easy change).

@genisd do you use the local integration (beta) or do you use the core component?

In the latest version of the underlying library (pyoverkiz) we already use another hostname. python-overkiz-api/const.py at f2aea2a5f52aca9caf8676fd145e92c58c80979f · iMicknl/python-overkiz-api · GitHub. This has actually been changed 9 months ago already.

For the testers, if you use the latest version from GitHub, it should be more stable! Especially the ‘unavailable’ issue should been fixed now.

What are the prerequisites for a local integration?

does this integration work with all motors ?, just i have been after Motorised Roman Shades, but they use RTS type of remote, how would this work to control the % for location in HA. ie if i want HA to open to 75% could it do that ?

would i just buy the Somfy TaHoma switch ?

thanks in advance.

could not get this work in HA 2023.6 any idea how to install the PR.

A hub that supports this :wink:. TaHoma v2, TaHoma Switch, Connexxoon.

You are in the beta topic for local installation. You can already use the Overkiz integration (cloud based). RTS would still not have % option, this is not supported, only for IO.

I would need to have a look. For now you should be fine by just using the Overkiz integration. Any reason why you want to use the local one?

hi thanks for the reply, I always prefer local rather then remote (for security), would RTS support start stop commands ?, ie could have an automation that starts close, delay 10 secs, then stop. or is it just fully open or fully close?.

Supports the same as the Somfy app :wink:. So open, close, stop and my position. For now I would stick with cloud and wait until local has been added to the core integration.

i dont have any binds, just want to sure it worth me buying one and the tahoma Switch hub to test, My Position is like a saved favorite scene, do we get one for each shade/blind ?

sorry for all the questions.

I don’t own any RTS devices, so I wouldn’t know. In theory if you use RTS, you wouldn’t need a hub and could create something with ESPHome.

But this would be best to discuss in a new topic, instead of hijacking this one. :wink:

1 Like

RTS works fine with up, down,stop and favorit. I have io, rts, light sensor and alarm on a tahoma v2 local. Would also work fine with the tahoma switch. ( i have also Brel/Faher and motion blinds local)

1 Like

is https://developer.somfy.com site down for everyone ?, I take it this is what I would need for local access ?

(ordered my first blind and Tahoma Switch today, should arrive in about 2 weeks)

You don’t need it, when you have your tahoma you can avtivate it on the user page

1 Like

I’ve managed to install the latest PR version of the integration.

Had to reboot the Tahoma Switch in order to make it setup correctly, otherwise it would end up in failing to set up (with a log error about missing token).

Anyway, all RTS motors seem to work fine, however I wanted to test if it actually works over local network instead of the cloud. In order to do that, I simply unplugged an internet cable from my router and tried to control one of the motors. And it failed. Now I wonder how do I even check that my configuration is supposed to talk to the local box?

In logs I got this:

Error log
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/aiohttp/connector.py", line 980, in _wrap_create_connection
    return await self._loop.create_connection(*args, **kwargs)  # type: ignore[return-value]  # noqa
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/asyncio/base_events.py", line 1085, in create_connection
    raise exceptions[0]
  File "/usr/local/lib/python3.11/asyncio/base_events.py", line 1069, in create_connection
    sock = await self._connect_sock(
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/asyncio/base_events.py", line 973, in _connect_sock
    await self.sock_connect(sock, address)
  File "/usr/local/lib/python3.11/asyncio/selector_events.py", line 634, in sock_connect
    return await fut
           ^^^^^^^^^
  File "/usr/local/lib/python3.11/asyncio/selector_events.py", line 674, in _sock_connect_cb
    raise OSError(err, f'Connect call failed {address}')
TimeoutError: [Errno 110] Connect call failed ('217.182.125.204', 443)

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/core.py", line 1928, in catch_exceptions
    await coro_or_task
  File "/usr/src/homeassistant/homeassistant/core.py", line 1950, in _execute_service
    await cast(Callable[[ServiceCall], Awaitable[None]], handler.job.target)(
  File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 226, in handle_service
    await service.entity_service_call(
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 811, in entity_service_call
    future.result()  # pop exception if have
    ^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1034, in async_request_call
    await coro
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 851, in _handle_entity_call
    await result
  File "/config/custom_components/overkiz/cover_entities/vertical_cover.py", line 101, in async_open_cover
    await self.executor.async_execute_command(command)
  File "/config/custom_components/overkiz/executor.py", line 91, in async_execute_command
    exec_id = await self.coordinator.client.execute_command(
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/backoff/_async.py", line 151, in retry
    ret = await target(*args, **kwargs)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/backoff/_async.py", line 151, in retry
    ret = await target(*args, **kwargs)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/pyoverkiz/client.py", line 611, in execute_command
    response: str = await self.execute_commands(device_url, [command], label)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/backoff/_async.py", line 151, in retry
    ret = await target(*args, **kwargs)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/pyoverkiz/client.py", line 639, in execute_commands
    response: dict = await self.__post("exec/apply", payload)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/pyoverkiz/client.py", line 777, in __post
    async with self.session.post(
  File "/usr/local/lib/python3.11/site-packages/aiohttp/client.py", line 1141, in __aenter__
    self._resp = await self._coro
                 ^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/aiohttp/client.py", line 536, in _request
    conn = await self._connector.connect(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/aiohttp/connector.py", line 540, in connect
    proto = await self._create_connection(req, traces, timeout)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/aiohttp/connector.py", line 901, in _create_connection
    _, proto = await self._create_direct_connection(req, traces, timeout)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/aiohttp/connector.py", line 1206, in _create_direct_connection
    raise last_exc
  File "/usr/local/lib/python3.11/site-packages/aiohttp/connector.py", line 1175, in _create_direct_connection
    transp, proto = await self._wrap_create_connection(
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/aiohttp/connector.py", line 988, in _wrap_create_connection
    raise client_error(req.connection_key, exc) from exc
aiohttp.client_exceptions.ClientConnectorError: Cannot connect to host ha101-1.overkiz.com:443 ssl:default [Connect call failed ('217.182.125.204', 443)]

Which sounds to me like a failed request to the cloud.

where is the webpage to do that ?