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.

Moderator: leecollings

danidata
Posts: 24
Joined: Tuesday 31 January 2017 16:46
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

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

Post by danidata »

delchrys wrote:
danidata wrote:
danidata wrote:
Hi Icon. Yes, I am preparing a GitHub Project with this code. I hope I will finish it during the weekend. I will post a lik.
In this repository I have uploaded my code. https://github.com/danidata/Calduino-Wi ... MS-Buderus
It is initially based on bbqkees' Project and uses its NefitSerial library (renamed as EMSSerial, I am currently trying to update it to new Arduino Serial library). All the operations that interact with the EMS Bus have a timeout to avoid an endless wait. I am using a WiFly module (RN-VX) to interact with the EMS Bus and recieve/send via Wify commands. I currently do not use Domoticz but I don't think it should be very complicated to addapt it.
In the next days I will try to add more documentation to the project. Good luck!
Damn you made a nice arduino code, i suppose it is possible to read almost every data on the EMS BUS?
I would like to use parts of your code, but i have an arduino Uno with wifi (esp8266) so i have to rewrite most of the wifi parts.
Can you make an option in the code to make it run only on the serial output, so no wifi in it. I would like to see which data i can get out my Nefit Proline with moduline 100 (RC10?)thermostat.
Yes, the data you can read from the EMS Bus is described in this webpage: https://emswiki.thefischer.net/.

