Nefit data/control via Arduino to Domoticz (directly without OpenTherm module or Easy)

In this subforum you can show projects you have made, or you are busy with. Please create your own topic.
User avatar
bbqkees
Posts: 415
Joined: Sunday 17 August 2014 21:01
Target OS: Raspberry Pi
Domoticz version: 3.5x
Location: The Netherlands
Contact:

Nefit data/control via Arduino to Domoticz (directly without OpenTherm module or Easy)

Post by bbqkees » Tuesday 08 November 2016 1:56

A while ago I needed to get an indication of the system pressure in my heating system.
At first I started looking at adding a seperate sensor in one of the pipes.

But as I was standing in front of my Nefit gas boiler (cv ketel) I noticed that it already displays the water pressure.
So if i could get the value out of the boiler, I would not need to add another sensor.

After some digging around on the internet I found out it is actually not that hard to read out and also control a Nefit boiler with an Arduino.
You don't even need an Opentherm converter.

All Nefit gas boilers do not rely on f.i. Opentherm for connecting a thermostat but instead use their own protocol.
This protocol is called (Buderus) EMS. The EMS bus is a two wire bus.
The protocol is quite large as the bus supports many devices but you only need to implement a subset.

You can connect to the EMS bus on 2 locations. Either at the thermostat clamps on the inside of the boiler or you can use the service jack plug on the front of the boiler.

Image

I used the jack plug on the front:
Image

The EMS serial bus can be converted via a simple circuit and can then be connected to an Arduino (or Pi) UART.
Image

Every 10 seconds the boiler sends out a status datagram on the bus.
If you only want to read this data the Arduino sketch is simple.

If you also want to be able to change the setpoint or set the 'home' or 'away' function, you need a modified Serial library.
I got a sample from someone who already connected the Nefit boiler to an Arduino and he can change the setpoint directly.

As I have a separate zone control and do not use a Nefit EMS thermostat, I only need to read out the bus.

The serial log below is from one of my recent attempts:
Image

As you can see I already get a lot of useable values from the bus.
Depening on the boiler model some registers might not be available.

Register 14 to 17 are provided by the Nefit thermostat and are writeable.
They are the current room temperature, setpoint, home/away and manual temp override.

In my setup these registers are empty because I do not have a Nefit thermostat.

I am now writing the code to implement the above on my Arduino that already is reading out another serial bus (Resol VBUS). I am also updating the modified Serial library.
When it is ready and stable, I will create a stand-alone sketch for the EMS bus and publish it all here on my github.
Last edited by bbqkees on Thursday 17 November 2016 10:16, edited 1 time in total.
Intel NUC-> Philips Hue, Aeon Zwave stick V2, Qubino, Fibaro, Everspring, Philio, RFXCom, X10, Harmony Hub, Xiaomi Flora + Gateway, BS440. And P1 / Resol VBus / Nefit EMS bus / DHT21 / DS18B20 / Sonoff / I2C display, all via Arduino/ESP8266.

jeroenkl
Posts: 43
Joined: Sunday 14 July 2013 22:00
Target OS: Raspberry Pi
Domoticz version: beta
Contact:

Re: Nefit data/control via Arduino to Domoticz (directly without opentherm module or Easy)

Post by jeroenkl » Tuesday 08 November 2016 15:13

great!

User avatar
bbqkees
Posts: 415
Joined: Sunday 17 August 2014 21:01
Target OS: Raspberry Pi
Domoticz version: 3.5x
Location: The Netherlands
Contact:

Re: Nefit data/control via Arduino to Domoticz (directly without opentherm module or Easy)

Post by bbqkees » Thursday 17 November 2016 10:10

So at this point it's working pretty well!

Of the 17 registers above about 8 are useful to me. Below a few of them.

Central heating boiler output:
Image

Central heating burner modulating power:
Image

Central heating water pump on/off:
Image

Depending on the devices connected to the bus several dozens of values and settings are available.
Intel NUC-> Philips Hue, Aeon Zwave stick V2, Qubino, Fibaro, Everspring, Philio, RFXCom, X10, Harmony Hub, Xiaomi Flora + Gateway, BS440. And P1 / Resol VBus / Nefit EMS bus / DHT21 / DS18B20 / Sonoff / I2C display, all via Arduino/ESP8266.

christiaan.v
Posts: 5
Joined: Saturday 21 December 2013 22:04
Target OS: Raspberry Pi
Domoticz version:
Location: NL
Contact:

Re: Nefit data/control via Arduino to Domoticz (directly without OpenTherm module or Easy)

Post by christiaan.v » Tuesday 06 December 2016 9:44

I would like to build this, can we have a view at your design. (circuit diagram and software)
I see that you did not update GitHub for a while

User avatar
bbqkees
Posts: 415
Joined: Sunday 17 August 2014 21:01
Target OS: Raspberry Pi
Domoticz version: 3.5x
Location: The Netherlands
Contact:

Re: Nefit data/control via Arduino to Domoticz (directly without OpenTherm module or Easy)

Post by bbqkees » Tuesday 06 December 2016 10:08

The circuit diagram has already been on my Github for a few weeks in the folder 'Documentation'.

Most of the components are not that critical in value. I also used a LM339 instead of the LM393 in the diagram.
Both should work. For the rectifier diodes I used small signal diodes. Does not really matter either.

Indeed I need to publish the code itself, however I still need to create a clean sketch.
Now it is still full of debug stuff and unnecessary code.
Intel NUC-> Philips Hue, Aeon Zwave stick V2, Qubino, Fibaro, Everspring, Philio, RFXCom, X10, Harmony Hub, Xiaomi Flora + Gateway, BS440. And P1 / Resol VBus / Nefit EMS bus / DHT21 / DS18B20 / Sonoff / I2C display, all via Arduino/ESP8266.

marcelr
Posts: 59
Joined: Friday 22 May 2015 21:10
Target OS: Linux
Domoticz version: svn 2470
Location: Ehv, NL
Contact:

Nefit data/control via Arduino to Domoticz (directly without OpenTherm module or Easy)

Post by marcelr » Tuesday 06 December 2016 19:34

Would it be possible to read out your design directly with a TTL-level serial-to-USB converter?
9600 baud, 8N1 is not a very exotic port setting after all ..

User avatar
bbqkees
Posts: 415
Joined: Sunday 17 August 2014 21:01
Target OS: Raspberry Pi
Domoticz version: 3.5x
Location: The Netherlands
Contact:

Re: Nefit data/control via Arduino to Domoticz (directly without OpenTherm module or Easy)

Post by bbqkees » Wednesday 07 December 2016 10:15

Very likely yes.
The schematic (which is not mine by the way but from the EMSwiki) provides a ~5V compatible TTL level, if you need 3V compatible (f.i. for the Pi UART) you would need to add a simple voltage divider (10k/20k) for the Rx part.

The only 'tricky' part in the end is decoding the STOP signal of the EMS bus, this is not a standard signal.
In the modified Arduino serial library there is an additional command to cope with this STOP signal.
Intel NUC-> Philips Hue, Aeon Zwave stick V2, Qubino, Fibaro, Everspring, Philio, RFXCom, X10, Harmony Hub, Xiaomi Flora + Gateway, BS440. And P1 / Resol VBus / Nefit EMS bus / DHT21 / DS18B20 / Sonoff / I2C display, all via Arduino/ESP8266.

marcelr
Posts: 59
Joined: Friday 22 May 2015 21:10
Target OS: Linux
Domoticz version: svn 2470
Location: Ehv, NL
Contact:

Re: Nefit data/control via Arduino to Domoticz (directly without OpenTherm module or Easy)

Post by marcelr » Wednesday 07 December 2016 19:20

Thanks, in that case I'll just order the parts and a 5V FTDI USB-to-serial PCB, power the lot from USB (100 mA should be enough, I guess).
What about the STOP signal? Isn't it a (bunch of) byte(s) like all other signals? Haven't found it (yet) on the EMSwiki.

User avatar
bbqkees
Posts: 415
Joined: Sunday 17 August 2014 21:01
Target OS: Raspberry Pi
Domoticz version: 3.5x
Location: The Netherlands
Contact:

Re: Nefit data/control via Arduino to Domoticz (directly without OpenTherm module or Easy)

Post by bbqkees » Thursday 08 December 2016 13:15

It's this part;
Jedes Telgramm und Polling und Busfreigabe wird mit einem Break beendet. Ein Break ist auf dem EMS-Bus eine 11 Bit lange „Null“
Most of the info is not on the EMS Wiki but highly scattered around on a few very long threads on the Microcontroller.net forum.
I am trying to gather the important bits and pieces on my Github page.

You could power the circuit from the EMS bus with a 7805 but for some this did not work.
I used the Arduino to power the circuit.
Intel NUC-> Philips Hue, Aeon Zwave stick V2, Qubino, Fibaro, Everspring, Philio, RFXCom, X10, Harmony Hub, Xiaomi Flora + Gateway, BS440. And P1 / Resol VBus / Nefit EMS bus / DHT21 / DS18B20 / Sonoff / I2C display, all via Arduino/ESP8266.

marcelr
Posts: 59
Joined: Friday 22 May 2015 21:10
Target OS: Linux
Domoticz version: svn 2470
Location: Ehv, NL
Contact:

Re: Nefit data/control via Arduino to Domoticz (directly without OpenTherm module or Easy)

Post by marcelr » Thursday 08 December 2016 13:55

Thanks,
I ordered all the parts yesterday (passive components, FTDI TTL serial interface etc). It would be interesting to see if it's possible to make that 11-bit NULL with a standard UART (shouldn't be much of an issue for a bit-banger, though). I will try and make it work on a standard linux box.

joshimosh
Posts: 97
Joined: Friday 29 May 2015 7:03
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: Nefit data/control via Arduino to Domoticz (directly without OpenTherm module or Easy)

Post by joshimosh » Saturday 07 January 2017 16:44

Hi bbqkees,
this is a very interesting project. I have a Buderus heater, which works with the remote controller RC35 and thus uses the EMS protocol.
Is there any news ? Is there any progress in debugging your script ? I would definitely like to learn from it. If you are reluctant to publish the current state of your sketch, perhaps you could send me info by PM ? I would like to use an ESP8266 instead of an arduino. This would allow me to connect it with Domoticz via WLAN.

Good work, thanks a lot !

Cheers
Josh

User avatar
bbqkees
Posts: 415
Joined: Sunday 17 August 2014 21:01
Target OS: Raspberry Pi
Domoticz version: 3.5x
Location: The Netherlands
Contact:

Re: Nefit data/control via Arduino to Domoticz (directly without OpenTherm module or Easy)

Post by bbqkees » Monday 09 January 2017 10:34

At this moment I have several projects around the house I am working on.
However the last couple of weeks I got some more requests for this, so I am planning to publish some stuff within a week or 2.

I am not sure about the compatibility with the ESP, it uses a certain function in the Arduino serial library, it might not work as-is with the ESP.
Intel NUC-> Philips Hue, Aeon Zwave stick V2, Qubino, Fibaro, Everspring, Philio, RFXCom, X10, Harmony Hub, Xiaomi Flora + Gateway, BS440. And P1 / Resol VBus / Nefit EMS bus / DHT21 / DS18B20 / Sonoff / I2C display, all via Arduino/ESP8266.

joshimosh
Posts: 97
Joined: Friday 29 May 2015 7:03
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: Nefit data/control via Arduino to Domoticz (directly without OpenTherm module or Easy)

Post by joshimosh » Monday 09 January 2017 19:09

Hi bbqkees,
good to hear that you are planning to pick it up again. I have a similar problem like you seem to have: some many interesting projects, so little time.
One or two weeks would be perfect. This would allow me to (hopefully) finalise the two other projects I am currently tackling ;-)

As with the ESP: the heater is in my basement, the Raspi with Domoticz on the first floor, so a wireless link - preferrably WiFi - is required. If that's not possible or too difficult, I always can fall back to an Arduino pro mini with NRF24L01 and MySensors library.

Again, thanks a lot for all the work you are putting in.

Cheers
Josh

owenray
Posts: 1
Joined: Monday 09 January 2017 19:25
Target OS: Linux
Domoticz version:
Contact:

Re: Nefit data/control via Arduino to Domoticz (directly without OpenTherm module or Easy)

Post by owenray » Monday 09 January 2017 19:35

joshimosh wrote:Hi bbqkees,
good to hear that you are planning to pick it up again. I have a similar problem like you seem to have: some many interesting projects, so little time.
One or two weeks would be perfect. This would allow me to (hopefully) finalise the two other projects I am currently tackling ;-)

As with the ESP: the heater is in my basement, the Raspi with Domoticz on the first floor, so a wireless link - preferrably WiFi - is required. If that's not possible or too difficult, I always can fall back to an Arduino pro mini with NRF24L01 and MySensors library.

Again, thanks a lot for all the work you are putting in.

