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

Post Reply
User avatar
bbqkees
Posts: 407
Joined: Sunday 17 August 2014 21:01
Target OS: Linux
Domoticz version: 4.1x
Location: The Netherlands
Contact:

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

Post by bbqkees »

The first batch of PCB's are finally ready.
See http://domoticz.com/forum/viewtopic.php?f=22&t=22079 for all the details and how to get one.

Image
Bosch / Nefit / Buderus / Junkers / Worcester / Sieger EMS bus Wi-Fi MQTT Gateway and interface boards: https://bbqkees-electronics.nl/
WillemNL
Posts: 4
Joined: Saturday 11 November 2017 9:32
Target OS: NAS (Synology & others)
Domoticz version: v4.0.107
Location: Oosterwolde, NL
Contact:

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

Post by WillemNL »

How to integrate this project into Domoticz?

Having an EMS level shifter, an Arduino Mega and a working Domoticz installation on my NAS, my next challenge is to integrate the measurements into Domoticz. What's the right setup methode?
Version: v4.0.10717-8
NAS Synology DS216play / DSM 6.2.2-24922
Evohome via API
YouLess via LAN
User avatar
bbqkees
Posts: 407
Joined: Sunday 17 August 2014 21:01
Target OS: Linux
Domoticz version: 4.1x
Location: The Netherlands
Contact:

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

Post by bbqkees »

Create virtual sensors and switches in Domoticz for the parameters you want to log.
Write down the device ID's.
Copy the sketch from my Github page, change the device ID's and the IP address etc in the sketch to the values of your setup.
And for reading out the regular parameters you are done. Devices are updated every 30 seconds (or when they change).

If you want to change the temperature you need the correct thermostat and some additional code that can write the correct EMS register.
Bosch / Nefit / Buderus / Junkers / Worcester / Sieger EMS bus Wi-Fi MQTT Gateway and interface boards: https://bbqkees-electronics.nl/
Sungray
Posts: 2
Joined: Friday 10 November 2017 12:05
Target OS: -
Domoticz version:
Contact:

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

Post by Sungray »

Hi @bbqkees,

I want to control my Buderus heating installation using 0-10v outputs (start temperature control). The current controllers are one RC300 (heating floor, low temp) and one RC200 (radiators, high temp). So there are 2 distinct circuits with one MM100 module each.

Is there any way I can use your work to take control of my installation, bypassing the thermostats ? Or even better, having the thermostats in a surveillance/observation mode while controlling the heater with my home automation system 0-10v ?

This is irrelevant but my home automation system is Loxone. If need be I can interface it with a Domoticz device.

Can we plug two PCBs to control two circuits separately ?
User avatar
bbqkees
Posts: 407
Joined: Sunday 17 August 2014 21:01
Target OS: Linux
Domoticz version: 4.1x
Location: The Netherlands
Contact:

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

Post by bbqkees »

As I understand it everything eventually operates on the same EMS bus and therefore only one circuit board is needed.
To control the temperature you need to set the thermostats that are on the bus.
So you don't bypass the thermostats but you can override any setpoint they have.

But how this works specifically with the MM100 is unknown to me. Maybe the MM100 acts like a proxy and then you might need a second board for simplicity.

Furthermore the EMS interface circuit should be connected to a microcontroller like the Arduino because there is no control logic on it. It's just a signal level shifter.
If you would want to operate something with an analog voltage you could program an Arduino to take the voltage as an input I guess. But the logic needed inside is something you have to program yourself.
Bosch / Nefit / Buderus / Junkers / Worcester / Sieger EMS bus Wi-Fi MQTT Gateway and interface boards: https://bbqkees-electronics.nl/
Sungray
Posts: 2
Joined: Friday 10 November 2017 12:05
Target OS: -
Domoticz version:
Contact:

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

Post by Sungray »

bbqkees wrote: Thursday 08 March 2018 16:34 As I understand it everything eventually operates on the same EMS bus and therefore only one circuit board is needed.
To control the temperature you need to set the thermostats that are on the bus.
So you don't bypass the thermostats but you can override any setpoint they have.

But how this works specifically with the MM100 is unknown to me. Maybe the MM100 acts like a proxy and then you might need a second board for simplicity.

Furthermore the EMS interface circuit should be connected to a microcontroller like the Arduino because there is no control logic on it. It's just a signal level shifter.
If you would want to operate something with an analog voltage you could program an Arduino to take the voltage as an input I guess. But the logic needed inside is something you have to program yourself.
Thanks for your answer. I'm a programmer so the logic with the arduino part should be OK. If I can override the controls from the two thermostats then you're my savior.

As I understand it, one of the MM100 modules has an actuator valve and the other doesn't, using the start temperature of the heater. Anyway I'll have to fiddle with it, thankfully your documentation is extremely good.
WillemNL
Posts: 4
Joined: Saturday 11 November 2017 9:32
Target OS: NAS (Synology & others)
Domoticz version: v4.0.107
Location: Oosterwolde, NL
Contact:

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

Post by WillemNL »

My problem: Errors when uploading sketch into my Arduina Mega and no values in Domotics.

Lately I received my ordered EMS-board from bbqkees (thanks!) and connected all bits and pieces together to read out my Nefit boiler. So far so good... I installed the sketch and the serial monitor shows values, however when uploading the edited sketch I receive some errors regarding the ID's I have used.

Can anyone point me in the right direcion?

In Domoticz I created 3 virtual instruments with the ID's: 00082026, 1406B and 14069. The last one seems ok, but I receive errors on the first 2:

Edited part of the sketch:
int IDXcvpressure = 00082026; // Set here your own Domoticz ID's
int IDXburnerpower = 000;
int IDXburner = 000;
int IDXboiler = 000;
int IDXcvreturn = 1406B;
int IDXsupply = 14069;
int IDXhotwater = 000;
int IDXcvpump = 000;

Arduino error log while compiling sketch:
EMSbusReceiveEdit:187: error: invalid digit "8" in octal constant
int IDXcvpressure = 00082026; // Set here your own Domoticz ID's
^
EMSbusReceiveEdit:191: error: unable to find numeric literal operator 'operator""B'
int IDXcvreturn = 1406B;
Version: v4.0.10717-8
NAS Synology DS216play / DSM 6.2.2-24922
Evohome via API
YouLess via LAN
WillemNL
Posts: 4
Joined: Saturday 11 November 2017 9:32
Target OS: NAS (Synology & others)
Domoticz version: v4.0.107
Location: Oosterwolde, NL
Contact:

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

Post by WillemNL »

Problem solved :)
To couple the measurements to the right instruments in Domoticz I used their Idx numbers instead of the ID's and now it works!

For others who might struggle with this:
"Set here your own Domoticz ID's" should be: "Set here your own Domoticz Idx nrs"
Version: v4.0.10717-8
NAS Synology DS216play / DSM 6.2.2-24922
Evohome via API
YouLess via LAN
User avatar
bbqkees
Posts: 407
Joined: Sunday 17 August 2014 21:01
Target OS: Linux
Domoticz version: 4.1x
Location: The Netherlands
Contact:

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

Post by bbqkees »

Glad that it works.
On the documentation/readme of the arduino code folder it mentions IDX as well.
Bosch / Nefit / Buderus / Junkers / Worcester / Sieger EMS bus Wi-Fi MQTT Gateway and interface boards: https://bbqkees-electronics.nl/
davidw
Posts: 12
Joined: Tuesday 16 July 2013 18:53
Target OS: Raspberry Pi / ODroid
Domoticz version: 2.3530
Location: Belgium, Turnhout
Contact:

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

Post by davidw »

Hi bbqkees,

I get no output with the lines below. My output:

Code: Select all

New datagram found with Sender ID: Receiver ID:  New datagram found with Sender ID: Receiver ID:  
Where exactly do I need to add the extra lines?
bbqkees wrote: Tuesday 09 January 2018 12:04 kapav,

You can add something like the following code to see which datagrams appear on the bus:

Place it in void loop between:

Code: Select all

	  if (crcCheckOK(buffer,ptr)){
	    nefitFrame2register(buffer,ptr);

Code: Select all

#if DEBUG  
 nefitSerial.print("New datagram found with Sender ID: ");
nefitSerial.print(buffer[0]); nefitSerial.print("Receiver ID:  "); nefitSerial.print(buffer[1]);
 nefitSerial.print("Frametype:  "); nefitSerial.print(buffer[2]); nefitSerial.print("Offset:  ");
  nefitSerial.println(buffer[3]);
  nefitSerial.println("------------------------");
#endif  
For anyone that is interested, I added a lot of documentation and comments to the code on my Github page to make it easier to understand.
User avatar
bbqkees
Posts: 407
Joined: Sunday 17 August 2014 21:01
Target OS: Linux
Domoticz version: 4.1x
Location: The Netherlands
Contact:

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

Post by bbqkees »

davidw wrote: Saturday 24 March 2018 19:42 Hi bbqkees,

I get no output with the lines below. My output:

Code: Select all

New datagram found with Sender ID: Receiver ID:  New datagram found with Sender ID: Receiver ID:  
Where exactly do I need to add the extra lines?
Could be you did not put it in the correct spot so the buffer is already cleared or otherwise empty at that point.
After a succesful CRC check you know you received a valid datagram.
That's a good moment to print the buffer contents. The buffer contents can be anything from 4 to 32 bytes or so.
You can place the debug function after the opening bracket { and before the nefitFrame2register function.
You also need to set the #define DEBUG 1 line at the start of the sketch to 1.

I am going to add some additional helper sketches tot the Github page soon, one will include a simple dump/view function of the bus.
The older function you quoted does not print a whole datagram, just a piece of it.
Bosch / Nefit / Buderus / Junkers / Worcester / Sieger EMS bus Wi-Fi MQTT Gateway and interface boards: https://bbqkees-electronics.nl/
Pat0500
Posts: 7
Joined: Wednesday 21 February 2018 12:22
Target OS: Linux
Domoticz version:
Location: Netherlands FRL
Contact:

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

Post by Pat0500 »

Hallo bbqkees,

I wanted to private message you but that is not possible for me becouse i dont have enough posts yet but my project is related with this post.
for my intershipment for my school i need to do an project and i selected energie monitoring.
my goal is to read and configure an nefit CV instalation with an arduino using labview software do you have any experience with that?
The comunication with arduino and labview is already done but is it possible to read out nefit and resol solarboiler with one arduino?

kind regards,
Patrick Postma
User avatar
bbqkees
Posts: 407
Joined: Sunday 17 August 2014 21:01
Target OS: Linux
Domoticz version: 4.1x
Location: The Netherlands
Contact:

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

Post by bbqkees »

No recent Labview experience here.

An Arduino Mega 2560 has 3 serial ports you can use simultaneously so both EMS and VBUS should be possible.
F.i. USB interface with pc/Labview with Serial0, EMS on Serial1 and VBUS on Serial2.
You would need to strip out the decoding part of f.i. my github projects for EMS and VBUS and interface that with Labview.
Bosch / Nefit / Buderus / Junkers / Worcester / Sieger EMS bus Wi-Fi MQTT Gateway and interface boards: https://bbqkees-electronics.nl/
Pat0500
Posts: 7
Joined: Wednesday 21 February 2018 12:22
Target OS: Linux
Domoticz version:
Location: Netherlands FRL
Contact:

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

Post by Pat0500 »

Thank you for answering so quickly!!!
and thanks for the help.

i will get right into that and nice design on the ems PCB but i will probably try to make my own version in addition to my project.
remknul
Posts: 5
Joined: Friday 06 April 2018 10:50
Target OS: -
Domoticz version: 3.8160
Location: Netherlands, Veldhoven
Contact:

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

Post by remknul »

Hi everybody, Kees,

I'm also inspired by this project and already have breadboarded prototype working.
I included opto-couplers between Arduino and the EMS bus electronics.
I also generated a 5V power from the EMS bus. Seems to work.

So far... thanks to Kees for all the info and Arduino code which gave me a good start. :)

I must admit I had to make quite some changes to the code of Kees, as it didn't work for me very well on the writing part.
Especially the flush commands on the UART did make the behaviour unstable. So I skipped those command on several places, and just read the bus after writing such that I see my own commands back. (it is a half-duplex bus, so this is expected behaviour).
For the time being I removed all Domoticz and ethernet related code and replaced it by print statements to the console.
Easier for debugging and learning/playing with the EMS bus protocol.

Since yesterday I'm able to change to temperature setting of my thermostaat (Nefit Moduline 100, https://www.nefit.nl/consument/producte ... oduct_1159# ) !! :)
The Moduline 100 also uses bus-ID 0x17, just like the Moduline 200.

I'm able to read the current temp setting with the following command:

0x0B,0x97,0xB0,0x04,0x01,<CRC>,<BREAK>

And I'm able to write a new setting (0x29 = 41 = 20,5 degrees) with the following command:

0x0B,0x17,0xB0,0x04,0x29,<CRC>,<BREAK>

I'm still wondering if it is also possible to read the current room temperature from the Moduline 100.
Anybody a suggestion?

My next goal is to put the ethernet shield back on the Arduino, and write daemon code. So not a client which pushes data, but a daemon to which clients on my network can connect. I'm really thinking about keeping the Arduino software as 'stupid' as possible and only act as a bridge between commands send and received over the TCP/IP socket and the EMS bus. This way it is very flexible to connect to any other system, which can be Domoticz too of course.

To be continued...

-Remco
User avatar
bbqkees
Posts: 407
Joined: Sunday 17 August 2014 21:01
Target OS: Linux
Domoticz version: 4.1x
Location: The Netherlands
Contact:

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

Post by bbqkees »

Great progress Remco.

Indeed writing can be a bit tricky, the half-duplex bus is prone to collisions.

I don't know if the Moduline 100 provides message HK1MonitorMessage 0x3E, but that is I believe the only one that has the current room temperature (Raumtemperatur Ist). Or maybe RCTempMessage 0xA3 (Raum-Ist).

I still need to dig into writing to the bus myself. Although I tested it a bit, until now I did not really need it because I do not have an EMS thermostat but an on/off zone system.
But I got so many questions lately about writing to the bus so last week I bought a secondhand Moduline 400 just for testing.

Maybe that's an idea for you too if you can't get the current room temperature from the Moduline 100.
I got the Moduline 400 for just 35 Euro on Marktplaats.
Bosch / Nefit / Buderus / Junkers / Worcester / Sieger EMS bus Wi-Fi MQTT Gateway and interface boards: https://bbqkees-electronics.nl/
User avatar
bbqkees
Posts: 407
Joined: Sunday 17 August 2014 21:01
Target OS: Linux
Domoticz version: 4.1x
Location: The Netherlands
Contact:

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

Post by bbqkees »

Remco maybe you can try out RC20StatusMessage 0xAE
Bosch / Nefit / Buderus / Junkers / Worcester / Sieger EMS bus Wi-Fi MQTT Gateway and interface boards: https://bbqkees-electronics.nl/
remknul
Posts: 5
Joined: Friday 06 April 2018 10:50
Target OS: -
Domoticz version: 3.8160
Location: Netherlands, Veldhoven
Contact:

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

Post by remknul »

I'll try the 0xAE telegram later. I haven't seen it broadcasted before. (I made some dumps)
Perhaps I can request it by a read action.

From the dumps I made earlier, one of the telegrams I do see broadcasted on the bus is the following:

17:00:B1:00:04:26:00:CD:00:00:00:CD

0x04 ??? flags ??
0x26 seems to be equal to the set room temperature
0x00:0xCD could be the current room temp which then would be 20.5 degrees Celsius. (if it is multiplied by 10)
0x00:0x00 ?????
0x00:0xCD Another temp ??? What the difference is between the first and the second 0xCD, I don't know.

I have to follow these variables over time to verify if it indeed follows the room temperature on the display of the Moduline100.
User avatar
bbqkees
Posts: 407
Joined: Sunday 17 August 2014 21:01
Target OS: Linux
Domoticz version: 4.1x
Location: The Netherlands
Contact:

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

Post by bbqkees »

Do you see a message 0x91?
According to the array in my sketch this should contain the room temperature, at least for the Moduline 200.

You can quickly test if CD is the actual room temperature by pointing a hair dryer at the thermostat.
Bosch / Nefit / Buderus / Junkers / Worcester / Sieger EMS bus Wi-Fi MQTT Gateway and interface boards: https://bbqkees-electronics.nl/
remknul
Posts: 5
Joined: Friday 06 April 2018 10:50
Target OS: -
Domoticz version: 3.8160
Location: Netherlands, Veldhoven
Contact:

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

Post by remknul »

Never seen a 0x91 passing by on the bus.

The hair dryer is indeed a good tip! thx
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests