Nefit / Buderus data/control via Arduino / ESP8266 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.
Icon
Posts: 5
Joined: Monday 24 April 2017 21:43
Target OS: -
Domoticz version:
Contact:

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

Post by Icon » Friday 16 June 2017 13:19

No problem for the delayed answer. It's still hobby. Sorry for not beeing specific enough in my question.
What I mean is that for both variables curImpTemp and errCode the same MSB inEMSBuffer[5] and LSB inEMSBuffer[6] is used.

For the errCode value I ended up with the following line:
errCode=((int)((((uint8_t)inEMSBuffer[24]<<8)+(uint8_t)inEMSBuffer[25])));

danidata
Posts: 24
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 20 June 2017 9:02

Yes Icon, you are totally right. I should have corrected this code in my Arduino but not updated it in Github, sorry for that.

I am not using Domoticz currently, but just in case it inspires somebody, this is the web interface that I have developped in order to control the boiler.
Image

I have some problems to "stabilize" the connection between Arduino and the Boiler. I mean, sometimes I have to connect and disconnect it a couple of times until it starts working. This plug/unplug causes sometimes the disconnection of the RC35 that is connected to the same EMS Bus, so I asume my circuit have something wrong and the RC35, to protect itself, just turns off when it sees something strange in the Bus. Nevertheless when the connection is stablished, I recieve no more errors. I think I will have to solder a second version of the circuit.

delchrys
Posts: 70
Joined: Wednesday 02 March 2016 21:52
Target OS: -
Domoticz version:
Contact:

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

Post by delchrys » Wednesday 28 June 2017 23:04

Damn that looks nice. What's your current setup now (hardware/software). Still the same ems bus circuit and an arduino? I presume you also do the writing part to the ems bus?

Verstuurd vanaf mijn SM-G925F met Tapatalk

delchrys
Posts: 70
Joined: Wednesday 02 March 2016 21:52
Target OS: -
Domoticz version:
Contact:

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

Post by delchrys » Friday 30 June 2017 18:38

danidata wrote:Yes Icon, you are totally right. I should have corrected this code in my Arduino but not updated it in Github, sorry for that.

I am not using Domoticz currently, but just in case it inspires somebody, this is the web interface that I have developped in order to control the boiler.
Image

I have some problems to "stabilize" the connection between Arduino and the Boiler. I mean, sometimes I have to connect and disconnect it a couple of times until it starts working. This plug/unplug causes sometimes the disconnection of the RC35 that is connected to the same EMS Bus, so I asume my circuit have something wrong and the RC35, to protect itself, just turns off when it sees something strange in the Bus. Nevertheless when the connection is stablished, I recieve no more errors. I think I will have to solder a second version of the circuit.
Did you make any progress rewriting the library to the new serial library?
@others. I seem to have a problem with getting info on bbqkees register 10 should be hot water but value keeps getting a negative value. Strange.

BTW decided to use just a mega and a esp8266 for the Wi-Fi part on serial2. Had to rewrite some pieces of wifiesp library, because it use serial for debugging. It would conflict with nefitserial so I rewrote that piece of code. Works like a charm now only for the negative register 10.

Verstuurd vanaf mijn SM-G925F met Tapatalk

User avatar
bbqkees
Posts: 499
Joined: Sunday 17 August 2014 21:01
Target OS: Linux
Domoticz version: 3.8x
Location: The Netherlands
Contact:

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

Post by bbqkees » Monday 03 July 2017 9:20

delchrys wrote: Did you make any progress rewriting the library to the new serial library?
@others. I seem to have a problem with getting info on bbqkees register 10 should be hot water but value keeps getting a negative value. Strange.

BTW decided to use just a mega and a esp8266 for the Wi-Fi part on serial2. Had to rewrite some pieces of wifiesp library, because it use serial for debugging. It would conflict with nefitserial so I rewrote that piece of code. Works like a charm now only for the negative register 10.

Verstuurd vanaf mijn SM-G925F met Tapatalk
If you get negative values when it should be positive then maybe you used a wrong data type somewhere, made a wrong conversion (for instance int to float to int etc) or perhaps the offset should be different. Or you are receiving the right value, but you are outputting it incorrectly.
You could check the temperature at the boiler display and compare that with what the serial output is giving you.
Convert them to binary and check the difference, it might reveal the problem.

I had a similar problem when bit shifting in my VBus project and it turned out I was type casting a byte to char instead of int somewhere.
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.

delchrys
Posts: 70
Joined: Wednesday 02 March 2016 21:52
Target OS: -
Domoticz version:
Contact:

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

Post by delchrys » Monday 03 July 2017 12:39

bbqkees wrote:
delchrys wrote: Did you make any progress rewriting the library to the new serial library?
@others. I seem to have a problem with getting info on bbqkees register 10 should be hot water but value keeps getting a negative value. Strange.

BTW decided to use just a mega and a esp8266 for the Wi-Fi part on serial2. Had to rewrite some pieces of wifiesp library, because it use serial for debugging. It would conflict with nefitserial so I rewrote that piece of code. Works like a charm now only for the negative register 10.

Verstuurd vanaf mijn SM-G925F met Tapatalk
If you get negative values when it should be positive then maybe you used a wrong data type somewhere, made a wrong conversion (for instance int to float to int etc) or perhaps the offset should be different. Or you are receiving the right value, but you are outputting it incorrectly.
You could check the temperature at the boiler display and compare that with what the serial output is giving you.
Convert them to binary and check the difference, it might reveal the problem.

I had a similar problem when bit shifting in my VBus project and it turned out I was type casting a byte to char instead of int somewhere.
Thank you for your reply. Any idea why you commented out parts of your code? Like :
int getValue(char * buffer, byte offset, byte vartype){

  int result;

  uint8_t type = vartype & 0x0F;

switch (type){

case 0: //boolean

result = bitRead(buffer[offset],(vartype&0x70)>>4);

break;

case 1: //byte

// result = (uint8_t)buffer[offset];

// break;

case 2: //ascii

// result = (uint8_t)buffer[offset];

// break;

case 4: //byte x 2

// result = (uint8_t)buffer[offset];

// break;

case 6: //byte x 10

result = (uint8_t)buffer[offset];

                        break;

case 3: //int

// result = getDoubleByte(buffer,offset);

// break;

case 5: //int x 10

result = buffer[offset]<<8;

result = result + (uint8_t)buffer[offset+1];

break;


}

    return result;

}



Verstuurd vanaf mijn SM-G925F met Tapatalk

User avatar
bbqkees
Posts: 499
Joined: Sunday 17 August 2014 21:01
Target OS: Linux
Domoticz version: 3.8x
Location: The Netherlands
Contact:

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

Post by bbqkees » Monday 03 July 2017 14:03

Cases commented out are those that were not occurring in my case anyway.
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.

delchrys
Posts: 70
Joined: Wednesday 02 March 2016 21:52
Target OS: -
Domoticz version:
Contact:

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

Post by delchrys » Tuesday 04 July 2017 23:15

Damn i keep on losing it at the bits and bytes parts. Hard to understand what exactly is happening with the bus data. O sniffed the data raw and the bus is putting out strings like 08 00 15 00. That part I can understand. But then...
I have to put some debugging options in the code so I can see what's happening with the data. All those offset stuff is killing me.

Verstuurd vanaf mijn SM-G925F met Tapatalk

yctn
Posts: 6
Joined: Wednesday 15 November 2017 12:57
Target OS: Linux
Domoticz version:
Contact:

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

Post by yctn » Wednesday 15 November 2017 13:16

Hello,

Im investigating the possebility to remote control the nefit thermostat is that possible with ur libary bbqkees?

i have the Nefit Moduline 100. the most simple nefit thermostat.

User avatar
bbqkees
Posts: 499
Joined: Sunday 17 August 2014 21:01
Target OS: Linux
Domoticz version: 3.8x
Location: The Netherlands
Contact:

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

Post by bbqkees » Wednesday 15 November 2017 17:19

Very well possible.
The Moduline 100 is the RC10, likely compatible with the RC20.
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.

yctn
Posts: 6
Joined: Wednesday 15 November 2017 12:57
Target OS: Linux
Domoticz version:
Contact:

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

Post by yctn » Thursday 16 November 2017 10:30

so how should i get started? i already have domoticz running on an old laptop. Do i need a arduino? or can it also be done without it?
i have no experience with arduino yet. do i need to solder that board myself in ur diagram?

User avatar
bbqkees
Posts: 499
Joined: Sunday 17 August 2014 21:01
Target OS: Linux
Domoticz version: 3.8x
Location: The Netherlands
Contact:

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

Post by bbqkees » Thursday 16 November 2017 10:42

Check the Github page, everything is documented pretty well.
However, if you have no experience with Arduino etc this is likely a difficult project for you to start with.
Maybe instead you should have a look at one of the Domoticz compatible thermostats.
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.

yctn
Posts: 6
Joined: Wednesday 15 November 2017 12:57
Target OS: Linux
Domoticz version:
Contact:

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

Post by yctn » Thursday 16 November 2017 11:27

well. the issue then is you cant connect a a different thermostat on a nefit CV cause of the EMS bus
and the goal is not realy to connect it to domoticz speificly but more to be able to control the temp remotly

User avatar
bbqkees
Posts: 499
Joined: Sunday 17 August 2014 21:01
Target OS: Linux
Domoticz version: 3.8x
Location: The Netherlands
Contact:

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

