Overkiz integration - Local API [Development / Testers topic]

Hi imick,
Dont have anything in log.
Official version is also bugging !

Hi,
I’ve connected my RailDin V2 in ethernet and I don’t have any problem anymore (Cannot connect and devices unavailable).
I’m now trying to add my atlantic electric heater :
It’s working with official integration but not in local mode.
I’ve tried to force pyoverkiz to 1.7.0 since you updated it yesterday. Still no suscess!

@HpNoTiQ climate devices are not supported in local mode unfortunately. This is a Somfy limitation.

See Hitachi heat pump not appearing as device · Issue #11 · Somfy-Developer/Somfy-TaHoma-Developer-Mode (github.com).

Today I upgraded my Tahoma box to newest version and now the integration gives

Traceback (most recent call last):
File “/usr/src/homeassistant/homeassistant/config_entries.py”, line 365, in async_setup
result = await component.async_setup_entry(hass, self)
File “/config/custom_components/overkiz/init.py”, line 91, in async_setup_entry
await client.login()
File “/usr/local/lib/python3.10/site-packages/pyoverkiz/client.py”, line 159, in login
await self.register_event_listener()
File “/usr/local/lib/python3.10/site-packages/backoff/_async.py”, line 151, in retry
ret = await target(*args, **kwargs)
File “/usr/local/lib/python3.10/site-packages/pyoverkiz/client.py”, line 528, in register_event_listener
response = await self.__post(“events/register”)
File “/usr/local/lib/python3.10/site-packages/pyoverkiz/client.py”, line 778, in __post
await self.check_response(response)
File “/usr/local/lib/python3.10/site-packages/pyoverkiz/client.py”, line 877, in check_response
raise Exception(message if message else result)
Exception: Not authenticated.

Clearly a problem with authentication.
Somebody else experience this too ?

Removing the integration, then rebooting HAOS and then adding the integration again did the trick .
I am up and running with the local integration again.

Just wanted to give an update to this thread and specially you @imick

I deleted everything and started from beginning. Now I was able to add from integration and not auto-discovery unlike before, I don’t really know what changed. I get everything up and running.

However, short after it fails with the following error. I suspect it has to do with that I have custom SSL certs for my server (incl hassio). Not self-signed, the real deal. I think I saw something in your works that this was an issue that you plan to fix? If so any update/timeline on this? :slight_smile:

Felet härrör från en anpassad integration.

Logger: custom_components.overkiz
Source: helpers/update_coordinator.py:168
Integration: Custom Overkiz PR#71644
First occurred: 23:08:14 (1 occurrences)
Last logged: 23:08:14

Error requesting device events data: Cannot connect to host gateway-xxxx-xxxx-xxxx.local:8443 ssl:default [Invalid argument]a

Did you select verify SSL?

I haven’t been able to make any progress in the last months as I have been very busy with work and now I am on holidays for a month :smiley:.

Hopefully in this new year, I can spend some more time on adding this to core!

Hmm…can’t remember making any such decision at all when setting it up? At what point is that suppose to be chosen? :face_with_raised_eyebrow:

You are right, this is not part of the integration anymore. We don’t verify the SSL connection by default, so I wonder how you can face this issue…

Like I said I started from beginning and used the URL above so it should be latest?

I ended up using the official Overkiz (without local) just to have it functioning, but I can give it another try if you need any info?

Hi!
It just work fine with me with this equipment:
Outside front gate (io:DiscreteGateOpenerIOComponent)
Garage door (io:DiscreteGarageOpenerWithPartialPositionIOComponent)
2 somfy covers (io:RollerShutterWithLowSpeedManagementIOComponent)
4 roof window Velux Covers (io:RollerShutterVeluxIOComponent)
1 motorised roof window Velux (io:WindowOpenerVeluxIOComponent)
1 sun screen (rts:HorizontalAwningRTSComponent)
all working with a Tahoma Switch
this integration is installed on a seperated Home Assistant Instance.

To be continued
Looking forward to seeing this added to core

Thanks for your hard work gents

[EDIT] I forgot to say that during the installation I am proposed several Tahoma devices, all with same PIN; I just chose the first one

Have you all seen this? I am unable to test on short term, but it seems hopeful for Connexoon owners! :slight_smile:

