[APP][Pro] Modbus

Modbus
A small tool to add every Modus/TCP device to Homey

HomeyPro_Modbus_AppLogo


This tool allows to add any Modbus/TCP device to Homey without a specific app.
You can read and write Modbus register with flows.

How to start?

Add a device. Insert the Modbus details of your device including IP address, port and Modbus device ID.

The Homey device doesn’t offer functionality. It only connects to your Modbus device.

How to read/write register?

Create a flow and use the dvice flow actions to read a register.

Use the second flow action to write a register.

Be careful! Use the manufacture Modbus reference.
Change only those registers for which the meaning is known.
Read the register before and remember it’s value to be able to reset the value to a default value.


A description and a use case reading and writing register of a Fronius inverter is available on my Homepage:

There you can register for a newsletter to get updated when a new blog post is published.
And you can ask for further blog posts about examples, HowTo’s and technical insights.

9 Likes

reserved 01

reserved 02

this is nice!
Currently I’m running some commands on a Huawei inverter via python scripts via huawei_solar module.
It would be nice to have it directly in Homey.

I’ll read the documentation and come back with results.

Version 0.1.2:

  • Fixed flow card registration.

Sorry for the bug preventing usage of flow cards :upside_down_face:
Please update to this version to use the flow cards.

1 Like

I added some examples for the Fronius Gen24 Inverter and BYD battery to

  • restrict battery discharge while charging car from grid
  • force battery charge (low pv yield) during a cheap tariff
1 Like

nice,

will check it , did you solve all these variations of registers type, mostly (u)int16 are easy but (u)int32 , float32, uint64 are hard with LE and BE plus everyone is doing it differently.

Hi,
Fronius only uses uint and int for most useful registers. Some are bitfields, but can be set with int values.
The complete register list you can get at:
https://www.fronius.com/en/solar-energy/installers-partners/technical-data/all-products/system-monitoring/open-interfaces/modbus-tcp

You need to register with your name/email. But I can send you the file(s) via mail if you would send me your email address.

I only checked the ones I need for direct control of charge/discharge and min SoC level.
I don’t think there is much more you can control.

1 Like

if you want and have a vpn , I can try to add it. I know in Germany it is very popular.

It would be great if you could add INT32 (Signed integer 32 bits) as I need this for Huawei:

2 Likes

I would be happy if INT32 could be included. Also using Huawei. Thanks!

New test version 0.1.4:

  • added some data types to read register flow card.

@Andi @Bosse_Rasater
Can you please install the test version and try if it’s reading the data correctly?

1 Like

I’ve done a quick test with INT32 on a couple of registers and it seems to work great.
Thank you for your quick response to the request!

1 Like

New test version 0.1.5:

  • Added numeric rersult token to “read register” flow card.
    You can use the numeric results now directly in other flow cards.
    grafik

And as hint a use case for the SCALE type:
If you have INT values representing numeric decimal values, then you will find a scale register in addition.
The scale represents a factor for decimal point shift.
If the register value is -2, it means you have to calculate a value 10000 * 10^-2 to get the real value of 100,00.

If you read a register of type sunssf as INT16, you will get “-2” as result.


If you read it as type SCALE, you get “0.01” as result, so you can directly us this factor in flows.

1 Like

It works! Thank you

3 Likes

Hi, i am having still problems to read out modbus.
I have also Huawei Dongle Dongle-TA22B0293914
and SUN2000-10KTL-M1 converter. I want to read out the PV active power. It should be a 32-bit signed integer on adress 32095 with size 2. But it doesn’t work at all. I always get the error code Encountered an unexpected error value: ‘[object Object]’
Who can help me? Someone else using Huawei?
Thats the flow card:
image

Second Question: Does anyone know the register for the SOC of the battery?

Can you please use test version 0.1.6. I adjusted the error handling. I hope the content is now visible in the message.

SOC:

New app version provides numeric results for “read register” flow card.

1 Like

Battery SOC (Huawei Luna):

1 Like

Thanx for your examples. I’ve learned much of it. But now I realize a huge new problem:
I have 18,4 kwpeak of solar capacity. That is why I have two inverter! I have first read out the active power of only one inverter and i wondered why the watt number is so low compared to thefusion solar app. Now i realized that on ID 1 there is the inverter one with 8 kW and on ID 2 is the second inverter with 10 kW. The battery is also on inverter 2. Is that the reason I wasn’t able to read out battery SOC?
Now i have add a second modbus-module with the same IP but with ID2. But since than, i am not able to read out anything. Is it because its now dark outside and the inverters are sleeping? Or is the Modbus/TCP App not able to handle 2 different IDs???
That might be an interesting question directly to the developer! @RonnyW !