OpenTherm Gateway binding

Hello Arjen,
thank you very much for all your work and sharing it with us!
I recently bought the OTGW from Nodo-shop with UTP-connector. I can reach it with my browser and login in the webinterface. I have set the settings according to the manual from nodo-shop, setting it to port 23 (is this for communication to the heater/thermostat or for UTP communication to openhab?). In openhab I have your binding version 0.7 running, but it does not get any information and in the log I see ‘cennexion refused’. In paperUI I set the right IP and port nr 23 in the thing-config. I also tryed port 80 here, since the webinterface is on port 80, but that doesn’t work either.
So I must be doing something wrong and I hope you can help me.
For starters: does it matter whether I put the wires of the boiler one way or the other? (And same for the wires to the thermostat?).
In your examples the OTGW gets number ‘1’. For some reason, my thing has nr ‘b8663928’. I changed the items accordingly. Could this be the problem?
I have tryed the OT0monitor software, but I think this requires an usb-connection? I only have utp with my OTGW from nodo-shop.
Also the web-interface on the OTGW from nodoshop does not provide any communication to/with the heater or the thermostat, just settings.
Do you have any other tips for debugging?

Debug log says:

2018-12-27 10:53:37.395 [INFO ] [eway.handler.OpenThermGatewayHandler] - OpenTherm Gateway connector started

2018-12-27 10:53:37.400 [INFO ] [eway.handler.OpenThermGatewayHandler] - Connecting OpenThermGatewaySocketConnector to 192.168.0.6:23

2018-12-27 10:53:37.436 [DEBUG] [eway.handler.OpenThermGatewayHandler] - OpenThermGatewaySocketConnector connected

2018-12-27 10:53:37.445 [hingStatusInfoChangedEvent] - 'openthermgateway:otgw:b8663928' changed from OFFLINE to ONLINE

2018-12-27 10:53:37.440 [DEBUG] [eway.handler.OpenThermGatewayHandler] - Sending message: PR=A

2018-12-27 10:53:37.449 [DEBUG] [eway.handler.OpenThermGatewayHandler] - Sending message: PS=0

2018-12-27 10:53:42.465 [ERROR] [eway.handler.OpenThermGatewayHandler] - An error occured in OpenThermGatewaySocketConnector: Read timed out

2018-12-27 10:53:42.468 [DEBUG] [eway.handler.OpenThermGatewayHandler] - OpenThermGatewaySocketConnector disconnected

2018-12-27 10:53:42.472 [hingStatusInfoChangedEvent] - 'openthermgateway:otgw:b8663928' changed from ONLINE to OFFLINE

2018-12-27 10:53:46.980 [INFO ] [eway.handler.OpenThermGatewayHandler] - Starting OpenTherm Gateway connector

2018-12-27 10:53:46.984 [INFO ] [eway.handler.OpenThermGatewayHandler] - OpenTherm Gateway connector started

2018-12-27 10:53:46.986 [INFO ] [eway.handler.OpenThermGatewayHandler] - Connecting OpenThermGatewaySocketConnector to 192.168.0.6:23

2018-12-27 10:53:47.007 [hingStatusInfoChangedEvent] - 'openthermgateway:otgw:b8663928' changed from OFFLINE to ONLINE

2018-12-27 10:53:47.005 [DEBUG] [eway.handler.OpenThermGatewayHandler] - OpenThermGatewaySocketConnector connected

2018-12-27 10:53:47.012 [DEBUG] [eway.handler.OpenThermGatewayHandler] - Sending message: PR=A

2018-12-27 10:53:47.016 [DEBUG] [eway.handler.OpenThermGatewayHandler] - Sending message: PS=0

2018-12-27 10:53:52.028 [ERROR] [eway.handler.OpenThermGatewayHandler] - An error occured in OpenThermGatewaySocketConnector: Read timed out

2018-12-27 10:53:52.036 [DEBUG] [eway.handler.OpenThermGatewayHandler] - OpenThermGatewaySocketConnector disconnected

2018-12-27 10:53:52.043 [hingStatusInfoChangedEvent] - 'openthermgateway:otgw:b8663928' changed from ONLINE to OFFLINE

