Nilan VP18 vs OpenHAB

Nilan VP18 vs OpenHAB

We provide tutorial for the connection of the active Nilan recuperation unit, in our case the VP18 K WT type with OpenHAB 3. By communicating via Modbus it is possible to read the whole range of values, but mainly also to control the unit through OpenHAB. This allows us to remotely or programmatically change the performance and ventilation settings depending on the mode (night, cooking, etc.)

Hardware

USB to RS485 adapter

Pi-Home - see section How to

Software

OpenHAB 3

Wirin Nilan and USB -> RS485 dongle

We have ~ 5m distance between ventilation unit USB-RS485 dongle. We used classic Cat 5 UTP cable for wiring.

Brown - > A1 - A

Orange -> B1 - B

Blue -> GND - GND

Nilan Modbus Wiring

Configuration of USB -> RS485 dongle

In this tutorial we have tested Raspberry Pi 4 8GB board with OpenHAB 3.4 installed. We have exactly this model of converter, but other similar models should work as well. Critical is setting UDEV rule to create symlink to /dev/tty*. When selecting the default (e.g. /dev/ttyUSB0) it didn't work in OpenHAB 3 and it listed an error for us, so this step is crucial!.

Let's go. Connect USB-RS485 dongle to Rpi. Connect to Rpi via SSH. Add user openhab to groups dialout and tty:

$ sudo adduser openhab dialout

$ sudo adduser openhab tty

then shows detials about your converter:

$ sudo lsusb -v | grep 'idVendor\|idProduct\|iProduct\|iSerial'

You should get similar inforamtion as below. Focuse to green rectangle.

RS485-USB-Raspberry Pi

Write down values for idVendor, idProduct and iserial. Then add UDEV rule, which creates symlink

and gives the path"ttyUSB-RS485"

$ sudo nano /etc/udev/rules.d/99-usb-serial.rules

copy row below (edit based on your values!) 

SUBSYSTEM=="tty", ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6001", ATTRS{serial}=="AG0JHQYU", SYMLINK+="ttyUSB-RS485"

Restart Rpi.

Application

After the restart, go to OpenHAB. In the Settings -> Bindings section, install the binding Modbus. On the Other tab, install the Javascript Transformation extension. You can use Search as well.

Modbus Binding OpenHAB  Javascript Transformation OpenHAB

After installing the extension, go to Things and add a new entry with the icon + -> Modbus Binding -> Modbus Serial Slave

Fill the values according to the picture below:

Modbus Serial Slave OpenHAB

Modbus Serial Slave should be in "Online" state. Then we add another thing, icon + -> Modbus Binding -> Regular Poll. Fill in as follows:

Modbus Regular Poll

We add two more things  + -> Modbus Binding ->Modbus Data.

First Thing provides On/Off switching of the Nilan unit:

Modbus OpenHAB Nilan On/Off

Modbus OpenHAB Nilan On/Off

Second Thing provides ventilation setting:

Modbus OpenHAB Nilan Vent

Modbus OpenHAB Nilan Vent

All you have to do is add your own Items. If you click on Channel and select Add Equipment to Model at the bottom, you can create an Item directly. Select "Value as Switch" type and fill in Name and Label, you can add an icon (Category):

Modbus Nilan Control Run Set

Same for ventilation setting:

Nilan Vent Set

See result as example when you present new items in Overview pane:

NIlan OpenHAB Integration

Of course, you can add lots of other Regular Polls and Modbus Data. For a complete list of values that can be read or set, see the Modbus Protocol Guide for VP18 below. If there are multiple values, you don't have to click it in Things and Items, but you can always add these values in bulk either by importing or copying the *.items and *.things files to their respective directories in OpenHAB conf. We attached configuration of items and things with multiple values (temperatures, controls). There are also transformations that adjust the values from Nilan (ie. temperature reads *100 needs to correct the value at final)

Sources

https://www.en.nilan.dk/

https://community.openhab.org/t/how-to-connect-nilan-cts602-modbus-interface/71263

 

Attachments

PDF icon ct602_modbus_protocol.pdf

PDF icon nilanvp18_openhab_things_items_transformation.zip

Rate the article:

Average: 3.4 (54 votes)

Support Us:

Add comment:

Add comment

Newest articles in blog

Nilan VP18 vs OpenHABRating: 
67.4%

We provide tutorial for the connection of the active Nilan recuperation unit, in our case the VP18 K WT type with OpenHAB 3. By communicating via Modbus it is possible to read the whole range of values, but mainly also to control the unit through OpenHAB. This allows us to remotely or programmatically change the performance and ventilation settings depending on the mode (night, cooking, etc.)

PiHome - Chytry dum mereni spotreby elektriny
Energy meter in smart homeRating: 
70.4%

We are providing a simple step-by-step tutorial how to install home energy meter. We did not find any MQTT device, so we buy Aeotec Home Energy Meter as we are already have a Z-Wave controlller in our smart home.

Centrální tablet pro chytrý dům
Wall tablet to controll your smart homeRating: 
100%

Wall tablet or older smartphone is perfectly suited as a central indicator of the state of the home, as well as controlling it. It usually replaces the video doorbell and as example, you can play your favorite music or read recipes on it during cooking in your kitchen. In the article, we describe a functional example of such a "wall" tablet and its settings in so-called kiosk mode so, display doesn't run at night and only reacts when someone is nearby.

Jablotron and smarthome synchronization
Connecting Jablotron with OpenHABRating: 
80%

In this article we will show you how to install Jablotron binding in OpenHAB. This binding helps us to synchronize states from Jablotron alarm to OpenHAB. Typically, you can force to switch off lights, close water pipe and circulation, switch off sockets or whatever you want to do when you leave home and set alarm.

Advanced disk cloningRating: 
0%

The classic disk cloning tool in linux is the dd command. This command creates a image of disk or extracts the contents from the image to disk. The dd tool needs to be handled carefully and you need to understand its use. We'll show a more advanced technique of creating a disc image that contains unallocated space. A classic example is when I have a Raspbian operating system installed on a 250 GB disc, but there's only a tiny boot partition (e.g. sda1) and my own operating system partition (sda2) which together have 15 GB. Instead of saving a 250 GB image, I would like to save only two partitions with 15 GB, so that the image is smaller and can be expanded to 16 or 32 GB flash.

iOS OpenVPN Connection SettingsRating: 
60%

In this article you will find detailed instructions on how to connect to OpenVPN from iOS devices.

Android OpenVPN Connection SettingsRating: 
80%

In this article you will find detailed instructions on how to connect to OpenVPN on Android.

OpenVPN on MikroTik routersRating: 
70%

If you have a smart-home, NAS, etc., it's a good idea to think about safe access to your network when you are not at home. Currently I recommend commercial router like Turris or a cheaper option of MikroTik routers. In the other hand, Raspberry Pi can be used as OpenVPN server too. In this article, we will show how to set up secure access to your home network from the internet using OpenVPN on MikroTik routers.

Video intercom Doorbird in OpenHABRating: 
0%

Native support for OpenHAB is provided by video intercom by Doorbird company. The solution is powered and connected by a UTP cable and has its own IP address to make it easier for you to install at the gate. OpenHAB is then able to import images from the intercom, visit history, manage gate opening on the button and by the phone, do not disturb feature during night, alarm feature etc. In the instructions we guide you how to use OpenHAB with Doorbird D101.