[APP][Pro] Modbus

Nothing changed at connection logik. Only the added type for write register flow card.
So let’s hope your Homey and inverter are best friends now :smile:

Ok there have been some connection problems but a restart of the Modbus App wasn’t nessesary.

3* request timeout once connection closed
So I would say your wonderful App now even manages to work with the most complicated brand. Thank you so much for optimization of your app again and again. I am so happy now.

1 Like

That’s actually a very good question. Modbus itself only has 16-bit registers. But according to the documentation of my heat pump registers have a size between 1 and 6 - whatever they mean by this. I have multiple registers with a documented size of 6 and a max value of 2147483647. That value doesn’t fit into a standard Mod bus register, but it fits into 32 bit. But what’s then the meaning of that size 6? I have no clue.

I tried to read any of those size 6 (and 5 and 3 and also 1) registers with your app and also a Modbus tester. Most of them simply return zero, so I don’t have anything to test at the moment.

To cut a long story short: Not at the moment.

What I was wondering will trying to figure this out: why do you actually need the size of the register you read, i.e. why do you need INT16, INT32, UINT16, etc., and not just “signed number” and “unsigned number”? I ask, because what I saw in the raw Modbus messages, they always specify how much data is included in the message so you know how many bits you got. And how much data you receive solely depends on the “size” parameter. If I’m not mistaken, that “size” actually means the number of registers to be read, but it seems that current devices just use multiple registers to store values larger than 16 bit.

First of all, thank you for this interesting project :slight_smile:

I’m trying to integrate my Kostal Plenticore PV inverter. The connection works, I can also read values ​​from the registers but the values ​​don’t make any sense. According to the documents from Kostal, I set the format to “float”, but according to Google research, a “little-endian byte swap” still needs to be done for the Kostal inverters.


Google: In little-endian style, the bytes are written from left to right in increasing significance. In big-endian style, the bytes are written from left to right in decreasing significance. The swapbytes function swaps the byte ordering in memory, converting little endian to big endian (and vice versa)


Is it possible to include this option? I have no programming knowledge and am currently trying “learning by doing”

Kostal Interface description

I started the app based on an example how to use the NodeJS module I use as API between.

Modbus itself knows only a register to start reading fro. and a size (how many registers (or 16Bit values) to read.
But that’s only a byte buffer. You have to convert into a useable value using a type cast.

But yes, selecting INT16 would need length 1 and there is no need to set this in the flow card. Technically it’s only needed for strings.

I have only a longer string register, a lot of (u)int16 and some int32 for meter or timestamps.

1 Like

I use type INT in my inverter. I don’t know if an inverter can return both INT and FLOAT in this case.
But you can try. Just set the register in read flow card, set the length (1 for UINT16) und the type and check the result.

For the register you need to know if register is used (starting with 1) or address (starting with 0).

And then I’m interested if reading floats is working. I haven’t a case to test.

New test version 0.4.2:

  • Changed size parameter to optional value (only needed for STRING),
  • Added longer timeout for connection
1 Like

New test version 0.5.0:

  • Added flow cards for reading Coil and DiscreteInput Register

Just to complete the register reading flow cards are added now to read Coil and DiscreteInput register (boolean value).

PS: untested due to missing registers in my device :innocent:

1 Like

Hello,

After last update get failed reads from time to time. It works after a retry usually.

maybe it helps:
425b37f7-f5df-45d7-9f67-09be1b67e946

I can only see log lines since 8:00 with some reconnects. No errors.
Perhaps I will revert the timeout settings to default.

I have no problems with it. I did something like this to avoid alerts every time it fails.
I just wanted to let you know it happens.

Edit: Do you know how to do this easier?

What error do you get? A simple timeout?

Yup.

error is from another flow

Thanks, then I will change the timeout again. Strange that >3sec are too short to get date.

Maybe you can make this a parameter that we can set in the device settings? this way we can play with it and increase it when needed.

1 Like

Update for everyone using this App: First of all, after all of App Adjustments of @RonnyW the modbus app doesn’t crash any more when the Huawei S-Dongle closes connection or delays answer. Second: You have to ask your provider to remotely update the S-Dongle and Inverter operating system Since I asked my provider to do so, there are no closed connections or time-out messages any more and Huawei is now working smooth! SO everyone should first update his inverters and S-dongels.

it worked OK before 0.5.0. How is this the S-Dongle fault? :joy:

Sometimes I see that I get this:

Yes this error code means that the communication between S-Dongle and inverter is not working. Since mY update of sdongle and inverter I have no errors any more. Not a single one!!!

I think everyone should update their S-Dongle and inverters first! I have the most complicated system with two inverters, S dongle and battery and smart meter… After update of all components there is not one single time out any more!!! Ronny just keep your app like it is! Don’t blow it up too much. I even got a specialist of Huawei: he told me there have been problems with Huawei, therefore an update is nessesary. Everyone can update by themselves or the provider can do it from distance