Post by bbqkees » Thursday 16 November 2017 12:10

If you want to control the thermostat you need to add some code to my sketch, as I use it only for reading the bus.
If you buy a second hand Moduline 200 (RC20) you'll have it up running the fastest.

Maybe the sketch from @danidata is more suited to your needs.
See his Github
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.

joshmosh
Posts: 28
Joined: Monday 06 April 2015 7:01
Target OS: Raspberry Pi
Domoticz version:
Contact:

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

Post by joshmosh » Thursday 16 November 2017 12:59

Hi bbqkees,
good for me ;-) that you are still around ...
A couple of days ago (winter is approaching) I have picked up again my project Nefit data.
I have done some modification of your code - actually it is now a mix of yours and danidatas, with a couple of additions by me.
Now I am stuck with compilation for a Mega 2650. It compiles fine, but then the loader complains multiple definition of `__vector_25'

Any idea ?

Thanks a lot
Josh

joshmosh
Posts: 28
Joined: Monday 06 April 2015 7:01
Target OS: Raspberry Pi
Domoticz version:
Contact:

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

Post by joshmosh » Thursday 16 November 2017 19:54

Hi bbqkees,
sorry if I gave you grief - my bad :oops:
The problem was in a library I included (for connecting an ESP8266 via SPI, which saves a serial port, hopefully aloowing me to use an Arduino pro nano, which has a much smaller footprint than a mega). Problem detected and destroyed :-)

Have a nice evening
Josh

danidata
Posts: 24
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 » Monday 20 November 2017 20:18

joshmosh wrote:
Thursday 16 November 2017 19:54
Hi bbqkees,
sorry if I gave you grief - my bad :oops:
The problem was in a library I included (for connecting an ESP8266 via SPI, which saves a serial port, hopefully aloowing me to use an Arduino pro nano, which has a much smaller footprint than a mega). Problem detected and destroyed :-)

Have a nice evening
Josh
Hi Josh,

If you get it to work, it would be great to see your code connecting the EMS BUS with an ESP8266. Could you show/attach your code somewhere?

Thank!

Daniel

joshmosh
Posts: 28
Joined: Monday 06 April 2015 7:01
Target OS: Raspberry Pi
Domoticz version:
Contact:

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

Post by joshmosh » Tuesday 21 November 2017 8:19

@danidata:
Sure, but it will take some time, I'm just at the beginning and I'm not sure if it will work. The basic idea is that Arduino will just be an interface to the emsbus without any coding/decoding. This and interfacing to Domoticz will be done on a Raspberry Pi.
I'll let you know ...

Cheers
Josh

yctn
Posts: 6
Joined: Wednesday 15 November 2017 12:57
Target OS: Linux
Domoticz version:
Contact:

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

Post by yctn » Wednesday 22 November 2017 15:41

danidata wrote:
Tuesday 18 April 2017 9:06
delchrys wrote:What I meant was which parts, like diodes and such.

Verstuurd vanaf mijn SM-G925F met Tapatalk
Yes, As I said, you have all the information in bbqkees Github webpage. https://github.com/bbqkees/Nefit-Buderu ... umentation This diagram is broken in two circuits: send data (top) and receive data (bottom) to EMS.

In this webpage: https://emswiki.thefischer.net/doku.php ... ems:net_io there is a similar circuit to extract this information, and you can even find a component shopping list in a german electronics components webpage https://secure.reichelt.de/index.html?& ... ROVID=2084
After reading alot for a few days i still have some questions

Is this a good shopping list for everything that i would need?
How do i power the circuit? i dont see a power connector?
should i also order a breadboard to make it on instead of a paper holeplate (i prefer not to solder)

Do i then have Everything i would need to assemble it? i wanne build the read and write circuit.

If anyone else has another/better Shopping list let me know

danidata
Posts: 24
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 22 November 2017 20:18

yctn wrote:
Wednesday 22 November 2017 15:41
After reading alot for a few days i still have some questions
Is this a good shopping list for everything that i would need?
No, it is just a good start point. This list was prepared for AVR NetIO, but if you use arduino you should adapt it (and remove the 10 pin sockets and connectors, etc.).
yctn wrote:
Wednesday 22 November 2017 15:41
How do i power the circuit? i dont see a power connector?
In bbqkees Github webpage you can see that the circuit has a 5V input.
yctn wrote:
Wednesday 22 November 2017 15:41
should i also order a breadboard to make it on instead of a paper holeplate (i prefer not to solder)
A breadboard (for me) is something temporary for testing purposes, but it is something you should decide.
yctn wrote:
Wednesday 22 November 2017 15:41
Do i then have Everything i would need to assemble it? i wanne build the read and write circuit.
What do you mean?

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests