# \[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:** 5

<div class="post-metadata">

**Author:** ![Sasan\_Khandanpour](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/sasan_khandanpour/32/79941_2.png) [@Sasan\_Khandanpour](https://community.homey.app/u/Sasan_Khandanpour)\
**Post date:** [March 7, 2024, 8:09am UTC](https://community.homey.app/t/app-pro-modbus-connect-every-modbus-devices/104497/81 "2024-03-07T08:09:03Z")

</div>

I first set the connection type to keep connection as well, but i realised, that after 2-3 hours the connection gets closed (maybe by the dongle itself?). So I made to manual so that I can restart the connection (close and open) when the read query stucks with the typical error (no modbus connection). I didn’t try out if it workes like this, I hav to wait now 2 hours till it stucks again, and I hope the automatic restart works.

---

<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:** [March 7, 2024, 8:25am UTC](https://community.homey.app/t/app-pro-modbus-connect-every-modbus-devices/104497/82 "2024-03-07T08:25:01Z")

</div>

The app should reconnect itself. But perhaps the apps state is wrong and it thinks it’s still connected. I’ll check later if that’s the cause.

The connection handling is a bit ugly if you are combining the socket and the modbus classes 🙃

---

<div class="post-metadata">

**Author:** ![Valentin\_Ciopei](https://avatars.discourse-cdn.com/v4/letter/v/6bbea6/32.png) [@Valentin\_Ciopei](https://community.homey.app/u/Valentin_Ciopei)\
**Post date:** [March 7, 2024, 9:00am UTC](https://community.homey.app/t/app-pro-modbus-connect-every-modbus-devices/104497/83 "2024-03-07T09:00:15Z")

</div>

I get the same error with 0.3.3. No connection to modbus server.  
I also tried to use Manual or Single connect. It works 1-2 times then it fails.

LE: reverted to 0.1.5 and it works perfectly.

---

<div class="post-metadata">

**Author:** ![Bosse\_Rasater](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/bosse_rasater/32/78632_2.png) [@Bosse\_Rasater](https://community.homey.app/u/Bosse_Rasater)\
**Post date:** [March 7, 2024, 11:05am UTC](https://community.homey.app/t/app-pro-modbus-connect-every-modbus-devices/104497/84 "2024-03-07T11:05:45Z")

</div>

I also reverted to 0.1.5 and it works perfectly. I have a Huawei inverter

---

<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:** [March 7, 2024, 3:45pm UTC](https://community.homey.app/t/app-pro-modbus-connect-every-modbus-devices/104497/85 "2024-03-07T15:45:25Z")

</div>

I think it’s the auto reconnect after the inverter closes the connection that’s not working. I’ll check it later…

---

<div class="post-metadata">

**Author:** ![Sasan\_Khandanpour](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/sasan_khandanpour/32/79941_2.png) [@Sasan\_Khandanpour](https://community.homey.app/u/Sasan_Khandanpour)\
**Post date:** [March 7, 2024, 8:32pm UTC](https://community.homey.app/t/app-pro-modbus-connect-every-modbus-devices/104497/86 "2024-03-07T20:32:44Z")

</div>

manual reconnection doesn’t work either. After 30 - 90 minutes the modbus app just stucks. And also close and reopen connection doesn’t work. Now i made a flow, whenever there is a error in one flow card, the modbus app will be restarted. With this I get along. All 30.90 minutes I get a restartm but it works. I am sure, ronny you’ll find the right solution.

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

---

<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:** [March 7, 2024, 8:58pm UTC](https://community.homey.app/t/app-pro-modbus-connect-every-modbus-devices/104497/87 "2024-03-07T20:58:53Z")

</div>

And all issues started while trying to bring single connection and multi device together 😅

---

<div class="post-metadata">

**Author:** ![Sasan\_Khandanpour](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/sasan_khandanpour/32/79941_2.png) [@Sasan\_Khandanpour](https://community.homey.app/u/Sasan_Khandanpour)\
**Post date:** [March 8, 2024, 4:31am UTC](https://community.homey.app/t/app-pro-modbus-connect-every-modbus-devices/104497/88 "2024-03-08T04:31:40Z")

</div>

As mentioned, I set up a flow to restart the Modbus app when there is a error code coming with readout of a Modbus address. With this I get my data read. With the modus “Keep connection” the error code comes more often than in manual mode. As suggested from Ronny I put a timeline message on each restart of Modbus app:

 ![Screenshot_20240308_052205_Homey](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/5/7/5719a3982cc4003710fbda7b8a0c09487c964b5b.jpeg)  
@Bosse_Rasater in older versions the connection only worked if you connect directly and exclusive to one single ID. But connection to more than one ID didn’t work with my Huawei system. Also if it worked at all, it always stopped after two hours or earlier. Ronny doesn’t have problems with his own fronius inverter. This seems to be a Huawei specific problem. So thanks to him that he invested so much of his time to help us Huawei users to get along.

---

<div class="post-metadata">

**Author:** ![Bosse\_Rasater](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/bosse_rasater/32/78632_2.png) [@Bosse\_Rasater](https://community.homey.app/u/Bosse_Rasater)\
**Post date:** [March 8, 2024, 8:15am UTC](https://community.homey.app/t/app-pro-modbus-connect-every-modbus-devices/104497/89 "2024-03-08T08:15:10Z")

</div>

OK I understand.  
It’s not a problem for me as I only have one inverter connected with a wifi dongle. I reverted to version 0.1.5 which works great for my purposes. Also version 0.2.0 worked perfectly but it is not available anymore. I agree with you that we should give RonnyW a big thank you for the effort.

---

<div class="post-metadata">

**Author:** ![PO\_Blomstrand](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/po_blomstrand/32/12476_2.png) [@PO\_Blomstrand](https://community.homey.app/u/PO_Blomstrand)\
**Post date:** [March 8, 2024, 9:40am UTC](https://community.homey.app/t/app-pro-modbus-connect-every-modbus-devices/104497/90 "2024-03-08T09:40:25Z")

</div>

@Bosse_Rasater I have the same situation, that is a single inverter with a Wifi dongle. Can’t get it to work (“no connection to server”) but my suspicion is that Modbus TCP simply is not activated on my dongle. Until I get that fixed, would You be so kind and tell me what combination of ID and port that works for You? Both port 502 and 6607 are mentioned here and there. Seems to depend on what version of firmware you have. What works for You?

---

<div class="post-metadata">

**Author:** ![Valentin\_Ciopei](https://avatars.discourse-cdn.com/v4/letter/v/6bbea6/32.png) [@Valentin\_Ciopei](https://community.homey.app/u/Valentin_Ciopei)\
**Post date:** [March 8, 2024, 12:02pm UTC](https://community.homey.app/t/app-pro-modbus-connect-every-modbus-devices/104497/91 "2024-03-08T12:02:25Z")

</div>

Usually port is 502 and ID is 1.

---

<div class="post-metadata">

**Author:** ![Bosse\_Rasater](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/bosse_rasater/32/78632_2.png) [@Bosse\_Rasater](https://community.homey.app/u/Bosse_Rasater)\
**Post date:** [March 8, 2024, 1:06pm UTC](https://community.homey.app/t/app-pro-modbus-connect-every-modbus-devices/104497/92 "2024-03-08T13:06:07Z")

</div>

I use port 502 and ID 1.  
You have to activate Modbus in the Dongle. I use the “unrestricted” option. I don’t know if you need an installer account to do this.

---

<div class="post-metadata">

**Author:** ![PO\_Blomstrand](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/po_blomstrand/32/12476_2.png) [@PO\_Blomstrand](https://community.homey.app/u/PO_Blomstrand)\
**Post date:** [March 8, 2024, 2:28pm UTC](https://community.homey.app/t/app-pro-modbus-connect-every-modbus-devices/104497/93 "2024-03-08T14:28:30Z")

</div>

@Bosse_Rasater @Valentin_Ciopei  
Thanks both of you!  
I have sent mail to my installer to see if they remotely can set the “unrestricted” option for Modbus.  
/PO

---

<div class="post-metadata">

**Author:** ![MF\_212](https://avatars.discourse-cdn.com/v4/letter/m/f9ae1b/32.png) [@MF\_212](https://community.homey.app/u/MF_212)\
**Post date:** [March 8, 2024, 10:54pm UTC](https://community.homey.app/t/app-pro-modbus-connect-every-modbus-devices/104497/94 "2024-03-08T22:54:52Z")

</div>

What does it look like if you have connected the dongle via a network cable? Or is there no difference to WiFi?

---

<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:** [March 10, 2024, 1:46pm UTC](https://community.homey.app/t/app-pro-modbus-connect-every-modbus-devices/104497/95 "2024-03-10T13:46:53Z")

</div>

New **test version 0.3.4** :

- Fixed device reconnect (hopefully 🙂 )

Who wants to test?  
FYI: @Sasan_Khandanpour, @Bosse_Rasater , @Valentin_Ciopei, @PO_Blomstrand

---

<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:** [March 10, 2024, 1:51pm UTC](https://community.homey.app/t/app-pro-modbus-connect-every-modbus-devices/104497/96 "2024-03-10T13:51:37Z")

</div>

@RonnyW Many thanks again for this great app. Today was the first day I was actually able to control my heat pump thanks to it!

What I found that the app seems to crash from time to time. The modbus connection is then down and the only possibility to get it reestablished is to restart the app.

Do you think it will be possible in the future to also write negative values? E.g. the offset of my heating curve supports values in the range -10 to +10, but right now I can only write 0 to +10.  
 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/6/e/6e83264e0ad475c033e9ee5f57cdef6d73246617.png)

Also, when trying to read certain registers with size 6 and INT64, the flow card just hangs forever. (INT32 would result in non-sense values, therefore I tried INT64).  
 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/6/d/6d105085d38453e41f867a1109bc4b1289c761a8.png)

Please let me know if I can help in anyway.

---

<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:** [March 10, 2024, 2:12pm UTC](https://community.homey.app/t/app-pro-modbus-connect-every-modbus-devices/104497/97 "2024-03-10T14:12:33Z")

</div>

> [@CaptainVoni](#):
>
> What I found that the app seems to crash from time to time. The modbus connection is then down and the only possibility to get it reestablished is to restart the app.

That was a reconnect issue. The app didn’t reconnect after the connection was closed by the Modbus device. Thsi should be fixed in new test version - hopefully 🙂

I will check the datatypes. I hope I find some registers to work with…

---

<div class="post-metadata">

**Author:** ![Geim](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/geim/32/113356_2.png) [@Geim](https://community.homey.app/u/Geim)\
**Post date:** [March 10, 2024, 4:09pm UTC](https://community.homey.app/t/app-pro-modbus-connect-every-modbus-devices/104497/98 "2024-03-10T16:09:22Z")

</div>

Been looking for a Modbus app for a long time and gave up. Too soon now I see 😁  
Great app, thanks! No problem retrieving data from my M-Tec heatpump (with Keba controller).

---

<div class="post-metadata">

**Author:** ![Sasan\_Khandanpour](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/sasan_khandanpour/32/79941_2.png) [@Sasan\_Khandanpour](https://community.homey.app/u/Sasan_Khandanpour)\
**Post date:** [March 10, 2024, 5:56pm UTC](https://community.homey.app/t/app-pro-modbus-connect-every-modbus-devices/104497/99 "2024-03-10T17:56:04Z")

</div>

Which brand is your inverter? I have Huawei. First you need your provider to activate Modbus unregistered… You could do it by yourself using a special Huawei app. But you need to have the password. Must PV installer change password to avoid you making something wrong… But they can do it remotely.  
Than you must first install the dongle using ID 100. Next you must install the inverter using id1. You can ask your provider which Id is right

---

<div class="post-metadata">

**Author:** ![Sasan\_Khandanpour](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/sasan_khandanpour/32/79941_2.png) [@Sasan\_Khandanpour](https://community.homey.app/u/Sasan_Khandanpour)\
**Post date:** [March 10, 2024, 5:57pm UTC](https://community.homey.app/t/app-pro-modbus-connect-every-modbus-devices/104497/100 "2024-03-10T17:57:35Z")

</div>

I’ll test immediately

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

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