home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
73.92k stars 30.98k forks source link

OpenTherm Gateway failed to connect #118580

Open grzeg22 opened 5 months ago

grzeg22 commented 5 months ago

The problem

I have an opentherm gate made according to the design from the Schelte Bron website (http://otgw.tclcode.com). I have it connected via USB to my openwrt router. On the router, I use the socat command to send a transmission from USB to the TCP port. I have Home Assistant connected via socket://IP:port to the openwrt router. Up to version core_2024.5.0 everything worked. After updating to version core_2024.5.1 (where opentherm_gw was updated to 2.2.0), my opentherm system stopped working - there was no connection to the openwrt router with socat running. I did an analysis - after updating the opentherm_gw version to 2.2.0, the integration connects to two TCP ports in parallel, which is not possible in the case of socat. Therefore, a connection error occurs. This was confirmed by the use of the Remote Access option in the otmonitor software from the Schelte website, which can be used as a relay - there is a parallel connection on two TCP ports. Network analysis using Wireshark showed this similarly - Home Assistant connects to the socat service in parallel on two TCP ports. Is there any setting in Home Assistant that forces connection to only one TCP port? Unfortunately, subsequent Home Assistant updates did not fix the error that occurred to me. Best regards Grzegorz Kalus otgw_ha_relay ha_ot_reset ha_ok_relay

What version of Home Assistant Core has the issue?

core-2024.5.1

What was the last working version of Home Assistant Core?

core-2024.5.0

What type of installation are you running?

Home Assistant OS

Integration causing the issue

OpenTherm Gateway

Link to integration documentation on our website

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

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

home-assistant[bot] commented 5 months ago

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

Code owner commands Code owners of `opentherm_gw` 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 opentherm_gw` 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)


opentherm_gw documentation opentherm_gw source (message by IssueLinks)

mvn23 commented 5 months ago

Thank you for the report, possibly related to #117599 Do you get any errors in your Home Assistant log?

grzeg22 commented 5 months ago

Yes I have an error in Home Assistant Core: 2024-05-31 21:46:05.503 ERROR (MainThread) [pyotgw.connection] The serial device on socket://172.16.255.252:23000 is not responding. Will keep trying.

mvn23 commented 5 months ago

This has to be fixed in pyserial-asyncio-fast, the issue is mentioned just above this post.

umtauscher commented 4 months ago

Hi, I don‘t understand what you are telling us here. This problem is long standing. Will it ever be fixed?

mvn23 commented 4 months ago

I guess we have different definitions of "long standing", but that's not really relevant at the moment.

The issue is not caused by a bug in Home Assistant or the OpenTherm Gateway integration. Neither is it a bug in the pyotgw library that is used in the integration. It is caused by a small difference between pyserial-asyncio, which pyotgw used in the past for the underlying serial connection but which had other issues, and pyserial-asyncio-fast which fixed those other issues.

The issue has been reported here: home-assistant-libs/pyserial-asyncio-fast#12 I created a PR for a fix here: home-assistant-libs/pyserial-asyncio-fast#13

However, because of the dependencies between the different projects, the people over at pyserial-asyncio-fast have to apply the fix and release a new version first. Once that is done we can start working on getting the new version in Home Assistant.

umtauscher commented 4 months ago

Hi mvn23, thanks you very much for your response. I did‘t want to criticize in any way. For me is a not functioning integration for nearly two months naturally a long time. You know „a watched pot never boils“ ;-)

So I will be waiting patiently. Cheers

umtauscher commented 4 months ago

Followup: I my case the problem is solved, because it seems to have had another cause. My otgw interface showed operating mode "unknown". I was not able to switch it into gatewaymode by software. After a powercycle of the otgw interface everything went back to working. ... just to let you know... Cheers

mvn23 commented 3 months ago

This is fixed upstream, has been merged in dev in #121745 but could take a bit longer to appear in stable due to the issues mentioned in that PR.

krekr commented 1 month ago

I got the same error, but through a different failure: in the documentation, port 7686 is used (as an example, I know), while the current version of the OTGW firmware uses port 25238. I was using the Nodo-shop kit btw. This had me stumped for a while, so I'm documenting this here but not opening a new issue.

elvenstof commented 4 weeks ago

I am having a similar problem. I can connect to the gateway using the Opentherm Monitor software just fine, connecting to the [IP]:[port] but when I try to connect using the integration , using socket://[IP]:port it fails to connect. I do however see a refresh of the page that I use to access the USR-TCP232-T2 module, but my Home assistant IP doesn't shows up. Any clues?