1. Home
  2. Docs
  3. H60 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 god start for the integration.
The guide is based on the PaperUI for configuration.

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


Install the Modbus Binding (once)
• Select “Add-ons” from the Configuraton menu on the left.
• Select “Bindings” form the top menue and Install the Modbus binding.
• Select “Transformations” from the top menu and install “Javascript Transformation”

Add the TCP Slave (once)
• Select Inbox, hit + and enter Modbus Binding
• Select “Modbus TCP Slave”
• The name could be set to “H60 Modbus TCP Slave”
• Enter the IP address for your H60
• Enter the port for Modbus, usually 502
• Save settings

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

• Select Inbox, hit + and enter Modbus Binding
• Select “Regular Poll”
• Give it a name, for example: “Poll Temperatures 0-15”
•Select the H60 bidning as Bridge
•Set interval to 10000ms for every 10 second.
• Start is 0 for the first register from H60
• Length how many temperature sensors of your HP you will poll. Set to 16 to read out all heat pump temperatures from id 0 to 15
• Select Type Input register
• Save settings


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

• Select Inbox, hit + and enter Modbus Binding
• Select “Modbus data”
• Give it a name, for example “Outdoor temperature”
• Select bridge that should be the appropriate Poller for this ID
• Set Read address for the sensor ID, for example 7 (see H60 list in we interface)
• Select Read Value Type to 16 bit signed integer
• Save Setting

Link to Channel (for every added data reader)
• Click in the newly configured Data reader and select only channel “Value as Number”

Verifying
Now all is configured for your first read out from the heat pump.
Select Configuration->Things to make sure all things are online and green. If not, check configurations.
If all green, go to “Control” and you should be able to view the data from the heat pump.

Transform the data
The data from the heatpump is often multiplied by 10. To divide the data for correct appearence 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 openhab2/conf/transform (Windows) or etc/openhab2/transform (Linux) of you openHAB installation.
In respective Datareader setting, on Read Transform, change from “default” to “JS(divide10.js)”

How can we help?