OpenTherm Gateway binding

I had the same problem. 0.8 fixed this indeed! I am very happy with the binding! The outside temperature is spot on again.

kr Han

Hi Arjen,
thanks for all your efforts to create the OTGW binding.
I am running Openhab 2.4.0 stable in Docker on Synology NAS with OTGW 0.8.0

I have one concern, that is that after some time running, the connect is timing out. The automatic restart works, but the frequency of restarts is increasing until other Openhab network connections also start to fail.

2019-01-21 19:21:59.108 [INFO ] [eway.handler.OpenThermGatewayHandler] - Starting OpenTherm Gateway connector
2019-01-21 19:21:59.109 [INFO ] [eway.handler.OpenThermGatewayHandler] - OpenTherm Gateway connector started
2019-01-21 19:21:59.110 [INFO ] [eway.handler.OpenThermGatewayHandler] - Connecting OpenThermGatewaySocketConnector to 10.0.0.32:6638
2019-01-21 20:19:59.194 [ERROR] [eway.handler.OpenThermGatewayHandler] - An error occured in OpenThermGatewaySocketConnector: Read timed out

ISSUE FOUND
It turned out that the OTGW Wifi connection timed-out after some time. This had to do with the private key refresh interval, causing a forced reconnect on the ESP .
I changed the WIfi router settings for this and problem has gone away.

Regards,
Rob

Hi All,

I’m still very pleased with the binding and it is working great.
Because of the lack of a case supporting the LAN add-on on the OTGW board i designed a 3d case for the SMD OTGW (first real 3d project so not perfect, but it fits very good). If someone is interested in the drawing I can create the STL file and share it.

Reg,
Mic

edit: I have uploaded the case design to Thingiverse it will be visible after 24 hours:

1 Like

Hey everybody,

Can somebody help? I have a otgw connected to a rpi 3b witch has the webserver running. Also its connected with mqtt. The mqtt is working. Buth fore some reason it won’t connect with the binding.
can somebody help?

Loggings

2019-01-27 10:08:04.693 [INFO ] [eway.handler.OpenThermGatewayHandler] - Starting OpenTherm Gateway connector

2019-01-27 10:08:04.696 [INFO ] [eway.handler.OpenThermGatewayHandler] - OpenTherm Gateway connector started

2019-01-27 10:08:04.697 [INFO ] [eway.handler.OpenThermGatewayHandler] - Connecting OpenThermGatewaySocketConnector to 192.168.0.51:9404

==> /var/log/openhab2/events.log <==

2019-01-27 10:08:04.707 [hingStatusInfoChangedEvent] - ‘openthermgateway:otgw:e17d9397’ changed from OFFLINE to ONLINE

==> /var/log/openhab2/openhab.log <==

2019-01-27 10:08:04.718 [INFO ] [eway.handler.OpenThermGatewayHandler] - Connection closed by OpenTherm Gateway

==> /var/log/openhab2/events.log <==

2019-01-27 10:08:04.722 [hingStatusInfoChangedEvent] - ‘openthermgateway:otgw:e17d9397’ changed from ONLINE to OFFLINE

==> /var/log/openhab2/openhab.log <==

2019-01-27 10:08:14.804 [INFO ] [eway.handler.OpenThermGatewayHandler] - Starting OpenTherm Gateway connector

2019-01-27 10:08:14.806 [INFO ] [eway.handler.OpenThermGatewayHandler] - OpenTherm Gateway connector started

2019-01-27 10:08:14.807 [INFO ] [eway.handler.OpenThermGatewayHandler] - Connecting OpenThermGatewaySocketConnector to 192.168.0.51:9404

==> /var/log/openhab2/events.log <==

2019-01-27 10:08:14.814 [hingStatusInfoChangedEvent] - ‘openthermgateway:otgw:e17d9397’ changed from OFFLINE to ONLINE

==> /var/log/openhab2/openhab.log <==

2019-01-27 10:08:14.818 [ERROR] [eway.handler.OpenThermGatewayHandler] - An error occured in OpenThermGatewaySocketConnector: Connection reset

P.S: sorry fore my bad english :slight_smile:

Hi Tom, I am not entirely sure what you are trying to do, but the binding is currently designed to connect directly to the OTGW using some sort of serial to ethernet converter. Since the binding connects directly, MQTT is not needed.

Can you give some more details about your setup? How is the OTGW connected to the RPi? What webserver are you referring to? What do you mean by “it” when you say “it won’t connect with the binding”?

