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 (61 votes)

Support Us:

Add comment:

Add comment

Newest articles in blog

Shelly OpenHAB MQTT
Shelly vs OpenHABRating: 
80%

The Shelly brand is known for its products that primarily communicate over WiFi, including smart plugs, relay switches, blinds control relays, and many other devices. One of the advantages for deployment is the ability to both read and control these devices using the universal MQTT protocol. Across existing add-ons for both OpenHAB and Home Assistant, we will demonstrate how to use Shelly devices without installing any additional extensions.

Victron & OpenHAB
Victron vs Smart HomeRating: 
0%

In this post, we will show you how to retrieve information from a photovoltaic power plant by Victron. We will connect to the Cerbo unit via MQTT. Based on these values, we can control various appliances (heating, boiler, etc.) and prevent the battery from being drained when they don't need to be.

Smart Home GoodWe inverter
Smart Home vs GoodWeRating: 
50%

In the post, we will demonstrate step by step how to communicate directly with the GoodWe inverter in a smart home setup and obtain real-time information (unlike the SEMS portal). This information is essential if we want to react to current parameters in a smart home, such as activating additional cooling or controlling a socket with a various load.

Voice control smart home
Voice control of the houseRating: 
60%

In this article, we will connect the Amazon Echo Dot voice assistant with open source home automation. We won't be using OpenHAB Cloud, so everything runs locally. In this case, a few additional settings are necessary, but the result is worth it!

MikroTik - Winbox, DHCP, Ranges
Basics - Winbox, DHCPRating: 
68.7%

In this series, we will look at the step-by-step setup of MikroTik devices for home users or a small business (up to 25 people). In the first article, we will focus on the initial setup - we will download Winbox and set up DHCP for the primary network and guest network. Similarly, we will also adjust the WiFi settings.

Alarm Smart Home PIR
Alarm from existing PIR sensors in a smart home.Rating: 
0%

In a your smart home, PIR sensors may not only be used to switch lights on and off based on motion, it is possible to utilize these sensors to detect the presence of motion in a particular room. This information can be used to create a relatively reliable uncertified home security system. In this guide, you will find the logic for how this can work in the OpenHAB software in our model smart home.

NFC Tag Example in Smart Home
NFC tags in smart homeRating: 
80%

NFC (Near Field Communication) tags are small plastic or paper stickers that can be used to automate various functions in the smart home. In this article, we will show you examples of use and a guide on how to write an action on an NFC tag using a mobile phone.

WireGuard iOS
WireGuard on iOS devicesRating: 
85%

In this article, you will find a detailed guide on how to connect to WireGuard VPN from iOS.

WireGuard on Android device
WireGuard on Android devicesRating: 
0%

In this article, you will find a detailed guide on how to connect to WireGuard VPN from Android.

WireGuard on MikroTikRating: 
80%

This article describes the self setup of the WireGuard VPN protocol on MikroTik devices with RouterOS version 7 and higher. This phenomenal VPN is very fast, secure, and easily configurable in a home environment. It can be said that it is currently the best VPN for home use available.