# \[APP\]\[Pro\] Modbus - Connect every Modbus devices

**URL:** <https://community.homey.app/t/app-pro-modbus-connect-every-modbus-devices/104497>\
**Category:** Apps\
**Tags:** app, homey-pro, advancedflow\
**Created:** [February 20, 2024, 7:13pm UTC](https://community.homey.app/t/app-pro-modbus-connect-every-modbus-devices/104497 "2024-02-20T19:13:05Z")\
**Posts on this page:** 20\
**Page:** 14

<div class="post-metadata">

**Author:** ![Andreas\_Kjork](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/andreas_kjork/32/8354_2.png) [@Andreas\_Kjork](https://community.homey.app/u/Andreas_Kjork)\
**Post date:** [May 7, 2024, 6:59am UTC](https://community.homey.app/t/app-pro-modbus-connect-every-modbus-devices/104497/261 "2024-05-07T06:59:26Z")

</div>

I think i Will try your example to stop production. I just have to find the right registers.

---

<div class="post-metadata">

**Author:** ![CaptainVoni](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/captainvoni/32/3549_2.png) [@CaptainVoni](https://community.homey.app/u/CaptainVoni)\
**Post date:** [May 7, 2024, 8:49am UTC](https://community.homey.app/t/app-pro-modbus-connect-every-modbus-devices/104497/262 "2024-05-07T08:49:10Z")

</div>

> [@Andreas\_Kjork](#):
>
> I just have to find the right registers.

Did you take a look into [this document](https://www.fronius.com/QR-link/0024)? Just search for WMaxLimPct and make sure to consider the scaling factor for this register.

---

<div class="post-metadata">

**Author:** ![Andreas\_Kjork](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/andreas_kjork/32/8354_2.png) [@Andreas\_Kjork](https://community.homey.app/u/Andreas_Kjork)\
**Post date:** [May 8, 2024, 10:01am UTC](https://community.homey.app/t/app-pro-modbus-connect-every-modbus-devices/104497/263 "2024-05-08T10:01:23Z")

</div>

Hi.  
I cant make my fronius to force discharge my battery, i cant find witch register to use. Have you made any flows there you discharge your battery for example during expensive hours?

---

<div class="post-metadata">

**Author:** ![Andreas\_Kjork](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/andreas_kjork/32/8354_2.png) [@Andreas\_Kjork](https://community.homey.app/u/Andreas_Kjork)\
**Post date:** [May 8, 2024, 1:44pm UTC](https://community.homey.app/t/app-pro-modbus-connect-every-modbus-devices/104497/264 "2024-05-08T13:44:51Z")

</div>

Im to dumb for this, i cant find the register, i cant make the battery to discharge when the price is high either.

---

<div class="post-metadata">

**Author:** ![RonnyW](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/ronnyw/32/10879_2.png) [@RonnyW](https://community.homey.app/u/RonnyW)\
**Post date:** [May 8, 2024, 2:23pm UTC](https://community.homey.app/t/app-pro-modbus-connect-every-modbus-devices/104497/265 "2024-05-08T14:23:17Z")

</div>

> [@Andreas\_Kjork](#):
>
> force discharge my battery

Hi, here is an example (sorry, only german):

 ![grafik](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/b/3/b3ec32fc18a9bfeaf40eaf159b6c3d674690ed6e.png)

Thsi flow can be started from another one (Input trigger) providing the target value.  
Or you can start directly/manually with the fixed value used from the play button.

---

<div class="post-metadata">

**Author:** ![RonnyW](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/ronnyw/32/10879_2.png) [@RonnyW](https://community.homey.app/u/RonnyW)\
**Post date:** [May 8, 2024, 2:25pm UTC](https://community.homey.app/t/app-pro-modbus-connect-every-modbus-devices/104497/266 "2024-05-08T14:25:21Z")

</div>

Some examples how to use Fronius registers to charge/discharge can be found in this HomeAssistant description.  
[Fronius and BYD battery control via Modbus](https://www.libe.net/en-byd-modbus)

---

<div class="post-metadata">

**Author:** ![Andreas\_Kjork](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/andreas_kjork/32/8354_2.png) [@Andreas\_Kjork](https://community.homey.app/u/Andreas_Kjork)\
**Post date:** [May 8, 2024, 2:40pm UTC](https://community.homey.app/t/app-pro-modbus-connect-every-modbus-devices/104497/267 "2024-05-08T14:40:23Z")

</div>

Thanks again for helping me learn. What type is used for register 40356? Instead of setting % i want to set a fixed Watt. i have followed your flow above

---

<div class="post-metadata">

**Author:** ![RonnyW](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/ronnyw/32/10879_2.png) [@RonnyW](https://community.homey.app/u/RonnyW)\
**Post date:** [May 8, 2024, 2:48pm UTC](https://community.homey.app/t/app-pro-modbus-connect-every-modbus-devices/104497/268 "2024-05-08T14:48:57Z")

</div>

You can only set a percentage of max. charge/discharge power that is defined in technical inverter settings:

 ![grafik](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/8/8/8803669d2d04dd305ca758f769fa9a9ed654a5e3.png)

10000 = 100% because Fronius uses INT+SF values for Modbus/TCP. That means for percentage values, a factor 100 is used to pass INT values instead of float values via Modbus API.

The type is INT16 for 40357. I used the wrong register for the input trigger. I exchanged the screenshot in the last post.

---

<div class="post-metadata">

**Author:** ![Andreas\_Kjork](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/andreas_kjork/32/8354_2.png) [@Andreas\_Kjork](https://community.homey.app/u/Andreas_Kjork)\
**Post date:** [May 8, 2024, 3:24pm UTC](https://community.homey.app/t/app-pro-modbus-connect-every-modbus-devices/104497/269 "2024-05-08T15:24:28Z")

</div>

Thanks. That was very helpful, i have tried this out and now i can discharge my battery at for example the 4 most expensive hours.

---

<div class="post-metadata">

**Author:** ![Andreas\_Kjork](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/andreas_kjork/32/8354_2.png) [@Andreas\_Kjork](https://community.homey.app/u/Andreas_Kjork)\
**Post date:** [May 8, 2024, 3:25pm UTC](https://community.homey.app/t/app-pro-modbus-connect-every-modbus-devices/104497/270 "2024-05-08T15:25:50Z")

</div>

![Flow](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/a/b/ab597bfd43c23d7cc1b669a61c9aeac15197dc88.png)

---

<div class="post-metadata">

**Author:** ![Oscar\_Dekkers](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/oscar_dekkers/32/24616_2.png) [@Oscar\_Dekkers](https://community.homey.app/u/Oscar_Dekkers)\
**Post date:** [May 8, 2024, 3:58pm UTC](https://community.homey.app/t/app-pro-modbus-connect-every-modbus-devices/104497/271 "2024-05-08T15:58:21Z")

</div>

Dear RonnyW,

thanks for the nice app.

I do have another usecase, i have a waveshare Modbus ETH Relay and that is basically 8 coils (relais)  
I was not able to write to the coils. Is it possible to add a writeCoil card to your app?

With Kind regards

---

<div class="post-metadata">

**Author:** ![RonnyW](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/ronnyw/32/10879_2.png) [@RonnyW](https://community.homey.app/u/RonnyW)\
**Post date:** [May 8, 2024, 9:04pm UTC](https://community.homey.app/t/app-pro-modbus-connect-every-modbus-devices/104497/272 "2024-05-08T21:04:38Z")

</div>

> [@Oscar\_Dekkers](#):
>
> Is it possible to add a writeCoil card to your app?

Sure. I haven’t added it yet because I can’t test it with my inverter. So you are my beta tester 😉

---

<div class="post-metadata">

**Author:** ![RonnyW](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/ronnyw/32/10879_2.png) [@RonnyW](https://community.homey.app/u/RonnyW)\
**Post date:** [May 9, 2024, 10:50am UTC](https://community.homey.app/t/app-pro-modbus-connect-every-modbus-devices/104497/273 "2024-05-09T10:50:35Z")

</div>

New **test version 0.9.0** :

- Added flow card to write Coil register  
 ![grafik](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/9/0/9036900b945442c7a1c983a3544809992a2d4fe3.png)

> **[Modbus](https://homey.app/en-us/app/org.modbus/Modbus/)**
>
> Connect every Modbus devices

@Oscar_Dekkers FYI. Please install the test version linked above and try if you can write your Coils. Thanks for testing.

---

<div class="post-metadata">

**Author:** ![Oscar\_Dekkers](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/oscar_dekkers/32/24616_2.png) [@Oscar\_Dekkers](https://community.homey.app/u/Oscar_Dekkers)\
**Post date:** [May 10, 2024, 7:10am UTC](https://community.homey.app/t/app-pro-modbus-connect-every-modbus-devices/104497/274 "2024-05-10T07:10:28Z")

</div>

will happily do it

---

<div class="post-metadata">

**Author:** ![Oscar\_Dekkers](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/oscar_dekkers/32/24616_2.png) [@Oscar\_Dekkers](https://community.homey.app/u/Oscar_Dekkers)\
**Post date:** [May 10, 2024, 7:25am UTC](https://community.homey.app/t/app-pro-modbus-connect-every-modbus-devices/104497/275 "2024-05-10T07:25:29Z")

</div>

Working as expected, thanks!

I can write the coils. Tested it with The waveshare Modbus POE ETH Relay ([https://www.waveshare.com/wiki/Modbus\_POE\_ETH\_Relay](https://www.waveshare.com/wiki/Modbus_POE_ETH_Relay))

i’m going to crete a virtual device (probably) per coil. As a thought would that be something to enhance the modbus app with a device per coil? A coil device which you can define a channel and use the existing modbus setup. Something similiar what you did with the slave modbus.

Anyway thanks for the quick response and the enhancement

---

<div class="post-metadata">

**Author:** ![RonnyW](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/ronnyw/32/10879_2.png) [@RonnyW](https://community.homey.app/u/RonnyW)\
**Post date:** [May 10, 2024, 7:38am UTC](https://community.homey.app/t/app-pro-modbus-connect-every-modbus-devices/104497/276 "2024-05-10T07:38:45Z")

</div>

Currently I won’t add further devices.  
Most users are just using the registers in flows/automations.  
Easiest way is to create an AdvancedFlow with a numeric input parameter and add your Modbus details there.  
Then you can start the flow everywhere and pass your parameter.

---

<div class="post-metadata">

**Author:** ![Peter\_Stern](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/peter_stern/32/72096_2.png) [@Peter\_Stern](https://community.homey.app/u/Peter_Stern)\
**Post date:** [May 20, 2024, 4:15pm UTC](https://community.homey.app/t/app-pro-modbus-connect-every-modbus-devices/104497/277 "2024-05-20T16:15:09Z")

</div>

Hi  
Great, your APP is really usefull. Thanks

I only have one problem with my PLUGGIT because they need FC16 (preset multiple register) instead of FC04 for writing. Is there a possibility to change this?

---

<div class="post-metadata">

**Author:** ![Peter\_Stern](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/peter_stern/32/72096_2.png) [@Peter\_Stern](https://community.homey.app/u/Peter_Stern)\
**Post date:** [May 20, 2024, 5:34pm UTC](https://community.homey.app/t/app-pro-modbus-connect-every-modbus-devices/104497/278 "2024-05-20T17:34:40Z")

</div>

I read in this topic there should already be FC16 within UINT32, so I am not sure what I did wrong. In the LOXONEI used exactly the same inputs and this is the protocol. Here it is taken from PLUGGIT.

 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/6/0/60e15b920c2fbfc9c2965b94ad78bf8806b216f9.png)

I am using this:

 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/b/a/ba2f74494fd23b28403f4659bfbfa05bbb29a709.png)

Reading is working. If I am writing, I can immediatelly read the correct value but the device is not using it (like with LOXONE). After reconnect with LOXONE it still change the value, also the device is changing and after reread with HOMEY it’s the new value from LOXONE.  
 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/d/c/dc10df17dfc9907503c76ffc4dc152fa822c7c5f.png)

There is no error code, but if I do not start connection I have following error code (only for get the values for comparing with working part from LOXONE. is there any difference?  
{“err”:“Offline”,“message”:“no connection to modbus server”,“request”:{“\_id”:28,“\_protocol”:0,“\_length”:11,“\_unitId”:1,“\_body”:{“\_fc”:16,“\_address”:323,“\_values”:{“type”:“Buffer”,“data”:[0,0,0,1]},“\_byteCount”:10,“\_numberOfBytes”:4,“\_quantity”:2,“\_valuesAsBuffer”:{“type”:“Buffer”,“data”:[0,0,0,1]},“\_valuesAsArray”:[0,1]}}}

---

<div class="post-metadata">

**Author:** ![RonnyW](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/ronnyw/32/10879_2.png) [@RonnyW](https://community.homey.app/u/RonnyW)\
**Post date:** [May 20, 2024, 8:13pm UTC](https://community.homey.app/t/app-pro-modbus-connect-every-modbus-devices/104497/279 "2024-05-20T20:13:47Z")

</div>

If you write a single register (2 bytes like UINT16), the FC 06 (Write Single Register) is used.  
For multi register values (4 bytes like UINT32), the FC 16 (Write Multiple Registers) is used.

A hint for your flow action: for a **signed 32 byte integer** you should use **INT32** , not UINT32 (what means unsigned). Perhaps the written values is buffered but not stored and later overwritten due to the wrong type. Just a thought.

About start connection:  
You need to connect via flow if auto-comnnect is not activated in device settings.  
 ![grafik](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/7/8/78d0540c2ec63fd8ebfc4607b56bbdc74cae10f8.png)

With this setting, the app should reconnect if the connection is closed by the server.  
This setting keeps the connection closed and you can connect if needed:  
 ![grafik](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/4/7/47dc3f8ff3c5aa95108008802e40717be3824432.png)

---

<div class="post-metadata">

**Author:** ![Peter\_Stern](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/peter_stern/32/72096_2.png) [@Peter\_Stern](https://community.homey.app/u/Peter_Stern)\
**Post date:** [May 21, 2024, 4:13am UTC](https://community.homey.app/t/app-pro-modbus-connect-every-modbus-devices/104497/280 "2024-05-21T04:13:24Z")

</div>

Thanks for your fast response.

I also tried with signed integer which should not be a different with numbers from 0-4 (fan level), but it is still not working. At the end I used UINT32 to have no difference to other system which is working.

Thanks also for the other hint, but I tried with all different versions

[Previous page](https://community.homey.app/t/app-pro-modbus-connect-every-modbus-devices/104497.md?page=13)

[Next page](https://community.homey.app/t/app-pro-modbus-connect-every-modbus-devices/104497.md?page=15)
