OpenTherm Gateway binding


would it be possible to add a variable that represents the gateway to be online or offline? Today (for the first time) my OTGW crashed (not the serial to ethernet interface). There is no indication whatshowever that the gateway is down, only the fact that the values do not change. I noticed that in the software of Schelte Bron (the iPhone webpage) a little hart is shown to indicate that the gateway is online. In the attachment it can be seen in the right top corner.

What are your thoughts on this?

kind regards


Hi Han,

The binding knows about having a socket connection to the gateway and that’s where the Online or Offline status is based on. If you say the OTGW itself crashed, but the ethernet interface is still online… then the binding will probably still have it’s active socket connection and assume the OTGW is available.

One thing that could be improved about the binding, is checking if messages are successfully received. Currently, the binding just sends TT=20 but it doesn’t actually look for the TT:20.0 response or any other response such as an error code, or the lack of a response, for verification. Also, the binding doesn’t automatically re-send a message in case such responses aren’t received.

So I guess that should be the way to implement this. Send a message, keep it in memory until we’ve received a proper response. Otherwise, after a few seconds, re-send the message and after x times of re-sending, indicate an error status.

That way, if the socket is still open and receiving messages, but the OTGW itself doesn’t respond… this would automatically lead to an error indicating there is something wrong with the OTGW.





Hi Arjen,

Ok thats clear yes i have my OTGW on gateway. In order to use the OTGW with openhab without a thermostat, i need to be able to control from OpenHab:

CS < Control setpoint
CH < Central Heating
MM < Modulation

I can control these values from OTmonitor, but i think i noticed that in the binding these channels are readonly is that correct?


Hi Mic,

I have uploaded version 0.6.0 that contains a new SendCommand channel. This is a text type channel that allows you to send any command you want in the form of “XX=value” where XX is any of the commands listed here:

With the way the OTGW works sending commands and receiving status updates are two different and more or less unrelated things. You send a command and some moments later you receive a status update that may or may not reflect the changes you want. And some commands don’t change the status at all.

To support all possible OTGW commands, I would have to implement a channel for each one of them, on top of all the channels that are used for reporting the values. Which would get very messy in my opinion. So I am thinking of removing the override channels for temporary temperature, constant temperature and dhw temperature and just stick with the reporting channels (read-only) and one channel that allows you to send commands.

Would like to hear from Han, Peter and others if that would work for you as well.


Edit: what do you use AA & DA for ?

Hi Arjen,

The new binding 0.6.0 does not show the new channel it also says its version 0.5.0. But in jar file i can see the additional channel added in the channels.xml(that’s the only thing i know to find in the file). I totally agree with the idea you have over the amount of channels. AA can be used for requesting additional information from the boiler.


Hi Mic,

If it says version 0.5.0, then it’s still the old version running in openHAB memory. The new version will show 0.6.0 and also the new channel.

I don’t really know how you should update the binding, but I tend to remove it with PaperUI, uninstall it with the openHAB console, delete the .jar file… wait a couple of minutes, put in the new .jar file and then wait for openHAB to pick it up again and add it with PaperUI. This might not be the best way to do it… but it saves me from restarting openHAB.



to be honest I do not know what would be the best option. The commands the binding now provides will serve most people that use the OTGW for their information and control needs (If I need to do other stuff I use the ESP that is connected to the gateway because they are at most an onetime change).
When the binding offers an option to send anything then you would have to program this into OH again which maybe may complicate matters for some.

So I would vote for a combination of the two; having certain fixed commands and also a channel that is able to cope with everything.

Kind regards,


Hi Arjen,

Thanks for version 0.6.0, I haven’t test it yet.
I will be happy with a new “SendCommand” channel instead of the existing channels for override, but a combination of the existing override channels and this new channel is maybe even better.

Actually I have a strange behavior with version 0.5.0, after some hours the binding stops with updating the value’s and I don’t see any message anymore in the console.
After re-setting the roomsetpoint override to zero (was zero), everything works fine again.
Very strange, I haven’t seen this issue with the previous versions …



21:18:40.277 [INFO ] [smarthome.event.ItemCommandEvent ] - Item 'OpenThermGateway_TemporaryRoomSetpointOverride' received command 0
21:18:41.475 [INFO ] [smarthome.event.ItemStateChangedEvent] - OpenThermGateway_DomesticHotWaterTemperature changed from 56.796875 to 56.90625
21:18:42.144 [INFO ] [smarthome.event.ItemStateChangedEvent] - OpenThermGateway_RoomTemperature changed from 22.42578125 to 22.40625
21:18:43.165 [INFO ] [smarthome.event.ItemStateChangedEvent] - OpenThermGateway_RoomTemperature_LastUpdate changed from 2018-10-24T18:59:55.210+0200 to 2018-10-24T21:18:41.552+0200
21:18:43.446 [INFO ] [smarthome.event.ItemStateChangedEvent] - OpenThermGateway_DomesticHotWaterTemperature changed from 56.90625 to 56.796875
21:18:44.798 [INFO ] [smarthome.event.ItemStateChangedEvent] - OpenThermGateway_OutsideTemperature changed from 14.734375 to 14.640625
21:18:45.132 [INFO ] [smarthome.event.ItemStateChangedEvent] - OpenThermGateway_RoomTemperature_LastUpdate changed from 2018-10-24T21:18:41.552+0200 to 2018-10-24T21:18:42.863+0200
21:18:45.931 [INFO ] [smarthome.event.ItemStateChangedEvent] - OpenThermGateway_RoomTemperature_LastUpdate changed from 2018-10-24T21:18:42.863+0200 to 2018-10-24T21:18:44.153+0200
21:18:46.000 [INFO ] [smarthome.event.ItemStateChangedEvent] - OpenThermGateway_BoilerWaterTemperature changed from 24.53125 to 24.8125
21:18:46.046 [INFO ] [smarthome.event.ItemStateChangedEvent] - OpenThermGateway_RoomTemperature_LastUpdate changed from 2018-10-24T21:18:44.153+0200 to 2018-10-24T21:18:45.060+0200
21:18:46.102 [INFO ] [smarthome.event.ItemStateChangedEvent] - OpenThermGateway_RoomTemperature_LastUpdate changed from 2018-10-24T21:18:45.060+0200 to 2018-10-24T21:18:45.848+0200
21:18:50.817 [INFO ] [smarthome.event.ItemStateChangedEvent] - OpenThermGateway_BoilerWaterTemperature changed from 24.8125 to 24.671875
21:18:55.149 [INFO ] [smarthome.event.ItemStateChangedEvent] - OpenThermGateway_RoomTemperature changed from 22.40625 to 22.25

21:18:55.225 [INFO ] [smarthome.event.ItemStateChangedEvent] - OpenThermGateway_RoomTemperature_LastUpdate changed from 2018-10-24T21:18:45.848+0200 to 2018-10-24T21:18:55.157+0200
21:18:55.741 [INFO ] [smarthome.event.ItemStateChangedEvent] - OpenThermGateway_BoilerWaterTemperature changed from 24.671875 to 24.8125
21:19:00.772 [INFO ] [smarthome.event.ItemStateChangedEvent] - OpenThermGateway_BoilerWaterTemperature changed from 24.8125 to 24.671875
21:19:05.689 [INFO ] [smarthome.event.ItemStateChangedEvent] - OpenThermGateway_BoilerWaterTemperature changed from 24.671875 to 24.8125
21:19:10.818 [INFO ] [smarthome.event.ItemStateChangedEvent] - OpenThermGateway_BoilerWaterTemperature changed from 24.8125 to 24.671875
21:19:15.739 [INFO ] [smarthome.event.ItemStateChangedEvent] - OpenThermGateway_BoilerWaterTemperature changed from 24.671875 to 24.8125
21:19:30.209 [INFO ] [smarthome.event.ItemStateChangedEvent] - OpenThermGateway_ReturnWaterTemperature changed from 23.953125 to 23.796875
21:19:30.810 [INFO ] [smarthome.event.ItemStateChangedEvent] - OpenThermGateway_BoilerWaterTemperature changed from 24.8125 to 24.671875

Do you have the same experience Han ?

Kind Regards,

Haven’t installed the latest version yet sorry. Because I will not be at home the next week due to holiday and relatives are staying in my house its not so wise to perform an upgrade :thinking:. Will do as soon as I am back.




It seems like it’s loosing connection then, but if you could provide me with some more logging details on DEBUG level, that would help me to better understand what’s going on.

Currently, the binding does automatically reconnect, but only when sending a new command. In the next version, I will add an auto re-connect feature, that upon disconnecting will retry connecting n times with a certain interval. Configurable if desired.

And… thanks a lot for testing and providing feedback! This really allows me to make the binding more stable and feature rich. And yes Han… it’s still a development version, so best not have your relatives rely on it for a warm and cosy place :wink:

Hi Arjen,

Its working loike a charm now. I really don’t know why it kept saying in Paper UI that it was 0.5.0 in Karaf it said the binding was 0.6.0. But i followed the steps you and and now indeed i can see it(and use it :stuck_out_tongue:) Thank you for the effort you put in the binding.


Great Mic, let me know if you run into any issues.

Hi Arjen,

Excellent work. Thank you very much.
I have made some changes (hopefully improvements) and created a pull request

The changes will do:

  • Automatic reconnects when connection is lost
  • Automatically resend commands if not acknowledge by the OTGW (this happens on a regular basis with my OTGW + Nodo ESP Easy WiFi to serial controller)
  • Handle Write Messages which are not acknowledged with proper data (my intergas boiler does not acknowledge roomtemp setting)

Hope you can merge these changes and other can benefit. Keep up the good work!


Hi Arjan,

Thanks a lot for putting in the effort to improve the binding! I have completed the pull request and uploaded a new version 0.7.0.

@PGustias if you still encounter the disconnect problem, have try with this new version

Hi Arjen and Arjan,

Many thanks for this new version and all the effort !
I will try it immediately, because I have still problems with the connection.
Finally I was able to log the disconnection at 16:48 this afternoon, the connection restored this evening after a (manual) TC command at 19:48.

See this log :