2018-12-27 10:53:56.950 [INFO ] [eway.handler.OpenThermGatewayHandler] - Starting OpenTherm Gateway connector

2018-12-27 10:53:56.959 [INFO ] [eway.handler.OpenThermGatewayHandler] - OpenTherm Gateway connector started

2018-12-27 10:53:56.962 [INFO ] [eway.handler.OpenThermGatewayHandler] - Connecting OpenThermGatewaySocketConnector to 192.168.0.6:23

2018-12-27 10:53:56.979 [hingStatusInfoChangedEvent] - 'openthermgateway:otgw:b8663928' changed from OFFLINE to ONLINE

2018-12-27 10:53:56.980 [DEBUG] [eway.handler.OpenThermGatewayHandler] - OpenThermGatewaySocketConnector connected

2018-12-27 10:53:56.995 [DEBUG] [eway.handler.OpenThermGatewayHandler] - Sending message: PR=A

2018-12-27 10:53:56.997 [DEBUG] [eway.handler.OpenThermGatewayHandler] - Sending message: PS=0

2018-12-27 10:54:02.009 [ERROR] [eway.handler.OpenThermGatewayHandler] - An error occured in OpenThermGatewaySocketConnector: Read timed out

2018-12-27 10:54:02.012 [DEBUG] [eway.handler.OpenThermGatewayHandler] - OpenThermGatewaySocketConnector disconnected

2018-12-27 10:54:02.016 [hingStatusInfoChangedEvent] - 'openthermgateway:otgw:b8663928' changed from ONLINE to OFFLINE

Hi,

I would first try to use the otmonitor program. Under Options->Connections you can enter host and port.

The log shows you can connect to port 23 but the OTGW does not respond as expected. This can be a misconfiguration of hte ethrnet interface or a problemen with the serial interface between OTGW and the enthernet interface. Please take a look at http://otgw.tclcode.com/debugging.html for troubleshooting advice.

The webconfig is just for the ethernet interface, not for the otgw itself.

I use it with the wifi (nodo) option myself so config is different.

The 1 versus b8663928 should not matter. I simply configured it manually in openhab.

Thanx for your reply.
I got OT-monitor to trying to connect, but no succes. The log file only shows: ;;;;;;;;;;;;;;;20181227;12:49:30 .
I would like to try the debugging steps mentioned at tclcode.com, but these must be for the version where the 20V adapter is on the board. My version is the smc-version with external power adapter. I am affraid the steps don’t translate.
But I will try and start with checking resistances etc as mentioned, see what comes up.

With a little help from Nodo-shop I got it working! The manual was clear for usb/wifi-setup, but not so clear for utp-version which I have. I needed to add jumpers the same way I would have needed for wifi-setup.

Now I get almost all data except for ‘Domestic hot water temperature’, ‘Domestic hot water setpoint’, ‘Domestic hot water setpoint override’ ‘Return water temperature’ and ‘Central heating water pressure’.

I wonder if this has to do with the fact that I have an Intergas HRECO. I’ve read that Intergas needs another firmware on thhe OTGW? But I do not know if this is possible with my version of the OTGW (from nodo-shop).

Also, I have two lines in my log from OTMonitor that are pictured in red. Does anybody know what these are all about?

|BE0020000|Data-Inv  |Master configuration: 00000000 0|
|B60050000|Data-Inv  |Application-specific flags: 00000000 0|

It could be that these are simply not supported by boiler and/or thermostat. It is not related to the openhab implementation as far as I can see.

Compatibility tables:
http://otgw.tclcode.com/matrix.cgi#boilers
And protocol reference, to look up the message ids:

You are probably better off with these questions on: https://www.domoticaforum.eu/viewforum.php?f=75

According to the table, my boiler does support Ch18(water pressure), but my thermostat does not. Does this mean it’s not supported by the combination and will not work? Or do I need only the boiler to support this? (Since it’s the boiler that provides this info)

Hi Guido,

Glad you got it working, for the most part anyway.

“But I do not know if this is possible with my version of the OTGW”

From what I’ve seen, the Nodo shop variant of the OTGW uses SMD components and therefor a slightly different PCB, but it still uses the same PIC processor. So, in general: yes, with a PIC programmer it would be possible to replace the firmware.

“Or do I need only the boiler to support this? (Since it’s the boiler that provides this info)”

While it is indeed the boiler that provides this info, the thermostat needs to ‘ask’ for it, so that the OTGW can pick up the response message sent from the boiler. So if the thermostat never asks for the water pressure, the boiler is not going to report it.

And as far as I know there is no command available on the OTGW to have it request the water pressure. However, there is an AA (Add Alternative) command which may be helpful in this situation. I have no experience in using this AA command though.

Of course getting a thermostat that supports reading water pressure should also work.

Thanks for your help and patience! Cheers!

Hello Arjen,

Nice work, I was able to connect everything pretty easily to get boiler information and set points in openHAB.

I have installed version 0.7 (I need CS to setup the control set-point).

The odd thing is that the outside temperature reportecs is 124.85°C (it should be -3.15).

OTMonitor log:

|19:18:27.824291|T80190000|Read-Data |Boiler water temperature: 0.00|
|19:18:27.865651|B40193CCC|Read-Ack  |Boiler water temperature: 60.80|
|19:18:28.566904|T801A0000|Read-Data |DHW temperature: 0.00|
|19:18:28.665434|BC01A2FCF|Read-Ack  |DHW temperature: 47.81|
|19:18:29.620405|T001B0000|Read-Data |Outside temperature: 0.00|
**|19:18:29.745174|B401BFCDA|Read-Ack  |Outside temperature: -3.15|**
|19:18:30.674996|T801C0000|Read-Data |Return water temperature: 0.00|
|19:18:30.824826|BC01C2B19|Read-Ack  |Return water temperature: 43.10|
|19:18:31.728462|T00300000|Read-Data |DHW setpoint boundaries: 0 0|
|19:18:31.821165|BC0303C05|Read-Ack  |DHW setpoint boundaries: 60 5|
|19:18:32.782475|T80380000|Read-Data |DHW setpoint: 0.00|
|19:18:32.904943|B40382E00|Read-Ack  |DHW setpoint: 46.00|

OpenHAB log:

20:18:28.676 [DEBUG] [teway.handler.OpenThermGatewayHandler] - Received update for channel 'dhwtemp': 47.80859375
20:18:28.694 [INFO ] [smarthome.event.ItemStateChangedEvent] - OpenThermGateway_DomesticHotWaterTemperature changed from 47.796875 to 47.80859375
20:18:29.624 [DEBUG] [teway.handler.OpenThermGatewayHandler] - Received message: T001B0000, 27 T ReadData
20:18:29.749 [DEBUG] [teway.handler.OpenThermGatewayHandler] - Received message: B401BFCDA, 27 B ReadAck
**20:18:29.755 [DEBUG] [teway.handler.OpenThermGatewayHandler] - Received update for channel 'outsidetemp': 124.8515625**
20:18:29.773 [INFO ] [smarthome.event.ItemStateChangedEvent] - OpenThermGateway_OutsideTemperature changed from 124.80078125 to 124.8515625
20:18:30.678 [DEBUG] [teway.handler.OpenThermGatewayHandler] - Received message: T801C0000, 28 T ReadData

20:18:30.828 [DEBUG] [teway.handler.OpenThermGatewayHandler] - Received message: BC01C2B19, 28 B ReadAck
20:18:30.834 [DEBUG] [teway.handler.OpenThermGatewayHandler] - Received update for channel ‘returntemp’: 43.09765625

Any idea what is happening?

Thanks for any help and happy new year!

Arnaud

Hi Arnaud,

Took me a while, but I think I figured out how to convert a negative value of FCDA using f8.8 format which is a signed fixed point value. Apperantly I need to handle the entire value as a two’s complement and not just the integer part.

Anyway, I hope I find some time this week to modify the function that converts the value and upload a new version of the binding.

Glad you figured it out :-). It is pretty cold these days in the alps so température are around 120°.

Wish I could help, but I hardly understood the issue. So thanks again!

Cheers,

Arnaud

Hi, for me everything I want is working, some items are not updated but that may have to do with compatibility of my boiler and thermostat. But sometimes I get this error in my log about Roomsetpoint. But the Roomsetpoint is working perfectly. Does anybody know what this means and how I might get rid of these error messages?

2019-01-10 15:40:00.321 [ERROR] [eway.handler.OpenThermGatewayHandler] - error

java.lang.Exception: Unknown channel roomsetpoint

	at org.openhab.binding.openthermgateway.handler.OpenThermGatewayHandler.getGatewayCodeFromChannel(OpenThermGatewayHandler.java:302) ~[191:org.openhab.binding.openthermgateway:0.7.0]

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

	at sun.reflect.GeneratedMethodAccessor93.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.$Proxy131.handleCommand(Unknown Source) [191: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.GeneratedMethodAccessor92.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) [?:?]


@algol I have uploaded version 0.8.0 which should fix the parsing of negative temperature values.

@Guido_van_Haasteren Roomsetpoint is a read-only channel; it only reports the value read by the thermostat. The error is caused by writing a value to the roomsetpoint channel. Please use the TemperatureTemporary or TemperatureConstant channel to set the room temperature setpoint.

@Mephix: sorry: slip of the key board:grin:. I mistakenly tried setting the roomtemperature in setad of the setpoint. Thanx for your explanation!

Thanks Arjen, working like a charm: -7.4 °C

Hi, i found another 2 versions of DIY gateways:
v1
https://translate.google.ru/translate?sl=auto&tl=en&u=http%3A%2F%2Fmodkam.ru%2F%3Fp%3D468

v2
https://translate.google.ru/translate?hl=&sl=auto&tl=en&u=http%3A%2F%2Fmodkam.ru%2F%3Fp%3D806

@PGustias ,

Peter, I am curious how your sitemap is configured. What do you get when you click the little arrow?

kr

Han

Hi Han,

You get a selection box with mappings :
Mappings%20temporary%20Override

A selection of temperatures lower than 16°C is irrelevant for me, but I need the zero for turning off the override. Very helpful on a mobile device !
(My thermostat supports only a setpoint override with a resolution of 1 degree).

I would like to thank Arjen for this fantastic binding, I use version 0.7.0 for more than 2 months without any issue, so this version solves al my disconnection problems !
And I have no problems with the external temperature like Arnaud.

Kind regards,
Peter.

My thermostat sitemap :

sitemap thermostaat label="thermostaat"
{
    Frame
        {
            Text item=OpenThermGateway_RoomTemperature label="Kamertemperatuur [%.1f °C]" icon="temperature" valuecolor=[OpenThermGateway_RoomTemperature_LastUpdate=="NULL"="gray",OpenThermGateway_RoomTemperature_LastUpdate>300="black",OpenThermGateway_RoomTemperature_LastUpdate>150="orange",OpenThermGateway_RoomTemperature_LastUpdate<=150="green"] 
            Text item=OpenThermGateway_RoomTemperature_LastUpdate label="Last update" valuecolor=[>6000="red",>600="orange",<=600="green"]
            Text item=OpenThermGateway_RoomSetpoint label="Setpoint [%.1f °C]" icon="temperature"
            Selection item=OpenThermGateway_TemporaryRoomSetpointOverride label="Temporary Override" mappings=[0="OFF", 16="16 °C", 18="18 °C", 19="19 °C", 20="20 °C", 21="21 °C", 22="22 °C"] icon="heating"
            Selection item=OpenThermGateway_ConstantRoomSetpointOverride label="Constant Override" mappings=[0="OFF", 16="16 °C", 18="18 °C", 19="19 °C", 20="20 °C", 21="21 °C", 22="22 °C"] icon="heating"
        }
    Frame 
        {
            Selection item=HVAC_Mode label="Heating Mode [%s]" icon="heating" mappings=[OFF="OFF", MANUAL="MANUAL", AUTO="AUTO", ELECTRIC="ELECTRIC", GAS="GAS"]
            Setpoint item=LR_Heating_Setpoint label="Target keuken [%.1f °C]" minValue=16 maxValue=24 step=0.5//mappings=[16="16 °C", 18="18 °C", 19="19 °C", 20="20 °C", 21="21 °C", 22="22 °C"] icon="temperature"
	        Text item=RFXCOMLighting1Radiator_Command label="Electric radiators LR" icon="switch"
            Text item=TEMPERATURE_HUMIDITY56065_Temperature label="Badkamer [%.1f °C]" icon="temperature" valuecolor=[TEMPERATURE_HUMIDITY56065_Temperature_LastUpdate=="NULL"="gray",TEMPERATURE_HUMIDITY56065_Temperature_LastUpdate>300="black",TEMPERATURE_HUMIDITY56065_Temperature_LastUpdate>150="orange",TEMPERATURE_HUMIDITY56065_Temperature_LastUpdate<=150="green"] 
            Text item=TEMPERATURE_HUMIDITY56065_Humidity label="Badkamer [%d %%]" icon="humidity"
            Text item=TEMPERATURE_HUMIDITY56065_Temperature_LastUpdate label="Last update Badkamer" valuecolor=[>6000="red",>600="orange",<=600="green"]
            Setpoint item=BR_Heating_Setpoint label="Target badkamer [%.1f °C]" minValue=16 maxValue=26 step=0.5
	        Text item=RFXCOMLighting1VerwarmingBadkamer_Command label="Convector badkamer" icon="switch"
	    }
    Frame
        {
            Setpoint item=DHW_Heating_Setpoint label="Target Boiler [%.1f °C]" minValue=30 maxValue=60 step=5
            Switch item=RFXCOMLighting1Boiler_Command label="Electric Boiler" icon="switch"Text item=OpenThermGateway_DomesticHotWaterTemperature label="Boiler temperatuur [%.1f °C]" icon="temperature"
            Text item=OpenThermGateway_DomesticHotWaterSetpoint label="Setpoint DHW [%.1f °C]" icon="temperature"
            Selection item=OpenThermGateway_DomesticHotWaterOverrideSetpoint label="Override DHW" mappings=[0="OFF", 30="30 °C", 40="40 °C", 50="45 °C", 50="50 °C", 55="55 °C", 60="60 °C"] icon="heating"
        }
    Frame
        {
            Text item=OpenThermGateway_RelativeModulationLevel label="Ketel [%d %%]" icon="settings" 
                {
                    Text item=OpenThermGateway_ControlSetpoint label="Control Setpoint [%.1f °C]" icon="temperature"
                    Text item=OpenThermGateway_BoilerWaterTemperature label="Ketel [%.1f °C]" icon="flowpipe"
                    Text item=OpenThermGateway_ReturnWaterTemperature label="Return [%.1f °C]" icon="returnpipe"
                    Switch item=OpenThermGateway_BurnerActive label="Brander" icon="fire"
                    Text item=OpenThermGateway_RelativeModulationLevel label="Modulatie [%d %%]" icon="qualityofservice"
                    Switch item=OpenThermGateway_CentralHeatingActive label="CV" icon="radiator"
                    Switch item=OpenThermGateway_DomesticHotWaterActive label="DHW" icon="water"
                    Text item=OpenThermGateway_CentralHeatingWaterPressure label="Water Pressure [%.2f bar]" icon="pressure"
                    Text item=OpenThermGateway_OutsideTemperature label="Buiten [%.1f °C]" icon="temperature"
                }
            }
}

1 Like

Hi Peter,

Glad you like the binding, thank you for testing and providing valuable feedback !

And I have no problems with the external temperature like Arnaud.

That problem only occurs on negative decimal values, ie. on temperatures below zero degrees. I assume that you have not yet had temperatures below zero? Otherwise I’d like to know because then there might be something else going on :roll_eyes:

Cheers!
Arjen

Hi Arjen,

You’re right, I must correct myself.
After an cold night I got this morning the reading 126.5 °C instead of the real -1.5°C outside temperature.

Installing version 0.8.0 correct this issue !

Thanks for the continuous development !!
Kind regards, Peter.