Hi,

I made a mistake, i was conneting with the web server from ot monitor and not with the relay server. after changing the port everything became online.
My setup: otgw connected with usb on a rpi that runs ot monitor and another rpi for openhab these ar connected over tcp/ip.
Thx fore the quick respons!

Tom

Maybe what I have to tell is nothing new. But maybe it’s usefull to some. Orriginally the OTGW-binding delivers the current temperature, current setpoint, and current setpoint override. This was too complicated for my family:roll_eyes:. So I changed it with the following simple rule:

//otgw.items
Number RoomTemperature "Kamertemperatuur [%.1f °C]" <temperature> {channel="openthermgateway:otgw:b8663928:roomtemp"}
Number RoomSetpoint "Huidig setpoint [%.1f °C]" <heating> {channel="openthermgateway:otgw:b8663928:roomsetpoint"}
Number ConstantRoomSetpointOverride "Nieuw setpoint [%.1f °C]" <heating> {channel="openthermgateway:otgw:xxxx:temperatureconstant"}
rule "Update RoomSetpoint"
when 
    Item RoomSetpoint changed
then 
    ConstantRoomSetpointOverride.sendCommand(RoomSetpoint.state)
end 

Sitemap:

Text item=RoomTemperature valuecolor=[RoomTemperatureOnline==OFF="red"]
Setpoint item=ConstantRoomSetpointOverride minValue=5 maxValue=22 step=0.5

Now I have simply current and setpoint temperature. It works perfectly from the sitemap, and also from the real-world thermostat. There are no interferences when changing both, it’s quick enough.

Does anybody know how to use the ‘SendCommand’ item for getting the boiler water pressure when the boiler has the capability to send this data but the thermostat has not?

Hi Guido, I think you can use the AA= command to get additional data from the boiler that the thermostat is not requesting. See also http://otgw.tclcode.com/standalone.html#operation and http://otgw.tclcode.com/firmware.html#configuration for an explanation of this command. I assume you can just enter this command when you add the item to a sitemap?

Thanx for the advice Jan,
I read this before, but I don’t understand how to construct the message. For instance, I would like to ask the boiler for the water pressure. I know this is msgID 18. Should the command be AA=4 & DA=18? Actually I think this would only work if the Gateway is not connected to the thermostat.

Or should I use PS=18 (Print Status of msgID 18)?
Putting it all down here I see there are only two logical answers. I will just try one of the coming evenings and report back here! Sometimes you just have to reread :wink: thanx!

SendCommand.sendCommand(“PS=18”) did not work:

 SendCommand changed from NULL to PS=18

==> /var/log/openhab2/openhab.log <==

2019-01-31 22:40:00.495 [ERROR] [eway.handler.OpenThermGatewayHandler] - error

java.lang.Exception: Invalid value '18' for code 'PS'

	at org.openhab.binding.openthermgateway.internal.GatewayCommand.<init>(GatewayCommand.java:32) ~[179:org.openhab.binding.openthermgateway:0.7.0]

	at org.openhab.binding.openthermgateway.internal.GatewayCommand.parse(GatewayCommand.java:62) ~[179:org.openhab.binding.openthermgateway:0.7.0]

	at org.openhab.binding.openthermgateway.internal.GatewayCommand.parse(GatewayCommand.java:54) ~[179:org.openhab.binding.openthermgateway:0.7.0]

	at org.openhab.binding.openthermgateway.handler.OpenThermGatewayHandler.handleCommand(OpenThermGatewayHandler.java:86) [179:org.openhab.binding.openthermgateway:0.7.0]

	at sun.reflect.GeneratedMethodAccessor108.invoke(Unknown Source) ~[?:?]

	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]

	at java.lang.reflect.Method.invoke(Method.java:498) ~[?:?]

	at org.eclipse.smarthome.core.internal.common.AbstractInvocationHandler.invokeDirect(AbstractInvocationHandler.java:153) [102:org.eclipse.smarthome.core:0.10.0.oh240]

	at org.eclipse.smarthome.core.internal.common.InvocationHandlerSync.invoke(InvocationHandlerSync.java:59) [102:org.eclipse.smarthome.core:0.10.0.oh240]

	at com.sun.proxy.$Proxy129.handleCommand(Unknown Source) [179:org.openhab.binding.openthermgateway:0.7.0]

	at org.eclipse.smarthome.core.thing.internal.profiles.ProfileCallbackImpl.handleCommand(ProfileCallbackImpl.java:75) [109:org.eclipse.smarthome.core.thing:0.10.0.oh240]

	at org.eclipse.smarthome.core.thing.internal.profiles.SystemDefaultProfile.onCommandFromItem(SystemDefaultProfile.java:49) [109:org.eclipse.smarthome.core.thing:0.10.0.oh240]

	at sun.reflect.GeneratedMethodAccessor107.invoke(Unknown Source) ~[?:?]

	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]

	at java.lang.reflect.Method.invoke(Method.java:498) ~[?:?]

	at org.eclipse.smarthome.core.internal.common.AbstractInvocationHandler.invokeDirect(AbstractInvocationHandler.java:153) [102:org.eclipse.smarthome.core:0.10.0.oh240]

	at org.eclipse.smarthome.core.internal.common.Invocation.call(Invocation.java:53) [102:org.eclipse.smarthome.core:0.10.0.oh240]

	at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:?]

	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:?]

	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:?]

	at java.lang.Thread.run(Thread.java:748) [?:?]

