1. Home
  2. Docs
  3. H60/H66 Gateway Manual
  4. Modbus TCP Integrations
  5. OpenHAB setup guide

OpenHAB setup guide

This is a basic guide to setup Modbus TCP H60 integration for openHAB. The guide may not be 100% complete but gives a good start for the integration.

The guide is based on openHAB 4.1.

Prepare your H66 for Modbus
• Login to the web interface of H66
• Enable Modbus TCP in the configuration by setting ht port to 502
• Restart H66 and log in again
• Note that the start page now has a Modbus ID for each heat pump sensor and parameter.

Install the Modbus Binding and the JavaScript Scripting Automation (once)
• Under Administration select Add-on Store and Bindings tab (default), press Show More and search for the Modbus binding, then press Install to install it.
• Under Administration select Add-on Store and Automation tab and install “JavaScript Scripting”

Add Transformation JavaScript

The data from the Heat pump is often multiplied by 10, e.g. for temperature values. To divide the data for correct appearance you have to add a transformation to the data readers.
Using a text editor, paste in the following code and save it as file divide10.js.


(function(inputData) {
var DIVIDE_BY = 10;
return parseFloat(inputData) / DIVIDE_BY;
})(input)

Add the file to the folder $OPENHAB_CONF/transform of your openHAB installation.

Create the Modbus binding TCP Slave (once)
• Select Administration->Things, hit + and then click on Modbus Binding
• Select “Modbus TCP Slave”
• The Label could be set to “H66 Modbus TCP Slave”
• Enter the IP address for your H60
• Enter the port for Modbus, usually 502
• Leave all other configuration parameters with their default values
• Press Create Thing and make sure the newly created thing’s status is Online and green

Add Modbus binding Regular Pollers (for every data type)
You must configure one Regular Poller per data type and Modbus ID interval, so at least 2 are necessary to read out Temperature and Status data types.
Login to your H66 and check the Modbus-ID list of your heat pump.

• Select Administration->Things, hit + and then click on Modbus Binding
• Select “Regular Poll”
• Give it a Label, for example: “Poll Temperatures 0-15”
• Select the “H66 Modbus TCP Slave” as Bridge
• Set Poll Interval to 10000 for polling every 10 second
• Start is 0 for the first register from the H60
• Length is how many temperature sensors of your HP you will poll. Set it to 16 to read out all heat pump temperatures from id 0 to 15
• Select Type to be “Input register”
• Leave all other configuration parameters with their default values
• Press Create Thing and make sure the newly created thing’s status is Online and green

Add Modbus Data Readers (for every parameter you want to read)
You must add one Modbus Data reader per value you like to read out from the heat pump.

• Select Administration->Things, hit + and then click on Modbus Binding
• Select “Modbus Data”
• Give it a name, for example “Outdoor temperature”
• Select bridge that should be the appropriate Poller for this Modbus ID
• Set Read Address for the sensor ID, for example 7 (see H60 list in the web interface)
• If the value from the Heat pump is a temperature, then it needs to be transformed by division of 10. Set Read Transform to JS:divide10.js
• Select Read Value Type to “16bit signed integer (int16)”
• Leave all other configuration parameters with their default values
• Press Create Thing and make sure the newly created thing’s status is Online and green

Add your Heat Pump in your Model (for every defined Data Reader)
• Select Administration->Model and navigate in your tree to the suitable room, e.g. Basement. Press Add Equipment and add your Heat Pump model as a new equipment in your selected room.
• Select your newly created Heat Pump and then press Create Points from Thing
• Press Thing and search for the name of your Data Reader
• If type is a temperature, choose “Value as Number”
• Change Label to your Data Reader Label
• Set Dimension to Temperature (°C)
• Set Category to temperature
• Press “Add to Model”
• Select the newly created Point and press Add Metadata and then State Description
• In the new window enter %.1f %unit% in the Pattern text-box, then press “Save”

Verifying
Now all is configured for your first read out from the heat pump.
Select Administration->Things to make sure all things are online and green. If not, check your configurations.
If all green, go to Administration->Model and navigate to your created Heat Pump equipment and you should be able to view the data from the heat pump in all the created Points/Items.

 

 

 

How can we help?