2018-11-04 16:48:54.297 [DEBUG] [eway.handler.OpenThermGatewayHandler] - Received update for channel 'ch_enable': OFF
2018-11-04 16:48:54.517 [DEBUG] [eway.handler.OpenThermGatewayHandler] - Received update for channel 'dhw_enable': OFF
2018-11-04 16:48:54.709 [DEBUG] [eway.handler.OpenThermGatewayHandler] - Received update for channel 'ch_mode': OFF
2018-11-04 16:48:54.900 [DEBUG] [eway.handler.OpenThermGatewayHandler] - Received update for channel 'dhw_mode': OFF
2018-11-04 16:48:55.103 [DEBUG] [eway.handler.OpenThermGatewayHandler] - Received update for channel 'flame': OFF
2018-11-04 16:48:55.290 [DEBUG] [eway.handler.OpenThermGatewayHandler] - Received message: T00000000
2018-11-04 16:48:55.461 [ERROR] [eway.handler.OpenThermGatewayHandler] - An error occured in OpenThermGatewaySocketConnector Connection reset
	at [?:?]
	at [?:?]
	at sun.nio.cs.StreamDecoder.readBytes( [?:?]
	at sun.nio.cs.StreamDecoder.implRead( [?:?]
	at [?:?]
	at [?:?]
	at [?:?]
	at [?:?]
	at [?:?]
	at [216:org.openhab.binding.openthermgateway:0.4.0]
	at [?:?]
2018-11-04 19:48:49.364 [DEBUG] [eway.handler.OpenThermGatewayHandler] - Received channel: openthermgateway:otgw:8effc82c:temperatureconstant, command: 16
2018-11-04 19:48:49.783 [INFO ] [eway.handler.OpenThermGatewayHandler] - Starting OpenTherm Gateway connector
2018-11-04 19:48:50.027 [INFO ] [eway.handler.OpenThermGatewayHandler] - OpenTherm Gateway connector started
2018-11-04 19:48:50.027 [DEBUG] [eway.handler.OpenThermGatewayHandler] - Connecting OpenThermGatewaySocketConnector to
2018-11-04 19:48:50.263 [DEBUG] [eway.handler.OpenThermGatewayHandler] - Unable to send message: TC=16. OpenThermGatewaySocketConnector is not connected.
2018-11-04 19:48:50.518 [DEBUG] [eway.handler.OpenThermGatewayHandler] - OpenThermGatewaySocketConnector connected
2018-11-04 19:48:51.331 [DEBUG] [eway.handler.OpenThermGatewayHandler] - Sending message: PR=A
2018-11-04 19:48:51.498 [DEBUG] [eway.handler.OpenThermGatewayHandler] - Sending message: PS=0
2018-11-04 19:48:51.667 [DEBUG] [eway.handler.OpenThermGatewayHandler] - Received message: BC0000000
2018-11-04 19:48:51.850 [DEBUG] [eway.handler.OpenThermGatewayHandler] - Received update for channel 'ch_enable': OFF
2018-11-04 19:48:52.052 [DEBUG] [eway.handler.OpenThermGatewayHandler] - Received update for channel 'dhw_enable': OFF
2018-11-04 19:48:52.255 [DEBUG] [eway.handler.OpenThermGatewayHandler] - Received update for channel 'ch_mode': OFF
2018-11-04 19:48:52.457 [DEBUG] [eway.handler.OpenThermGatewayHandler] - Received update for channel 'dhw_mode': OFF
2018-11-04 19:48:52.694 [DEBUG] [eway.handler.OpenThermGatewayHandler] - Received update for channel 'flame': OFF
2018-11-04 19:48:52.818 [DEBUG] [eway.handler.OpenThermGatewayHandler] - Received message: T10010A00
2018-11-04 19:48:52.991 [DEBUG] [eway.handler.OpenThermGatewayHandler] - Received message: BD0010A00
2018-11-04 19:48:53.164 [DEBUG] [eway.handler.OpenThermGatewayHandler] - Received update for channel 'controlsetpoint': 10.0
2018-11-04 19:48:53.382 [DEBUG] [eway.handler.OpenThermGatewayHandler] - Received message: T90101000
2018-11-04 19:48:53.562 [DEBUG] [eway.handler.OpenThermGatewayHandler] - Received message: B50101000
2018-11-04 19:48:53.734 [DEBUG] [eway.handler.OpenThermGatewayHandler] - Received update for channel 'roomsetpoint': 16.0
2018-11-04 19:48:53.946 [DEBUG] [eway.handler.OpenThermGatewayHandler] - Received message: T80190000
2018-11-04 19:48:54.121 [DEBUG] [eway.handler.OpenThermGatewayHandler] - Received message: BC01915D8
2018-11-04 19:48:54.334 [DEBUG] [eway.handler.OpenThermGatewayHandler] - Received update for channel 'flowtemp': 21.84375
2018-11-04 19:48:54.552 [DEBUG] [eway.handler.OpenThermGatewayHandler] - Received message: T00000000
2018-11-04 19:48:54.726 [DEBUG] [eway.handler.OpenThermGatewayHandler] - Received message: BC0000000
2018-11-04 19:48:54.901 [DEBUG] [eway.handler.OpenThermGatewayHandler] - Received update for channel 'ch_enable': OFF
2018-11-04 19:48:55.105 [DEBUG] [eway.handler.OpenThermGatewayHandler] - Received update for channel 'dhw_enable': OFF
2018-11-04 19:48:55.314 [DEBUG] [eway.handler.OpenThermGatewayHandler] - Received update for channel 'ch_mode': OFF
2018-11-04 19:48:55.514 [DEBUG] [eway.handler.OpenThermGatewayHandler] - Received update for channel 'dhw_mode': OFF
2018-11-04 19:48:55.718 [DEBUG] [eway.handler.OpenThermGatewayHandler] - Received update for channel 'flame': OFF
2018-11-04 19:48:55.975 [DEBUG] [eway.handler.OpenThermGatewayHandler] - Received message: T00000000
2018-11-04 19:48:56.135 [DEBUG] [eway.handler.OpenThermGatewayHandler] - Received message: BC0000000

I’m very curious to see if this new version will restore the connection !!
I will keep you informed.

Kind regards,

I’m new in OpenHAB, coming from Domoticz and very keen on trying to get OpenTherm binding up-and-running… But… When I download the JAR file into my addons folder, I doesn’t appear in PaperUI.

Not even after a reboot.

What am I doing wrong?

Hi Sven,

Downloading the jar into the addons folder should normally do the trick, even without restarting openHAB or rebooting the system. In PaperUI it would appear under Bindings and through adding Things or using .things file you should be able to configure it.

Are you sure you are using the correct addons folder ? On my raspberry pi that’s /usr/share/openhab2/addons. Can you also check the logs to see if any errors occur during startup and loading of the addons?

I’ve put it in the addons folder but it’s not getting recognized. I don’t see it in the logs neither. I don’t get it…

Edit: cleared cache in:

  • /var/lib/openhab2/tmp
  • /var/lib/openhab2/cache

Rebooted the machine but still couldn’t see it.
I had to click on the refresh icon in the right top corner of the page /paperui/index.html#/configuration/bindings
Then it was visible and I could add the ‘configuration thing’.

Hi CarlJ,

Glad you got it working. Let me know if you run into any issues or have any questions regarding the OTGW binding.