Can't connect to OpenTherm Gateway via TCP (OTGW)

Currently struggling with the same connection issue. After scanning for i2c devices nothing is found. Is that ok?

Hi all,

Needing some help here with the latest HA (docker 2022.6.1) and OTGW with NodoMCU and ORGW firmware 5.4.

Whenever I try to connect with HA to the OTGW, I get some errors in the log of HA.
I also captured with tcpdump the network packets between HA and the OTGW, and the strange this is that when I have not yet connected, there is not traffic (good), but when I attempt to connect, the HA GUI shows an error, but in the background something keeps the connection open and logging is shown:

My command to connect is (first tried without the port, but that errors without a TCP connection:

name: OTGW
path: socket://192.168.3.140:25238
id: OTGW





2022-06-24 22:42:28 ERROR (MainThread) [pyotgw.pyotgw] Could not connect to serial device on socket://192.168.3.140. Will keep trying. Reported error was: Could not open port socket://192.168.3.140: '<=' not supported between instances of 'int' and 'NoneType'



2022-06-24 22:43:04 ERROR (MainThread) [pyotgw.pyotgw] Timed out waiting for command: PR, value: C.
2022-06-24 22:43:04 WARNING (MainThread) [pyotgw.protocol] Unknown message in command queue: PR: C=4 MHz
2022-06-24 22:43:04 WARNING (MainThread) [pyotgw.protocol] Command PR failed with PR: C=4 MHz, retrying...
2022-06-24 22:43:14 ERROR (MainThread) [pyotgw.protocol] Disconnected: None
2022-06-24 22:43:14 ERROR (MainThread) [homeassistant] Error doing job: Exception in callback SerialTransport._call_connection_lost(None)
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/asyncio/events.py", line 80, in _run
    self._context.run(self._callback, *self._args)
  File "/usr/local/lib/python3.9/site-packages/serial_asyncio/__init__.py", line 417, in _call_connection_lost
    self._serial.close()
  File "/usr/local/lib/python3.9/site-packages/serial/urlhandler/protocol_socket.py", line 104, in close
    time.sleep(0.3)
  File "/usr/src/homeassistant/homeassistant/util/async_.py", line 180, in protected_loop_func
    check_loop(func, strict=strict)
  File "/usr/src/homeassistant/homeassistant/util/async_.py", line 141, in check_loop
    raise RuntimeError(
RuntimeError: Detected blocking call to sleep inside the event loop. Use `await hass.async_add_executor_job()`; This is causing stability issues. Please report issue
2022-06-24 22:43:19 ERROR (MainThread) [pyotgw.pyotgw] Timed out waiting for command: PR, value: B.
2022-06-24 22:43:19 WARNING (MainThread) [pyotgw.protocol] Unknown message in command queue: PR: B=10:05 30-05-2022
2022-06-24 22:43:19 WARNING (MainThread) [pyotgw.protocol] Command PR failed with PR: B=10:05 30-05-2022, retrying...
2022-06-24 22:43:22 ERROR (MainThread) [pyotgw.pyotgw] Timed out waiting for command: PR, value: C.
2022-06-24 22:43:22 WARNING (MainThread) [pyotgw.protocol] Unknown message in command queue: PR: C=4 MHz
2022-06-24 22:43:22 WARNING (MainThread) [pyotgw.protocol] Command PR failed with PR: C=4 MHz, retrying...
^C
pi@raspberrymk:~/home-assistant $


The tcpdump shows the TCP connection kept alive, after the error is presented.



22:42:55.872752 IP 192.168.1.9.44814 > 192.168.3.140.25238: Flags [S], seq 4084445022, win 64240, options [mss 1460,sackOK,TS val 259460211 ecr 0,nop,wscale 7], length 0
22:42:55.952604 ARP, Request who-has 192.168.3.1 tell 192.168.3.140, length 42
22:42:55.956180 IP 192.168.3.140.25238 > 192.168.1.9.44814: Flags [S.], seq 324512763, ack 4084445023, win 2144, options [mss 536,nop,nop,sackOK], length 0
22:42:55.956472 IP 192.168.1.9.44814 > 192.168.3.140.25238: Flags [.], ack 1, win 64240, length 0
22:42:55.996273 IP 192.168.1.9.44814 > 192.168.3.140.25238: Flags [P.], seq 1:7, ack 1, win 64240, length 6
22:42:56.225974 IP 192.168.3.140.25238 > 192.168.1.9.44814: Flags [.], ack 7, win 2138, length 0
22:42:58.626677 IP 192.168.3.140.25238 > 192.168.1.9.44814: Flags [P.], seq 1:28, ack 7, win 2138, length 27
22:42:58.626940 IP 192.168.1.9.44814 > 192.168.3.140.25238: Flags [.], ack 28, win 64213, length 0
22:42:58.637344 IP 192.168.3.140.25238 > 192.168.1.9.44814: Flags [P.], seq 28:30, ack 7, win 2138, length 2
22:42:58.637492 IP 192.168.1.9.44814 > 192.168.3.140.25238: Flags [.], ack 30, win 64211, length 0
22:42:58.649135 IP 192.168.1.9.44814 > 192.168.3.140.25238: Flags [P.], seq 7:13, ack 30, win 64211, length 6
22:42:58.763696 IP 192.168.3.140.25238 > 192.168.1.9.44814: Flags [.], ack 13, win 2132, length 0
22:43:01.632765 IP 192.168.3.140.25238 > 192.168.1.9.44814: Flags [P.], seq 30:52, ack 13, win 2132, length 22
22:43:01.632945 IP 192.168.1.9.44814 > 192.168.3.140.25238: Flags [.], ack 52, win 64189, length 0
22:43:01.641408 IP 192.168.3.140.25238 > 192.168.1.9.44814: Flags [P.], seq 52:54, ack 13, win 2132, length 2
22:43:01.641541 IP 192.168.1.9.44814 > 192.168.3.140.25238: Flags [.], ack 54, win 64187, length 0
22:43:01.650837 IP 192.168.1.9.44814 > 192.168.3.140.25238: Flags [P.], seq 13:19, ack 54, win 64187, length 6
22:43:01.784434 IP 192.168.3.140.25238 > 192.168.1.9.44814: Flags [.], ack 19, win 2126, length 0

Any help is appreciated!

Where do I find these settings? I only found the local port setting.

1 Like

On the website of nodo-shop you will find the manual under downloads

ā€œhttps://www.nodo-shop.nl/nl/index.php?controller=attachment&id_attachment=43?controller=attachment&id_attachment=43ā€

I have changed:
Local Port Number 23 (was 20108)
Work Mode TCP Server (was client)
Similar RFC2217 Unchecked (was checked)

I have the same struggle as @ElBoonoS

I am using Nodo OTGW with LAN header - USR-TCP232-T2 on board. I can succesfuly connect via OTmonitor to the gateway on the address 192.168.0.32:23

but the OpenTherm Gateway integration in Home Assitant returns me an error all the time when I want to connect to the gateway.

I can ping the gateway IP, I can open communication via telnet on the address 192.168.0.32:23 (both from the Windows PC in the same LAN), but cannot connect via OpenTherm Gateway integration in home assistant.

Edit: Currently I use firmware 4.3 in the gateway (before I tried firmware 5.4 with the same results).

Do you have any idea what to check?
Any ideas appreciated.

When I hit the ā€˜ā€˜Sendā€™ā€™ button in the OpenTherm Gateway dialogue in HA, I can see in the status page of USR-TCP232, that home assistant (IP 192.168.0.30) is connected to the gateway and gets some bytes of data. But the connection last only few seconds and after that you can see the error message in HA.

When I am connected with the otmonitor to the gateway, there is displayed IP address of my PC and is present until I close the connection or close the otmonitor app.

When you compare two pictures above - you can see that HA sends 6 bytes to gateway when trying to connect, while otmonitor does not send anything.

I also tried to run another instance of HA in virtual box on the PC, to check if I am able to connect to the gateway from HA. Unfortunately I cannot connect.

This is the serial port settings in the USR-TCP232 interface.

Everything seems to be okay, but HA OTGW integration still refuses to communicate.

I have an update to my issueā€¦

I can finally connect from HA through OpenTherm Gateway integration to Nodo shop OTGW v2.3. The problem was on the board - the jumper called ā€˜ā€˜USBā€™ā€™ must not be there.

After I pulled out this jumper I could successfuly open communication via URL ā€˜ā€˜socket://192.168.0.32:23ā€™ā€™ from HA.

Here is the desired integration in my overview with 175 entities :partying_face:
image

USR-TCP232 status page now looks like this, where 192.168.0.30 is my HA instance IP address.

Problem solved. :+1:

1 Like

I finally have my new Vaillant boiler and we have inserted the VR33 Opentherm module.
I have also installed the Opentherm integration in Home Assistant.
And in HA, I can connect to the OTGW and I see some values like pressure, boiler temperature etc.
At this moment, Iā€™m still using my old KNX thermostat, which I have connected as on/off thermostat to the OTGW input. Because its summer now, the relay is open and the OTGW should function in ā€œstandalone operationā€

My problem: When, with OTMonitor, I put the OTGW in ā€œmonitor modeā€ (instead of gateway mode), than HA switches all objects to ā€œunavailableā€ every 5 seconds. And back to normal values. Any idea?
PS: I donā€™t have this ā€œunavailable problemā€ in ā€œgateway modeā€. And I have a wired UTP connection to the OTGW

I can also see those 175 entities, but the boiler temperature for example is 0.0 C (which is impossible). It seems that communication with the boiler isnā€™t working (the networking part, which you had difficulty with, works great).

Whatā€™s the best way to make sure that communication between Nodoshop OTG and boiler is working?

A good start would be the Tx and Rx LEDs on the unit; then download the ā€˜otmonitorā€™ app and look in the log tabā€¦

A good start would be the Tx and Rx LEDs on the unit

Are these exclusively for boiler to gateway communication?

I ran the otmonitor app already and I was able to set the temperature, etc. (via the GUI), but the boiler never seemed to respond to those commands. Also, of particular concern was that the graph always remained empty.

Umm. Thatā€™s a pretty sure sign that the comms is not working.

Apropos the LEDs, if you disconnect the thermostat, and only have the boiler attached, then the LEDs would indicate comms on that link.

Note: did you try power cycling your boiler? Some boilers have a timeout where if there is nothing trying to talk to it over the OT bus for a certain time, they will revert to on/off mode.

Thanks for the reply (I do value that over being ignored).

Power cycling had already been done and didnā€™t help.

Boiler is a Quinta 65. So, if anyone has ever seen this combination working that would be of interest. Of someone knows that the Quinta 45 is electronically the same that would also be of interest.

We might try with a different brand boiler and see whether itā€™s the boiler being broken or the gateway.

My professional opinion is that OpenTherm is just a worthless standard due to underspecification and the standard being everything but open.

Politics:
If we had a functioning government publishing such terrible specifications and constructions of association would be punishable by death.

It apparently has not been reported on the OTGW siteā€¦

http://ihormelnyk.com/Content/Pages/opentherm_library/Opentherm%20Protocol%20v2-2.pdf

does anyone know how to set slave_ch_max_setp in the HA integration ?, iā€™m on a M1 Mac so canā€™t run the windows util.