Cheers
Josh
Otherwise you could always run arduino on the esp (https://github.com/esp8266/Arduino)

OP:
In the datasheet I see a lead going to u_ref, what is u_ref?
(it could be my fairly limited knowledge of circuit diagrams)

domdomgo
Posts: 4
Joined: Thursday 29 December 2016 23:47
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: Nefit data/control via Arduino to Domoticz (directly without OpenTherm module or Easy)

Post by domdomgo » Monday 09 January 2017 21:30

Hi joshimosh,

I do have some arduino uno code from another developer who wanted to integrate the Nefit protocol with the Nodo solution. I think it might run on an ESP8266 as well, the only thing that has to be done is rewrite the code so it accepts commands and publish data via HTTP. The current code outputs the data over serial line.

User avatar
bbqkees
Posts: 415
Joined: Sunday 17 August 2014 21:01
Target OS: Raspberry Pi
Domoticz version: 3.5x
Location: The Netherlands
Contact:

Re: Nefit data/control via Arduino to Domoticz (directly without OpenTherm module or Easy)

Post by bbqkees » Tuesday 17 January 2017 17:18

I published some working code to my Github.
Although it does include ALL bus code and functions to also encode and send data to the bus, I do not use those bits myself.
Intel NUC-> Philips Hue, Aeon Zwave stick V2, Qubino, Fibaro, Everspring, Philio, RFXCom, X10, Harmony Hub, Xiaomi Flora + Gateway, BS440. And P1 / Resol VBus / Nefit EMS bus / DHT21 / DS18B20 / Sonoff / I2C display, all via Arduino/ESP8266.

joshimosh
Posts: 97
Joined: Friday 29 May 2015 7:03
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: Nefit data/control via Arduino to Domoticz (directly without OpenTherm module or Easy)

Post by joshimosh » Tuesday 17 January 2017 19:11

Hi bbqkees,
you're the man ! Thanks a bunch for providing the sketch and the library. I will dive into it ;-)
In a first step I will only read the bus. Not a really good idea to mess with heating during winter time ...

Now the fun can start - thank you !

Cheers
Josh

danidata
Posts: 15
Joined: Tuesday 31 January 2017 17:46
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: Nefit data/control via Arduino to Domoticz (directly without OpenTherm module or Easy)

Post by danidata » Tuesday 31 January 2017 18:02

bbqkees wrote:I published some working code to my Github.
Although it does include ALL bus code and functions to also encode and send data to the bus, I do not use those bits myself.
Thank you very much for sketch and the library. I am currently trying to build your schema and connect it to my Buderus heating system. My final objective is to connect the BUS to my Raspberry PI and use the weewx/meteo information to manage the heating.

Just a short question, in the sketch, where should be U_Ref be connected? I am more into programming and my experience in circuit diagrams is not too wide... Should it be the GND from the TX-RX?

Thanks in advance!

Daniel

User avatar
bbqkees
Posts: 415
Joined: Sunday 17 August 2014 21:01
Target OS: Raspberry Pi
Domoticz version: 3.5x
Location: The Netherlands
Contact:

Re: Nefit data/control via Arduino to Domoticz (directly without OpenTherm module or Easy)

Post by bbqkees » Wednesday 01 February 2017 10:44

danidata wrote:
Thank you very much for sketch and the library. I am currently trying to build your schema and connect it to my Buderus heating system. My final objective is to connect the BUS to my Raspberry PI and use the weewx/meteo information to manage the heating.

Just a short question, in the sketch, where should be U_Ref be connected? I am more into programming and my experience in circuit diagrams is not too wide... Should it be the GND from the TX-RX?

Thanks in advance!

Daniel
The UREF is an internal voltage, just connect all labels marked with UREF together. Do not connect it to other wires.

Also the serial output is 5V compatible, so for the Pi you need to add a voltage divider, because it needs 3,3V.
Intel NUC-> Philips Hue, Aeon Zwave stick V2, Qubino, Fibaro, Everspring, Philio, RFXCom, X10, Harmony Hub, Xiaomi Flora + Gateway, BS440. And P1 / Resol VBus / Nefit EMS bus / DHT21 / DS18B20 / Sonoff / I2C display, all via Arduino/ESP8266.

danidata
Posts: 15
Joined: Tuesday 31 January 2017 17:46
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: Nefit data/control via Arduino to Domoticz (directly without OpenTherm module or Easy)

Post by danidata » Wednesday 01 February 2017 16:12

bbqkees wrote:
danidata wrote:
Thank you very much for sketch and the library. I am currently trying to build your schema and connect it to my Buderus heating system. My final objective is to connect the BUS to my Raspberry PI and use the weewx/meteo information to manage the heating.

Just a short question, in the sketch, where should be U_Ref be connected? I am more into programming and my experience in circuit diagrams is not too wide... Should it be the GND from the TX-RX?

Thanks in advance!

Daniel
The UREF is an internal voltage, just connect all labels marked with UREF together. Do not connect it to other wires.

Also the serial output is 5V compatible, so for the Pi you need to add a voltage divider, because it needs 3,3V.
Thank you for your answer. In fact, my idea is to use an Arduino MEGA with a WiFi module to connect with the Raspberry, so I should be able to connect my Arduino directly to the serial output/input of your circuit.

O couple of doubts about the circuit...
  1. The N/A that stands at the beginning of the EMS_BUS, close to the 4,7mH inductors, is for some future improvement?
  2. The capacitator added at the bottom, is just for decoupling/bypass noise?
  3. What do you think about powering the Arduino with the 12V of the EMS-BUS and a stepdown converter?

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests