[APP][Pro] Modbus

Without a good documentation it’s not easy to find the reason.
Most manufactures are using Holding Registers (4xxxx).
Your device uses a register #1xxxx which should be a bit register. But it’s representing an 16bit integer.
That’s confusing.

The app uses a NodeJS module and it’s reading holding registers only. I can’t say if it would be another response when reading as Input Register.

Can you please try again (restart the app before). If it hangs, then send me a diagnostic report.

I think the connection is closed, but the socket is still connected and that results in a timeout on the second try.
I’ll check if I can make a hard disconnect in this case…

Hi my friend. I just now read your answer. Meanwhile I tried this out:

If I reconnect (Verbinde Gerät) the running ID again and again it works. But it works only in manual mode. So its not optimal and not smooth or elegant BUT it works.

Lets try your suggestion. I make an ongoing flow without reconnecting after two flow cards and than I send you a diagnostic report.
The report numer is:
a8b5da18-4f50-4210-8644-c5eb36b3b4e2

The official (?) document from Sungrow is linked here. They are defining data types and reading values (page 3ff):

and here

Here they are also discussing the type format and offsets

And here they are reading also these information via Modbus:

If I set it to single connect it fails.

hey ,

you can now use SolarEdge + Growatt TCP modbus | Homey for sungrow.

supporting these solaredge.modbus/drivers/sungrow.ts at main · biemond/solaredge.modbus · GitHub

2 Likes

Thank you. Will have a look!

so it is tested with sungrow, with meters and a battery. don’t know if you have an inverter only? will invite you to the group.

New test version 0.3.0:

  • added Slave device

If you have a master device (connected via LAN) and slave devices (connected via modbus), you can now access all devices parallel.
Add the master first providing IP, port and device ID.
Then add a slave providing the ID and selecting the master to use.

Now the Homey master device connects to the modbus master.
All requests from Homey master and slaves are pushed to the modbus master. If you are adressing a slave device ID, the modbus master will forward the request via modbus to the slave.

@Sasan_Khandanpour FYI.You have to remove the inverters and add them again as slave. The dongle will be the master and is connected via LAN.

1 Like

If master/slave connection is working, the I can add the reading of InputRegisters in addition to HoldingResisters.

1 Like

Connection fails after update to 0.3.2. I need to restart the app every few minutes.

What’s your current situation?

  • Only inverter or inverter with a connection box for LAN?
  • Do you have more than one Modbus device?
  • If yes, which one ic sonnected to LAN (Gateway) and which is only connected via Modbus?

I changed a lot especially for such constellations (Gateway+Modbus slaves) and @Sasan_Khandanpour tested a lot.
Version 0.3.3 seems to be good to use it in a Master(Gateway) / Slave environment like this:

New test version 0.3.3:

  • added Slave device
  • added InputRegister flow card

Master/Slave means:

  • You have an inverter that is placed behind a connection box or dongle?
  • Then probably the dongel is the LAN gateway you have to add as Master device (to connect to via TCP)
  • The inverter behind the dongle is connected via modbus. You can add it as Slave device with its Modbus ID as child device of the Master.
  • Every communication is done only from Master device to the Modbus gateway.
  • All communication from Homey Slave devices are forwarded throught the Master.

This way you can limit the LAN access to only one active connection. The Modbus gateway forwards requests to the target Modbus Modbus device dependent on the ID.


@Thomas_Stolz
FYI if you are interested… you can try the InputRegister flow card if that’s reading the register in correct format. I’m just using the NodeJD module functions but can’t test because my inverter only has HoldingRegisters.

I have only an inverted with dongle.

Then it should work wit a connection to the dongle and the modbus ID of the inverter.

I will test the new version tomorrow.
Thanks

I’ll be away for the next few days so I hope it works :innocent:

I have also a Huawei system with dongle and two inverters and a battery. Ronny’s app works great on it. You make first master connection with the dongle (in most Huawei systems it’s ID 100). Than you have to connect as slave with your inverters (in my case ID 1 and 2). The battery is connected with one of the inverters, in my case with ID 2, therefore it’s not nessesary to connect the Modbus app with the battery. Later I will send you my flow with all registers (by editing this reply) .

Hi Valentin,
I had the same problem, but with me it lost connection after hours. thats how I did it:
First set up / installation of modbus IDs:
image
First install as Modbus-Gerät the Huawei S-Dongle (IP number in your privat LAN/Network) with Port 502 and with ID 100.
Than Go to the modul and chose with right mouse click “Einstellungen” (setup?)
image

There you have to Chose Verbindungstyp as Manuell.
Than I used this Flow:

For the very first start you need to manually start the flow From Verbinde Gerät to initiate first connection.
I used the app device capabilitys as virtual module to save and display the results.
The results from S-Dongle they are only updated each 3 minutes, so a shorter delay doesn’t make sense. In fact, maybe thera aren’t nessesary at all when you measure them with a smart meter by yourselve, like I did.
In my flow the value #Haushaltsstrom measures the electricity usage in Watt of my House and #Leistung measures my heat pump. So in fact I only need Input of the inverters to calculate the Solar production (directly from Inverter ID1 and ID2) and from S-Dongle I only need the charge/discharge power of the battery. Unfortunately I can’t read the adresses from the battery directly.

It worked perfectly before the 0.3.2 update.
I updated to 0.3.3 now. We’ll see if it’s ok or not.

The S-Dongle is set to “Keep connection”