E3DC with the new modbus binding

Tags: #<Tag:0x00007fc916530340> #<Tag:0x00007fc916530020>

That would be this Item, yes?

This is not going to be straightforward.
First thing you need to find out is if the device (about which I know nothing) will actually let you switch this from modbus?
If so, how? There is no rule that modbus status and control have to in the same register or even register type.

If we assume the likely case for now, reading and writing from the same modbus register, we run into a snag.

Thing data EMS_Charge_Lock		"E3DC EMS charging locked"		[ readStart="84.0", readValueType="bit"]
Thing data EMS_DisCharge_Lock		"E3DC EMS discharging locked"		[ readStart="84.1", readValueType="bit"]
...

This group of device status are represented as single bits in a 16-bit register. (that the 84.0 part, bit 0 in register 84)
It is not possible for modbus binding to write a single bit in a register.
The closest you can do is write the whole register with that one bit set as you wish.
That would not be too difficult - but the hard part is what about the other bits? Presumably you need to remember what they are and write the register with all of the important bits set the way they last were, except the one you want to change.

That can be done with some coding, but I won’t go into it unless needed. Find out how your E3DC expects modbus writing to happen.

The general idea for bits-in-register writing is here

Thanks for your explaination.
i’ve just checked the vendor documentation and on top of the document it says “control via modbus is not possible, only read access” :frowning:

That’s disappointing. Marketing decision perhaps.

As I mentioned above, for controlling the E3DC via openhab, we would need a binding that builds on the E3DC RSCP interface.

“I would really like to be able to control the E3DC system via Openhab at some point in time. Anyone of the experts interested in developing a binding for that, using the E3DC RSCP interface?”

Maybe this can help:

1 Like

@mal , based on your excellent work integrating the E3DC system: I will get a Stiebel Eltron heatpump installed, including its Internet Service Gateway (ISG), supporting Modbus TCP/IP. What do I need to do to use the Openhab Modbus Binding to communicate with the heatpump? Ideally, I like to control the heatpump via Openhab, using excess solar energy, as reported by the E3DC Modbus connection.
Thanks a lot for your advice.

@ffr the magic happens in step 3 of the tutorial. You need to get the modbus documentation for your Stiebel Eltron pump. Accordng to the documentation you can then create the things.
I can’t tell if the heatpump can be controlled via modbus, though the Modbus Binding is capable of that (didn’t try it).
You might want to consider using the E3DC SG ready interface board. Newer heatpumps should have SG ready implemented.

Not an exact answer, but I hope it helps.

But still could not really makeup a proper documentation on RSCP. Just some example application which are in C and not so easy to rebuild/reengineer given encryption is required, etc.

@bjoernbrings We need to have a binding for that. I’m diving into RSCP currently (.NET not Java yet). It’s not that complicated, but last time I worked on a binding, the build environment was a real PITA.

What the RSCP binding needs:

  • synchronous tcp websocket communication (send telegram and wait for reply telegram)
  • encrypt the telegrams with Rijndael256 (block and key size 256 bit) using Bouncy Castle
  • polling loop/timer
  • and of course the protocol fiddling

The communication and polling part can be found in other bindings already. I didn’t check if a bindings uses Bouncy Castle already. The protocol handling / telegram interpretation is time consuming IMO.
I just reinstalled Openhab, maybe I find the time to work on this in the next months.

Meanwhile someone else might build something around this python implementation. It talks JSON on first glance.

1 Like

@mal
Thanks for the quick response. I know about the SG ready interface. My understanding is that it requires a serial connection between the E3DC and the heatpump. It is also not as flexible as an Openhab rulset.

If you could get some example program in Java running I should definitly be able to make that an binding

Thanks for sharing this !!!

Maybe this git project is helpful, I didn’t do the coding. But in my point of view with my limited experience in coding it will be a solid base to start a binding, because the hard work RSCP is already done. I tested the sample file on my own E3Dc and it is working fine.

The RSCPTag file looks quite interesting as it lists all the TAGs but without any further info. But it shows that the author has deeper insights beyond the documentation that is open to anyone by E3DC.

Our E3DC device requires username and password for RCSP (that is modbus I think?) Currently I am using it with a python script since there is a library for it, but integrating it directly would be better…
So where do I need to put username and password?

I have read all responses now so RCSP is able to control the device and modbus works without authentication but cant control it?

NVM, I found it now, seems to be new in the device since I never saw that option

RCSP <> Modbus

Modbus is unencrypted and readonly
RCSP is password protected, encrypted and could be used to change some parameters

Right now we only have a solution for Modbus but maybe if be get some more information beyond the repo that @elrusso mentioned we could start developing a addon that will use RCSP

1 Like

Hi there, I’m the author of that java repo.
I want to explicitly give a shoutout to @Elrusso who approached me to make my “old” code from a few years back available. I didn’t think the code could be useful outside of that one-off project back then.

A lot of the work I have done back then was trial and error of inputs, basically reverse engineering from the C++ example code provided by E3DC and using data tags & data types combinations to figure out how to compose them.

Feel free to ask any questions, I’m happy to share whatever I’ve figured out the hard way.

1 Like

Hi Brendon,
welcome, and thank you for your big support and efforts. Beside the posting I was not able to push the topic further. Upgrading my openhab project as recommended in a clean install in Openhab 3 is more time consuming as expected. After that I would like to modify your code generating some other Request Frames for the start. But again thanks you to be available for questions, maybe others are quicker than I am.

No problem at all. And if there are any issues with the library, let me know.
As you can imagine, the early version can well contain a few bugs. I’m happy to squash those, or accept pull requests if anyone wants to contribute directly.

1 Like

Thanks to @Elrusso pointing me to the great work of @bvotteler I am happy that I could announce the first poc of a E3DC binding.

1 Like