This fantastic project is not developed by me. The project is forked from this : https://github.com/jascdk/Nilan_Homeassistant
All the credits go to the originally owner "jascdk" and "DanGunvald". I made some modifications to alarm log + added wifi manager and clean up the code to my liking. I've also added two LEDs high lighting when No WiFi is currently established, or if the MQTT protocol is not connected to the broker.
This little cool project lets you use you Home Assistant to control and read values from your Nilan air vent system. I have the Nilan Comfort 300 combined with the CTS602 panel. It works great, but do not know if it is compatible with other models.
The code for the project is not developed by me, but I made some adjustmenst to it, so it would integrate better with Home Assistant. The project is originally made for use with OpenHab.
For the original project look here: https://github.com/DanGunvald/NilanModbus
Please proceed this project at your own risk!!!
UPDATE 19/2-2020 : Got the code working with ArduinoJson version 6 (updated from version 5). Version 6 had some big breaking changes.
UPDATE 1/1-2020 : Now added a .ino file for use with a Nilan VPL15 system. Creates some others sensors over the Comfort 300 system. thanks to Martin Skeem for editing / coding :)
I used the arduino editor to upload the code to my ESP8266 (for now a wemos D1 mini). If your sketch wont compile please check if you use the arduino.json V. 5 or V.6 library. This code uses V.6 and wont build with V.5.
For setting up your wifi and mqtt broker provide your credentials in the configuration.h file
For my project i use af Wemos D1 mini board connected to a RS485 board (bought form ali-express). You connect from the Wemos the RX to RX on the RS485 and the TX to TX. This wont work if you cross them.
Then connect the RS485 A,B and GND channel to the corresponding ports on you Nilan Vent System.
You can get some json values from the Nilan by calling to it via HTTP. Just use your browser and type:
DEVICE
- corresponds to the IP adress you you device (esp8266)
http://[device]/help
- This should give you som registers
http://[device]/read/output
- This would for example give you some status of the output
http://[device]/set/[group]/[adress]/[value]
- This would make you able to send commands through HTTP
e.g
http://10.0.1.16/set/control/1004/2700
This will set your temperature to 27 degrees.
Here is where it all shines - the code puts out som useful MQTT topics to monitor different thing.
Any MQTT-Tool (I use on my mac a tool called "MQTT Box") can be used to get the values by subscribing to :
ventilation/temp/#
- This will give the temperatures from all the sensors.
ventilation/moist/#
- This will give the humidity from the systems humidity sensor.
ventilation/#
- This gives the output of the system - fan speed etc. Remember the payloads are given in values not text.
For my integration i use a package with all my Nilan config yaml in just one file. The file can be downloaded above (config.yaml).
After a restart of Home Assistant you will get alot of new sensors. These can be integrated in Home Assistant in different ways. I use the integrated Lovelace UI to make my UI. You can see below, how it can look like:)
I have tried to make some LCD´s using some 4x16 rows displays together with an ESP32 running ESP-Home www.esphome.io .
If you wanna try it out you can use my provided .yaml code for ESP-Home above:)