Yes, I got the message today that the connexoon is now also supporting the local api and I can enable developer mode now from my connexoon on the somfy website.

But my question is what do I need to do now, in order to use the local api?
It refers to GitHub - Somfy-Developer/Somfy-TaHoma-Developer-Mode: A collection of requests to use a local API with Somfy TaHoma gateways, but does the Overkiz integration fully support this yet? Do I need to reinstall this integration?

The core installation does not support this yet, but in this topic it is described how you can use the test version.

1 Like

Could not install using first method
used Alternative method to test by Mariusthvdb
worked fine except the auto discovery is still discovering several time my tahoma switch at reboot (not an issue, so far)

I have 19 devices discovered including tahoma Switch:

  • 1 Dimmer light io:DimmableLightIOComponent with 4 independant outputs (Somfy Ref: 1822603) counts for 4 devices
    Works perfectly

  • 1 rts:DualCurtainRTSComponent
    Works perfect
    There is a button with the device “button.XY_my_position” that i think is useless as RTS protocol do not support a ‘my position’ preferred setting

  • 3 Devices HW:io:VerticalExteriorAwningIOComponent
    Works perfetly

  • 1 Device HW io:WindowOpenerVeluxIOComponent equipped with io:VerticalInteriorBlindVeluxIOComponent (seen as two separated devices)
    Works perfect

  • 8 devices with HW= io:HeatingValveIOComponent → They areThermostatic Valve (Somfy Ref: 1870508) I can read the temperature. I have now access to a number comfort_room_temperature, this is not the most widely used to set a temperature (there should be a manual one). Could not find a way to set requested temperature from HA (only read)

Could be great to get good advices on which Cards with which config would be most suitable to pilot all these devices

on all these devices, on a regular basis, the box seems unavailable for a few seconds/minutes

LEDSaM turned off triggered by state of Led_haut turned off
11:20:31 PM - 4 minutes ago

LEDSaM became unavailable triggered by state of Led_haut became unavailable
11:19:31 PM - 5 minutes ago

LEDSaM turned off triggered by state of Led_haut turned off
11:18:01 PM - 7 minutes ago

LEDSaM became unavailable triggered by state of Led_haut became unavailable
11:16:01 PM - 9 minutes ago

LEDSaM turned off triggered by state of Led_haut turned off
11:13:01 PM - 12 minutes ago

LEDSaM became unavailable triggered by state of Led_haut became unavailable
11:12:01 PM - 13 minutes ago

LEDSaM turned off triggered by state of Led_haut turned off
11:10:31 PM - 14 minutes ago

LEDSaM became unavailable triggered by state of Led_haut became unavailable
11:09:31 PM - 15 minutes ago

LEDSaM turned off triggered by state of Led_haut turned off
11:08:01 PM - 17 minutes ago

LEDSaM became unavailable triggered by state of Led_haut became unavailable
11:07:01 PM - 18 minutes ago

LEDSaM turned off triggered by state of Led_haut turned off
11:03:12 PM - 22 minutes ago

LEDSaM became unavailable triggered by state of Led_haut became unavailable
11:02:12 PM - 23 minutes ago

LEDSaM turned off triggered by state of Led_haut turned off
11:00:43 PM - 24 minutes ago

LEDSaM became unavailable triggered by state of Led_haut became unavailable
10:59:12 PM - 26 minutes ago

linked to this

2023-01-23 22:41:42.461 ERROR (MainThread) [custom_components.overkiz] Error requesting device events data: Cannot connect to host gateway-XXXX-YYYY-ZZZZ.local:8443 ssl:default [Invalid argument]
2023-01-23 22:44:42.468 ERROR (MainThread) [custom_components.overkiz] Error requesting device events data: Cannot connect to host gateway-XXXX-YYYY-ZZZZ.local:8443 ssl:default [Invalid argument]
2023-01-23 22:47:12.463 ERROR (MainThread) [custom_components.overkiz] Error requesting device events data: Cannot connect to host gateway-XXXX-YYYY-ZZZZ.local:8443 ssl:default [Invalid argument]
2023-01-23 22:49:42.461 ERROR (MainThread) [custom_components.overkiz] Error requesting device events data: Cannot connect to host gateway-XXXX-YYYY-ZZZZ.local:8443 ssl:default [Invalid argument]
2023-01-23 22:52:12.461 ERROR (MainThread) [custom_components.overkiz] Error requesting device events data: Cannot connect to host gateway-XXXX-YYYY-ZZZZ.local:8443 ssl:default [Invalid argument]
2023-01-23 22:59:12.461 ERROR (MainThread) [custom_components.overkiz] Error requesting device events data: Cannot connect to host gateway-XXXX-YYYY-ZZZZ.local:8443 ssl:default [Invalid argument]
2023-01-23 23:02:12.464 ERROR (MainThread) [custom_components.overkiz] Error requesting device events data: Cannot connect to host gateway-XXXX-YYYY-ZZZZ.local:8443 ssl:default [Invalid argument]
2023-01-23 23:07:01.462 ERROR (MainThread) [custom_components.overkiz] Error requesting device events data: Cannot connect to host gateway-XXXX-YYYY-ZZZZ.local:8443 ssl:default [Invalid argument]
2023-01-23 23:09:31.459 ERROR (MainThread) [custom_components.overkiz] Error requesting device events data: Cannot connect to host gateway-XXXX-YYYY-ZZZZ.local:8443 ssl:default [Invalid argument]
2023-01-23 23:12:01.465 ERROR (MainThread) [custom_components.overkiz] Error requesting device events data: Cannot connect to host gateway-XXXX-YYYY-ZZZZ.local:8443 ssl:default [Invalid argument]
2023-01-23 23:16:01.459 ERROR (MainThread) [custom_components.overkiz] Error requesting device events data: Cannot connect to host gateway-XXXX-YYYY-ZZZZ.local:8443 ssl:default [Invalid argument]
2023-01-23 23:19:31.464 ERROR (MainThread) [custom_components.overkiz] Error requesting device events data: Cannot connect to host gateway-XXXX-YYYY-ZZZZ.local:8443 ssl:default [Invalid argument]

additional log

