Page 4 of 13

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

Posted: Friday 16 June 2017 13:19
by Icon
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])));

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

Posted: Tuesday 20 June 2017 9:02
by danidata
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.

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

Posted: Wednesday 28 June 2017 23:04
by delchrys
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

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

Posted: Friday 30 June 2017 18:38
by delchrys
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

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

Posted: Monday 03 July 2017 9:20
by bbqkees
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.

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

Posted: Monday 03 July 2017 12:39
by delchrys
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

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

Posted: Monday 03 July 2017 14:03
by bbqkees
Cases commented out are those that were not occurring in my case anyway.

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

Posted: Tuesday 04 July 2017 23:15
by delchrys
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

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

Posted: Wednesday 15 November 2017 12:16
by yctn
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.

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

Posted: Wednesday 15 November 2017 16:19
by bbqkees
Very well possible.
The Moduline 100 is the RC10, likely compatible with the RC20.

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

Posted: Thursday 16 November 2017 9:30
by yctn
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?

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

Posted: Thursday 16 November 2017 9:42
by bbqkees
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.

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

Posted: Thursday 16 November 2017 10:27
by yctn
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

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

Posted: Thursday 16 November 2017 11:10
by bbqkees
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

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

Posted: Thursday 16 November 2017 11:59
by joshmosh
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

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

Posted: Thursday 16 November 2017 18:54
by joshmosh
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

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

Posted: Monday 20 November 2017 19:18
by danidata
joshmosh wrote: Thursday 16 November 2017 18: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

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

Posted: Tuesday 21 November 2017 7:19
by joshmosh
@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

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

Posted: Wednesday 22 November 2017 14:41
by yctn
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

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

Posted: Wednesday 22 November 2017 19:18
by danidata
yctn wrote: Wednesday 22 November 2017 14: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 14: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 14: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 14:41 Do i then have Everything i would need to assemble it? i wanne build the read and write circuit.
What do you mean?