core icon indicating copy to clipboard operation
core copied to clipboard

Overkiz occasionally fails to connect with Somfy Tahoma Switch (local API)

Open mf22433 opened this issue 1 year ago • 51 comments

The problem

I see an issue that occurs from time to time with the Overkiz integration (error reports in the journal). I use this integration in combination with a Somfy Tahoma Switch to control 7 indoor stores and 3 outdoor screens (nothing else).
When it happens I lose connectivity with all stores/screens (the icons are grayed out). I believe it can reconnect by itself because I see that the journal mentions 42 occurences of this issue and I did not reload the integration 42 times, but sometime it happens when I want to activate the stores and then I have to reload the integration to fix it.

Note that Home Assistant OS (running in a VM on a QNAP NAS) and Tahoma Switch are on the same vlan.

Extract from the journal: _Logger: homeassistant.components.overkiz Source: helpers/update_coordinator.py:332 Integration: Overkiz (documentation, issues) First occurred: 09:02:49 (42 occurrences) Last logged: 17:52:26

Error fetching device events data: Failed to connect._

What version of Home Assistant Core has the issue?

2024-1-5

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant OS

Integration causing the issue

Overkiz

Link to integration documentation on our website

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

Diagnostics information

config_entry-overkiz-0f79b18d9073b8a79acd4d88a25ce006.json.txt

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

mf22433 avatar Jan 21 '24 17:01 mf22433

Hey there @imicknl, @vlebourl, @tetienne, @nyrodev, mind taking a look at this issue as it has been labeled with an integration (overkiz) you are listed as a code owner for? Thanks!

Code owner commands

Code owners of overkiz can trigger bot actions by commenting:

  • @home-assistant close Closes the issue.
  • @home-assistant rename Awesome new title Renames the issue.
  • @home-assistant reopen Reopen the issue.
  • @home-assistant unassign overkiz Removes the current integration label and assignees on the issue, add the integration domain after the command.
  • @home-assistant add-label needs-more-information Add a label (needs-more-information, problem in dependency, problem in custom component) to the issue.
  • @home-assistant remove-label needs-more-information Remove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.

(message by CodeOwnersMention)


overkiz documentation overkiz source (message by IssueLinks)

home-assistant[bot] avatar Jan 21 '24 17:01 home-assistant[bot]

After further check in the journals, I can see that this error actually happens very frequently (almost every 5min), the stores and screens become unknown. The connection is then restored automatically.

mf22433 avatar Jan 21 '24 19:01 mf22433

Seeing exactly the same issue as @mf22433, after switching from Cloud API to local API yesterday by uninstalling then re-installing integration. Basically it works, but devices go offline repeatedly (icons are grayed out). They come back online after few minutes. Also on HA version 2024-1-5, using latest Overkiz integration with a Somfy Tahoma/Connexoon device in local mode.

thikade avatar Jan 22 '24 10:01 thikade

I can reproduce this, and will need to look further into this. We already retry multiple times when this error message occurs, but will probably need to make it even more robust. The error itself is hard to change and it seems that occasionally, the Somfy hub doesn't reply back..

Error fetching device events data: Failed to connect.

iMicknl avatar Jan 22 '24 11:01 iMicknl

@thikade so you didn't see this issue when using the Cloud API? I went straight to the local API but perhaps if that fix the issue I may give a go at the Cloud API.

mf22433 avatar Jan 22 '24 13:01 mf22433

Same problem after switching to local API. @mf22433 for me the cloud API which I have used for years did not have this behaviour, but there were other issues (like servers offline d/t maintanence etc.) @iMicknl does this mean the somfy box randomly stops working? If so, is this something we can help by reporting upstream to the Somfy guys?

OrbitingOcelot avatar Jan 22 '24 15:01 OrbitingOcelot

@mf22433 yes - no such problems with cloud API in the past ~1 year. I have just switched back to cloud API, and it works fine again. Wanted to get rid of cloud access, but this will have to wait ...

thikade avatar Jan 22 '24 16:01 thikade

@OrbitingOcelot not sure. This error message is very generic and comes from the underlying HTTP libraries that we use... Often this means that the server refuses to connect / is not responding.

iMicknl avatar Jan 22 '24 16:01 iMicknl

I now have this error every 5min for a few days, which makes the integration kind of unusable with the Local API... It used to work perfectly fine last week.

I'm not sure if it's related but I've been notified of an update on the Tahoma app - and it seems like it started failing all the time after that 🤔

Anything I can do to help with this?

mathieudutour avatar Feb 03 '24 17:02 mathieudutour

I also have this issue.. Someone have a fix for it?

mija87 avatar Feb 20 '24 15:02 mija87

FWIW, it doesn't happen for me anymore, not sure why...

mathieudutour avatar Feb 20 '24 16:02 mathieudutour

Just installed a tahoma box v2 in local mode i've got the same problem:

state is unavailable state is unknown velux has been closed repeating very frequently

@iMicknl Ho can I help debugging ?

t0k4rt avatar Feb 23 '24 17:02 t0k4rt

@iMicknl it seems to be related to the local url broadcasted. When I use the .local url I can see these errors in the logs:

2024-02-23 20:23:26.604 INFO (MainThread) [backoff] Backing off fetch_events(...) for 0.3s (aiohttp.client_exceptions.ClientConnectorError: Cannot connect to host gateway-xxxx-xxxx-xxxx.local:8443 ssl:<ssl.SSLContext object at 0xffff7a916ed0> [Invalid argument])
2024-02-23 20:23:26.617 ERROR (MainThread) [homeassistant.components.overkiz] Error fetching device events data: Failed to connect.

This seems resolved if I setup the integration using the ip of the box

t0k4rt avatar Feb 24 '24 07:02 t0k4rt

Is it still stable withe the IP adess?

mija87 avatar Feb 26 '24 17:02 mija87

@mija87 Yes it's stable ! On my setup the issue seems to be related to hassio_dns. I'm investigating

t0k4rt avatar Feb 26 '24 17:02 t0k4rt

Do you use Unifi by any chance? I face similar issues (already since development) and on the community forum, more people with Unifi face issues. Not sure if it is related to Unifi, but good to find out.

iMicknl avatar Feb 26 '24 22:02 iMicknl

I use Unifi indeed, I just changed the api back to local via IP adress in of the local adres. Testing that out..

mija87 avatar Feb 26 '24 22:02 mija87

No I'm not using unifi. I've got on openwrt router in my setup.

But I noticed that I cannot ping anymore all .local domains from all homeassistant containers (hassio_cli, dns and so on) and the box where homeassistant supervised is installed too. So gateway-xxxx-xxxx-xxxx.local is no more reachable.

But I can reach gateway-xxxx-xxxx-xxxx.local from any other machine on the network so I suspect it comes from dns configuration on my home assistant setup.

Which was kind of confirmed when I checked systemd-resolved and found these messages:

févr. 26 21:30:43 radxa-e25 systemd-resolved[11924]: mDNS-IPv4: There appears to be another mDNS responder running, or previously systemd-resolved crashed with some outstanding transfers.
févr. 26 21:30:43 radxa-e25 systemd-resolved[11924]: mDNS-IPv6: There appears to be another mDNS responder running, or previously systemd-resolved crashed with some outstanding transfers.

So I think the issue is related to that.

t0k4rt avatar Feb 26 '24 22:02 t0k4rt

Do you use Unifi by any chance? I face similar issues (already since development) and on the community forum, more people with Unifi face issues. Not sure if it is related to Unifi, but good to find out.

I experience the same with a Fritz 7590 and some repeaters. So I think it is not related to Unifi alone.

miezie avatar Mar 08 '24 19:03 miezie

Same problems with Tahoma local mode. Any suggestion? Thanks!

monogalactico avatar Mar 31 '24 07:03 monogalactico

@monogalactico have you tried connection to the IP directly?

iMicknl avatar Apr 01 '24 22:04 iMicknl

How can you see the IP of the Tahoma box?

mathieudutour avatar Apr 02 '24 12:04 mathieudutour

hello, I have the same problem, since last night I have this [homeassistant.components.overkiz] Error fetching device events data: Failed to connect. All elements are OFF. How can I fix this ?

CyrilleHome avatar Apr 08 '24 09:04 CyrilleHome

@monogalactico have you tried connection to the IP directly?

how we can do this ? sorry I'm a newbie !

CyrilleHome avatar Apr 08 '24 14:04 CyrilleHome

@CyrilleHome @mathieudutour You should be able to list all devices and their respective ips when connecting on your home router. You should find some tutorials on the internet depending on your isp. Then I advise you to set a static ip to your Tahoma box. If that does not work you can scan your network to retrieve your overkiz box ip (With for example https://angryip.org/download/). Your box should appear as gateway-xxxx-xxxx-xxxx.local

t0k4rt avatar Apr 08 '24 14:04 t0k4rt

@CyrilleHome please create a new issue and include your diagnostics. This is not related.

iMicknl avatar Apr 10 '24 09:04 iMicknl

Had the same problem and fixed it by using the IP address of the Somfy box instead of the gateway-xxxx-xxxx-xxxx.local name.

MarcoL1975 avatar Apr 12 '24 07:04 MarcoL1975

I have a similar problem: TaHoma switch worked fine with local API since I start using it a few weeks ago. Yesterday, the TaHoma switch was offline, but came online again after a few hours. This morning I updated HA to 2024.4.2, and afterwards the switch wasn't available anymore. After removing and re-adding the integration it says 'Failed to connect' when trying to connect to the TaHoma switch with correct password and 'Authentication failed' with a wrong password, so it does find the IP (connected to the IP of the switch). Just switched to cloud API, that works fine...

swappie-d avatar Apr 12 '24 09:04 swappie-d

@swappie-d this is not correct. The "Authentication failed" refers to the connection with the Cloud API. First time set-up, we need the Cloud API to generate a token for the local API. Your "Failed to connect" message refers to the local API indeed, are you sure you can ping the mDNS or IP from Home Assistant?

For all, I would switch to the IP address, the mDNS resolving is not stable at all. Will have a look into this, but not sure where the culprit might be...

iMicknl avatar Apr 12 '24 09:04 iMicknl

@iMicknl I just tried to ping it from HA, it responds 'connected'. However, when I enter 123.456.789.123:8443 as host, same error: Failed to connect.

swappie-d avatar Apr 12 '24 10:04 swappie-d