2023-01-24 07:21:22.258 ERROR (MainThread) [custom_components.overkiz] Error requesting device events data: Cannot connect to host gateway-XXXX-YYYY-ZZZZ.local:8443 ssl:default [Invalid argument]
2023-01-24 07:23:52.253 ERROR (MainThread) [custom_components.overkiz] Error requesting device events data: Cannot connect to host gateway-XXXX-YYYY-ZZZZ.local:8443 ssl:default [Invalid argument]
2023-01-24 07:23:58.655 ERROR (MainThread) [aiohttp.server] Error handling request
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/aiohttp/connector.py", line 986, in _wrap_create_connection
    return await self._loop.create_connection(*args, **kwargs)  # type: ignore[return-value]  # noqa
  File "/usr/local/lib/python3.10/asyncio/base_events.py", line 1064, in create_connection
    raise exceptions[0]
  File "/usr/local/lib/python3.10/asyncio/base_events.py", line 1049, in create_connection
    sock = await self._connect_sock(
  File "/usr/local/lib/python3.10/asyncio/base_events.py", line 960, in _connect_sock
    await self.sock_connect(sock, address)
  File "/usr/local/lib/python3.10/asyncio/selector_events.py", line 500, in sock_connect
    return await fut
  File "/usr/local/lib/python3.10/asyncio/selector_events.py", line 505, in _sock_connect
    sock.connect(address)
OSError: [Errno 22] Invalid argument

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

Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/aiohttp/web_protocol.py", line 435, in _handle_request
    resp = await request_handler(request)
  File "/usr/local/lib/python3.10/site-packages/aiohttp/web_app.py", line 504, in _handle
    resp = await handler(request)
  File "/usr/local/lib/python3.10/site-packages/aiohttp/web_middlewares.py", line 117, in impl
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/security_filter.py", line 60, in Security_filter_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/forwarded.py", line 100, in forwarded_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 28, in request_context_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 81, in ban_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 236, in auth_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/view.py", line 136, in handle
    result = await result
  File "/usr/src/homeassistant/homeassistant/components/diagnostics/__init__.py", line 245, in get
    data = await info.config_entry_diagnostics(hass, config_entry)
  File "/config/custom_components/overkiz/diagnostics.py", line 24, in async_get_config_entry_diagnostics
    "setup": await client.get_diagnostic_data(),
  File "/usr/local/lib/python3.10/site-packages/backoff/_async.py", line 151, in retry
    ret = await target(*args, **kwargs)
  File "/usr/local/lib/python3.10/site-packages/pyoverkiz/client.py", line 414, in get_diagnostic_data
    response = await self.__get("setup")
  File "/usr/local/lib/python3.10/site-packages/pyoverkiz/client.py", line 758, in __get
    async with self.session.get(
  File "/usr/local/lib/python3.10/site-packages/aiohttp/client.py", line 1138, in __aenter__
    self._resp = await self._coro
  File "/usr/local/lib/python3.10/site-packages/aiohttp/client.py", line 535, in _request
    conn = await self._connector.connect(
  File "/usr/local/lib/python3.10/site-packages/aiohttp/connector.py", line 542, in connect
    proto = await self._create_connection(req, traces, timeout)
  File "/usr/local/lib/python3.10/site-packages/aiohttp/connector.py", line 907, in _create_connection
    _, proto = await self._create_direct_connection(req, traces, timeout)
  File "/usr/local/lib/python3.10/site-packages/aiohttp/connector.py", line 1206, in _create_direct_connection
    raise last_exc
  File "/usr/local/lib/python3.10/site-packages/aiohttp/connector.py", line 1175, in _create_direct_connection
    transp, proto = await self._wrap_create_connection(
  File "/usr/local/lib/python3.10/site-packages/aiohttp/connector.py", line 992, in _wrap_create_connection
    raise client_error(req.connection_key, exc) from exc
aiohttp.client_exceptions.ClientConnectorError: Cannot connect to host gateway-XXXX-YYYY-ZZZZ.local:8443 ssl:default [Invalid argument]

Enabled the local api with the Connexxoon. It is working great, thanks (again) for the effort that was put into this!

I realize now that my installation is still not local and that I am never proposed to choose the server

For everyone who has problems installing the “custom component” variant, I would like to describe how I got it to work:

My installation:

  1. Home Assistant with Supervisor
  2. HA version:
    Home Assistant 2023.2.2
    Supervisor 2023.01.1
    OS 9.5
  3. HACS installed
  4. Somfy Switch with a lot of devices

Steps to install:

  1. Adding this link: https://github.com/alandtse/pr_custom_component as a custom repository in HACS.
  2. In the HA UI go to “Configuration” → “Integrations” click “+” and search for “PR Custom Component”
  3. Change line 330 in /config/custom_components/pr_custom_component/apy.py to:
    async with async_timeout.timeout(TIMEOUT):
  4. Restart Home Assistant
  5. Add the URL of the pull request: https://github.com/home-assistant/core/pull/71644
  6. Restart Home Assistant
  7. Go to /config/custom_components/overkiz/config_flow.py and change line:
    LOCAL = “local” to LOCAL = “somfy_europe”
  8. Restart Home Assistant
  9. In the HA UI go to “Configuration” → “Integrations” click “+” and search for overkiz and choose “set up a new instance”
  10. Select Somfy Tahoma Developer Mode (local).
  11. Put your Box ID in gateway-xxxx-xxxx-xxxx.local:8443 and set up your credentials
  12. Then all devices were added and i can test devices

I hope the guide helps someone.

4 Likes

I tested via this way of installing the Local API . It worked (Thanks stylewarz3)

Nothing changes, still get regular cuts in the connection making devices unavailable

2023-02-07 20:47:53.185 ERROR (MainThread) [custom_components.overkiz] Error requesting device events data: Cannot connect to host gateway-xxxx-xxxx-xxxx.local:8443 ssl:default [Invalid argument]
2023-02-07 20:52:53.182 ERROR (MainThread) [custom_components.overkiz] Error requesting device events data: Cannot connect to host gateway-xxxx-xxxx-xxxx.local:8443 ssl:default [Invalid argument]
2023-02-07 20:57:53.179 ERROR (MainThread) [custom_components.overkiz] Error requesting device events data: Cannot connect to host gateway-xxxx-xxxx-xxxx.local:8443 ssl:default [Invalid argument]
2023-02-07 21:01:23.198 ERROR (MainThread) [custom_components.overkiz] Error requesting device events data: Cannot connect to host gateway-xxxx-xxxx-xxxx.local:8443 ssl:default [Invalid argument]