The code has already this function when debug mode is activated (#define debug). Feel free to make changes to my code to find what data you can get from the EMS Bus. I have no idea what is the transmitterID of your thermostat (could not find it in the wiki).

However, in Arduino One you only have a serial port and, if you want to read from the EMS Bus and use serial output at the same time, you will need a second serial port. Maybe with a USB to TTL serial convertor you can manage it, but I have no idea.

If you are going to use a ESP8266, this project maybe interesting for you: https://github.com/susisstrolch/ems-esp-link
delchrys
Posts: 51
Joined: Wednesday 02 March 2016 20:52
Target OS: -
Domoticz version:
Contact:

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

Post by delchrys »

I have an arduino uno wifi from arduino.org so it's a clone with integrated esp8266 chip for wifi. It uses also a wifi serial console so I can use that for debugging. I'm going to look if I can change your code for usage with my uno board. Would be a pain in the ass. But will try. Maybe take out your wifly part and first use only serial output

Verstuurd vanaf mijn SM-G925F met Tapatalk
delchrys
Posts: 51
Joined: Wednesday 02 March 2016 20:52
Target OS: -
Domoticz version:
Contact:

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

Post by delchrys »

Can you make a quick alternation to your code so it doesn't use wifly. The code seems to stop now due to no connection

Verstuurd vanaf mijn SM-G925F met Tapatalk
danidata
Posts: 24
Joined: Tuesday 31 January 2017 16:46
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

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

Post by danidata »

Delchrys, I cannot make a "quick alteration" in my code so it doesn´t use WiFly (385 references...). But you can comment whatever you need. If it stops due to no wifly connection, just comment the wifly initialization (setupWifly();) and make your own loop to read/write the information in the EMS Bus.
delchrys
Posts: 51
Joined: Wednesday 02 March 2016 20:52
Target OS: -
Domoticz version:
Contact:

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

Post by delchrys »

i just like to see which information is available, from there i will decide which i will log to my domoticz setup.
It seems that your code gets more info than bbqkees's code. For now I'm not using the TX part. I like to read only.
Your code uses Serial3 i presume???
danidata
Posts: 24
Joined: Tuesday 31 January 2017 16:46
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

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

Post by danidata »

delchrys wrote:i just like to see which information is available, from there i will decide which i will log to my domoticz setup.
It seems that your code gets more info than bbqkees's code. For now I'm not using the TX part. I like to read only.
Your code uses Serial3 i presume???
Yes, i use Serial3 to communicate with EMS Bus, Serial2 with WiFly and Serial for debug/console purposes.
You should really have a look at https://emswiki.thefischer.net/doku.php ... telegramme and try to understand how the bus works and how to extract information from it.
delchrys
Posts: 51
Joined: Wednesday 02 March 2016 20:52
Target OS: -
Domoticz version:
Contact:

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

Post by delchrys »

danidata wrote:
delchrys wrote:i just like to see which information is available, from there i will decide which i will log to my domoticz setup.
It seems that your code gets more info than bbqkees's code. For now I'm not using the TX part. I like to read only.
Your code uses Serial3 i presume???
Yes, i use Serial3 to communicate with EMS Bus, Serial2 with WiFly and Serial for debug/console purposes.
You should really have a look at https://emswiki.thefischer.net/doku.php ... telegramme and try to understand how the bus works and how to extract information from it.
Yes i looked at it, but didn't really understand it whole. I'm going to look in it some more today.
It seems that your code is depending a lot on a working wifi connection, i can't get a readout with adjusting your code.
Bbbqkees his code works for me, but i like to see some more info so maybe i can better adjust his code to show more info.
delchrys
Posts: 51
Joined: Wednesday 02 March 2016 20:52
Target OS: -
Domoticz version:
Contact:

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

Post by delchrys »

Can't relate the addresses in bbqkees code with the wiki bus addresses only 0x08
delchrys
Posts: 51
Joined: Wednesday 02 March 2016 20:52
Target OS: -
Domoticz version:
Contact:

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

Post by delchrys »

danidata wrote:
delchrys wrote:i just like to see which information is available, from there i will decide which i will log to my domoticz setup.
It seems that your code gets more info than bbqkees's code. For now I'm not using the TX part. I like to read only.
Your code uses Serial3 i presume???
Yes, i use Serial3 to communicate with EMS Bus, Serial2 with WiFly and Serial for debug/console purposes.
You should really have a look at https://emswiki.thefischer.net/doku.php ... telegramme and try to understand how the bus works and how to extract information from it.
Is the sending (tx) part needed for getting more data out of the EMS bus(POLLING)? Or is it only for changing values?

Verstuurd vanaf mijn SM-G925F met Tapatalk
delchrys
Posts: 51
Joined: Wednesday 02 March 2016 20:52
Target OS: -
Domoticz version:
Contact:

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

Post by delchrys »

Is it possible to transplant the alterations in the serial library to the projects code. I think due to the alternated library my ciao library or unowifidev library doesn't work properly. If I send a ciao.write command with a normal code it updates my values in my domoticz setup. But when I put that same code in bbqkees code it doesn't work. When I commented out some parts I got it working again but then the EMS data collection won't work anymore. Strange but because both parts work separately I think it should work combined also.

Verstuurd vanaf mijn SM-G925F met Tapatalk
delchrys
Posts: 51
Joined: Wednesday 02 March 2016 20:52
Target OS: -
Domoticz version:
Contact:

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

Post by delchrys »

Maybe softwareserial is a possibility. BTW I'm using a uno with integrated wifi from arduino.org. Should be possible I think to use the softwareserial for the EMS bus and the rest normal for making it work.

Verstuurd vanaf mijn SM-G925F met Tapatalk
delchrys
Posts: 51
Joined: Wednesday 02 March 2016 20:52
Target OS: -
Domoticz version:
Contact:

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

Post by delchrys »

danidata wrote:
delchrys wrote:i just like to see which information is available, from there i will decide which i will log to my domoticz setup.
It seems that your code gets more info than bbqkees's code. For now I'm not using the TX part. I like to read only.
Your code uses Serial3 i presume???
Yes, i use Serial3 to communicate with EMS Bus, Serial2 with WiFly and Serial for debug/console purposes.
You should really have a look at https://emswiki.thefischer.net/doku.php ... telegramme and try to understand how the bus works and how to extract information from it.
Sorry for the many questions. Bit it seems my uno has one hardware serial port like many others and a ciao wifi console. If I do a print to ciao it shows in a wifi console so that's my second serial I guess. Now I only need the serial to be the alternated one from the github code. I guess I have to make the changes to the hardwareserial then??
When I connect my arduino mega it works perfectly only no wifi. But my circuit works properly. When I connect my uno my ems data stays empty. So it isn't decoded properly according to nefit serial I guess. Some ideas? Or connect the mega to the uno with a connection between rx tx?

Verstuurd vanaf mijn SM-G925F met Tapatalk
danidata
Posts: 24
Joined: Tuesday 31 January 2017 16:46
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

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

Post by danidata »

Delchrys it is becoming more and more difficult to follow your posts.
Anyway, I will try:
• Yes, the sending part is needed to get additional data from the EMS Bus. Otherwise you will only get the datagrams automatically sent by your boiler which, if I remember well, were the slow monitors (UBA and UBA Warm Watter).
• I don´t really know how works this wifi console but Arduino One has only one serial port so, this wify console should be using this. As stated before, you will need another serial port to communicate with the EMS BUS. O possible solution is, as you say, use the Arduino one only for wify purposes and connect Mega with EMS.
delchrys
Posts: 51
Joined: Wednesday 02 March 2016 20:52
Target OS: -
Domoticz version:
Contact:

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

Post by delchrys »

It seems the problem is in the library. On a atmega8 it seems to work but not on a atmega328p. So the library has to be rewritten.

Verstuurd vanaf mijn SM-G925F met Tapatalk
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 »

As far as I know you need an UART for connecting to the EMS bus. That means a hardware serial port. The EMS bus is somewhere a little tricky.
As far as I know the hardware port on the UNO is also connected to the USB. (please correct me when I'm wrong)
I'm now using a Leonardo where the EMS bus is connected to the hardware serial port. For the Wifi an ESP8266 is connected via a software serial port. I had to make some minor changes to the NefitSerial library to get things working.
Hope to have some more time to get the sending part operational.
delchrys
Posts: 51
Joined: Wednesday 02 March 2016 20:52
Target OS: -
Domoticz version:
Contact:

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

Post by delchrys »

Icon wrote:As far as I know you need an UART for connecting to the EMS bus. That means a hardware serial port. The EMS bus is somewhere a little tricky.
As far as I know the hardware port on the UNO is also connected to the USB. (please correct me when I'm wrong)
I'm now using a Leonardo where the EMS bus is connected to the hardware serial port. For the Wifi an ESP8266 is connected via a software serial port. I had to make some minor changes to the NefitSerial library to get things working.
Hope to have some more time to get the sending part operational.
Could you post your code and updated library please???
I'm looking into it to make it work on UNO, getting there but not yet.
Also trying on Micro which has a UART and a serial monitor separately.
Found out the nefitserial library is based on arduino hardwareserial below version 1.06, so this helps a bit when debugging the library.
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 »

delchrys wrote:
Icon wrote: Could you post your code and updated library please???
I'm looking into it to make it work on UNO, getting there but not yet.
Also trying on Micro which has a UART and a serial monitor separately.
Found out the nefitserial library is based on arduino hardwareserial below version 1.06, so this helps a bit when debugging the library.
I will see what I can do. I've made quick and dirty mods to the library. Some cleaning is required.
My first attempt was also with an UNO. But as stated above the hardware serial is already used and I think a software serial doesn't work.
delchrys
Posts: 51
Joined: Wednesday 02 March 2016 20:52
Target OS: -
Domoticz version:
Contact:

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

Post by delchrys »

Icon wrote:
delchrys wrote:
Icon wrote: Could you post your code and updated library please???
I'm looking into it to make it work on UNO, getting there but not yet.
Also trying on Micro which has a UART and a serial monitor separately.
Found out the nefitserial library is based on arduino hardwareserial below version 1.06, so this helps a bit when debugging the library.
I will see what I can do. I've made quick and dirty mods to the library. Some cleaning is required.
My first attempt was also with an UNO. But as stated above the hardware serial is already used and I think a software serial doesn't work.
nevermind the quick and dirty as long as it works, i always like to have examples so i can better understand things.
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 »

danidata wrote:
danidata wrote:
Icon wrote: After some effort I have the read function working. I wonder if you could share the code you are using for the write part.
Hi Icon. Yes, I am preparing a GitHub Project with this code. I hope I will finish it during the weekend. I will post a lik.
In this repository I have uploaded my code. https://github.com/danidata/Calduino-Wi ... MS-Buderus
It is initially based on bbqkees' Project and uses its NefitSerial library (renamed as EMSSerial, I am currently trying to update it to new Arduino Serial library). All the operations that interact with the EMS Bus have a timeout to avoid an endless wait. I am using a WiFly module (RN-VX) to interact with the EMS Bus and recieve/send via Wify commands. I currently do not use Domoticz but I don't think it should be very complicated to addapt it.
In the next days I will try to add more documentation to the project. Good luck!
Thanks for sharing the code. This was realy helpfull for me to get the send part working with a Leonardo. When I look at your Arduino sketch on Github there might be a typo in one of the following lines (probaly line 533). Could you comment on this? Lines are straight copy and past.
513 curImpTemp = ((float)((((uint8_t)inEMSBuffer[5] << 8) + (uint8_t)inEMSBuffer[6]))) / 10;
533 errCode = ((int)((((uint8_t)inEMSBuffer[5] << 8) + (uint8_t)inEMSBuffer[6])));
danidata
Posts: 24
Joined: Tuesday 31 January 2017 16:46
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

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

Post by danidata »

Icon wrote:
danidata wrote:
danidata wrote:
Hi Icon. Yes, I am preparing a GitHub Project with this code. I hope I will finish it during the weekend. I will post a lik.
In this repository I have uploaded my code. https://github.com/danidata/Calduino-Wi ... MS-Buderus
It is initially based on bbqkees' Project and uses its NefitSerial library (renamed as EMSSerial, I am currently trying to update it to new Arduino Serial library). All the operations that interact with the EMS Bus have a timeout to avoid an endless wait. I am using a WiFly module (RN-VX) to interact with the EMS Bus and recieve/send via Wify commands. I currently do not use Domoticz but I don't think it should be very complicated to addapt it.
In the next days I will try to add more documentation to the project. Good luck!
Thanks for sharing the code. This was realy helpfull for me to get the send part working with a Leonardo. When I look at your Arduino sketch on Github there might be a typo in one of the following lines (probaly line 533). Could you comment on this? Lines are straight copy and past.
513 curImpTemp = ((float)((((uint8_t)inEMSBuffer[5] << 8) + (uint8_t)inEMSBuffer[6]))) / 10;
533 errCode = ((int)3( 2( 1((uint8_t)inEMSBuffer[5] << 8)1 + (uint8_t)inEMSBuffer[6] )2 )3 );
Sorry for not answering in a long time. What do you mean? Do you get a Typographical error when you compile this code? In my case works without problems. It justs "reconstruct" the number encoded in two byte and parses it to float or int.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest