Feature request for Nilan Ventilation system (Danish brand)

Hi. Would it be possible to implement af modbus controlled ventilation system into Home Assistant ?

The modbus docs can be found here: https://github.com/DanGunvald/NilanModbus/blob/master/MODBUS_CTS-602_2.16-2.19_Installation-and-user-guide.pdf

This system is widely used in Denmark!

There seems to be an existing integration to openhab, see this link: https://community.openhab.org/t/openhab1-2-nilan-heatpump/23538/18

It should make a potential component development easier, I would think.

seems like there is at least something to start on:https://github.com/jascdk/Nilan300LR-Hassio


I have found this Nilan_Homeassistant on your github and installed it and using your config and i get all the things in home assistant but i dont get any temperatures nor is it online i can change the the fanspeed so sending is ok but reciving seems to be not working as i can see the the i use ttl to rs485 DE pin is connected to D3 RE to D2 Di to Tx and RD to RX no the nodemcu but it seems to only beeing able to send not recive maby i did something wrong i hope you can give me a hint and i i am using the right pins on the nodemcu i have some error in mqtt log ( 1560509802: Socket error on client 00FDF9EF, disconnecting.
1560509802: New connection from on port 1883.
[INFO] found kenn on Home Assistant
1560509805: New client connected from as 00FDF9EF (c1, k15, u’kenn’).

hope to have some ideas seams to me like it never change to recive since i must be half dublex


Hi, i am trying the same @dyrvig and getting the device online, but i can only sent not receive information from my Nilan, did you manage to fix your problem? and can you tell me how i can fix mine?

i solved the problem and i now use it in openhab the problem is that it is required this type of comnication interface https://www.alibaba.com/product-detail/TTL-to-RS485-Adapter-Module-485_60813978083.html?spm=a2700.7724838.2017115.125.4ebe6c0aWPUWYd
it has aut flow control and only needs txd rxd ground and 3.3v from esp8266

i have also made it read and write more registers i will make a github soon then i will share it
i have a nilan compac s with heatpump and water boiler


1 Like

Cool, what is your github?
I will like to get it working in Home-Assistant, but i think i got the right hardware, but not the code yet.


i dont have github yet but i got it from this https://github.com/jascdk/Nilan_Homeassistant i got it to work and also got it to work in Openhab but had too many problems getting everything working so i am back to direct modbus connection and this setup https://github.com/starze/openhab2 pyton script creates all items and sitemap here is a screendump

it has all the modbus registers from all types of Nilan mine is a compact S with active heatexchanger ative cooling and 180l hotwater boiler


1 Like

Hi dyrvig, did you improve anymore your modbus configuration? could you share your config file?

Hi All

I’ve got a Nilan Compact P (with the possibility of modbus-tcp). I’ve setup most of it a while ago, and my configuration could perhaps be useful:

1 Like

Pretty nice, i still need to figure out where all the pins are in the main unit, before hookup it up to hassio.

Do this also work with Genvex ventilation ?
Display Optima 250 DK
Ventilation Genvex GE energi 1
I have connect the Genvex Connect, but it missing some option

The solution does not require genvex connect.
You need a module modbus to your nodemcu and then to the controller.

I think Genvex and Nilan is pretty similar, so lets figure it out.


I did found this modbus PDF online, which show Genvex codes. Se link under message

I have plane to use arduino ESP 8266 and an rs485 converter

Have order parts on ebay

Have an raspberry pi where hHome Assistant will be installed


A quick google search, found something here meaby: https://github.com/jalla2000/kamstrup-mqtt and here: https://github.com/KenanV/KamstrupMultical66


You write (with the possibility of modbus-tcp), does that mean that it was not included in the standard equipment of the Nilan Compact P?

I’m getting the Nilan Compact Air 9, and i’m unsure if the modbus connection is an extra feature I need to buy ?

Br Morten

Hey - I might not have been clear in my wording. I’m using the tcp-modbus connection that came with my Nilan Compact P. I can only assume that it is standard for my model (but I have only seen the one I have). I got it installed as part of a new house.

My wording was chosen this way, because I’ve seen many people use the built in modbus ports, that require more “disassembly”/hacking - attaching various boards to these ports and reading the data via modbus dongles.

I do not have any info on the Compact Air 9, but would assume, that if it is a newer device, it would also have modbus-tcp.


Hi Jakob,
I have been using your config from https://gist.github.com/jakobmoll/c29877d584cc6970e6316173a6e4b561
and everything is working fine, i get data and can use them. Thanks for that - PERFECT
I have a Nilan Compact P GEO and have more options to get additional data from the NILAN device.
I use TCP modbus and the homeassistant 0.107.1 and my config is the following.

name: nilanmodbus
type: tcp
port: 502

I have been trying to translate the following with register 4716 which reads fine in my device

  • platform: modbus
    scan_interval: 20
    • name: nilan_humidity
      hub: nilan
      unit_of_measurement: ‘%’
      slave: 1
      register: 4716

If i look in the NILAN documentation of CTS700_MODBUS_protokol.pdf the humidity register is called 21776 - how is this translated into register 4716 (16 bit) Hexidecimal but translated to decimal this is 18198.

I am also trying to get GEO data which is on slave ID 4 and the sensors here is register 21841 but unable to understand what hex number i should add the in configuration.yaml

Thanks, help is appriciated.

Hi Poul

It’s been a while since I looked into the docs, but I found the following document/link that I belive I used:

In this document, I’ve used the register 4716 - defined in here as: “Value of Humidity sensor”.

Not sure about your document, but I must admit I seem to remember having downloaded several different sets of documents, that weren’t completely consistent.

Hope this helps.


ps. I’m still looking for a way to turn on/off active cooling - let me know if you find out how to do that :wink:

Hi Jakob,
The link does not work, do you have the pdf and can you send it.

I have not tried to write to the NILAN yet, but in the document from NILAN there is this listed

Register Number Slave ID Function R W Reset Values
20180 1 Allow active cooling + + On/Off
20181 1 High fan speed when cooling + + On/Off
20182 1 Fan speed when cooling + + 103 - Level 3; 104 - Level 4
20183 1 Minimum cooling supply temp © + + 5 <-> 30
20184 1 Cooling priority to hot water + + On/Off