The "’-sign is good though because without them I get this error:

An error occurred during the script execution: Couldn't invoke 'assignValueTo' for feature JvmVoid:  (eProxyURI: schedule.rules#|::0.2.8.2.0.0.7.0::0::/1)

SendCommand.sendCommand(“AA=4 & DA=18”) does not result in any error, I just see this in the log:

Item 'SendCommand' received command AA=4 & DA=18

2019-01-31 22:45:00.385 [nt.ItemStatePredictedEvent] - SendCommand predicted to become AA=4 & DA=18

2019-01-31 22:45:00.387 [vent.ItemStateChangedEvent] - SendCommand changed from PS=18 to AA=4 & DA=18

But unfortunately there is no feed back about the water pressure.:disappointed_relieved:

I think the correct command should be AA=18 in this case. PS=18 is an invalid command I think, only PS=1 or PS=0 seem valid for this command. When you send PS=1 the gateway will print a status report. Not sure of that feedback is actually working with the binding. You can also try the Opentherm Monitor application for that. That’s a handy utility anyway to check the data being sent.

Bingo! Thank you @bleepbleep! I issued the following command once:

SendCommand.sendCommand("AA=18")

And I waited. I though it was not doing anything and suddenly I received the current pressure in my app! Then I was afraid that I had to send this command every time I wanted the waterpressure to be logged, but that is not the case. It’s changing every once in a while (but in the third decimal of course).
Thank you very much!

Glad you got it working. This setting remains in the gateway memory even after a reboot.

Hi,
I was wondering if someone here uses the OTGW from nodo-shop.
Does the polarity of the power connector matter? I ordered the board + 9V-24V power supply, but this power supply has customable connectors, and those can be connected with different polarity.
Does the polarity matter for the OTGW from nodo-shop? If so, should + be on the pole, or on the “shield”?

Thanks

Hi Krzysztof

I don’t have the OTGW from nodo-shop but generally speaking polarity does matter when it comes to DC and then usually the + is on the pole and - or ground on the ‘shield’ as you describe it. Diodes and elco’s are also good indicators of how the polarity should be. And it’s usually also etched into the PCB near the connector soldering points.

And if you’re still not sure, ask nodo :wink:

I already build 3 otgws from nodo shop.
The otgw has a diode to protect from wrong polarity. But the plus should indeed be on the pole.
But I guess you already found out.

Yeah, I just plugged it in randomly and hoped for the best :slight_smile: and it worked, I don’t even remember which was it was.

The board doesn’t have any plus or minus sign on the board so I had to guess.

Hi Arjen,

Thank you for your efforts to create the OTGW binding!
I just switched from Domoticz to openHAB.
With Domoticz I had directly connected the OT to a RPi by USB.
Can this also be possible with your binding?
Maybe with a workarround?

Thanks!

Ronald

Hi Ronald,

Currently the OTGW binding only supports a TCP connection to the gateway, since that is what I am using and so far everyone that I know of… however the code of the binding is set up in such a way that it allows for adding support for other types of connections… such as USB.

I wouldn’t mind developing the USB connection, but I would rely on you for testing and providing feedback. Another thing is that I am currently renovating my house which takes up a lot of my time. So I can’t start working on the USB connection for at least two months.

So, if you are not in a rush… I would gladly work on supporting USB.

In the mean time… you may want to look at using MQTT with OTMonitor or add a serial to ethernet converter.