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

<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:** [April 21, 2024, 10:48am UTC](https://community.homey.app/t/app-pro-modbus-connect-every-modbus-devices/104497/241 "2024-04-21T10:48:41Z")

</div>

> [@Sasan\_Khandanpour](#):
>
> “registerType is not defined”

Hi, I made a typo error in curent test version (slave device only). I try to fix it asap 🙂

@Sasan_Khandanpour : should be fixed with version 0.7.10

---

<div class="post-metadata">

**Author:** ![freki](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/freki/32/7111_2.png) [@freki](https://community.homey.app/u/freki)\
**Post date:** [April 21, 2024, 1:17pm UTC](https://community.homey.app/t/app-pro-modbus-connect-every-modbus-devices/104497/242 "2024-04-21T13:17:26Z")

</div>

In version 0.7.10 the problem with “registerType is not defined” is fixed! Great!  
Thanks!

---

<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:** [April 22, 2024, 4:52pm UTC](https://community.homey.app/t/app-pro-modbus-connect-every-modbus-devices/104497/243 "2024-04-22T16:52:51Z")

</div>

New **test version 0.8.0** :

- Added **new types to write register** flow card (FLOAT32/LE/LE-16bit).

@CaptainVoni FYI and test 😉

---

<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:** [April 22, 2024, 6:03pm UTC](https://community.homey.app/t/app-pro-modbus-connect-every-modbus-devices/104497/244 "2024-04-22T18:03:27Z")

</div>

> [@RonnyW](#):
>
> Added **new types to write register** flow card (FLOAT32/LE/LE-16bit)

I can only test FLOAT32-LE (16bit Word LE), but this works now flawless. Many thanks!

@Edwin_Biemond You might want to take a look at this. I can write with it pretty much every value to battery charge/discharge power on my Solaredge inverter. Maybe you can use the code from @RonnyW to improve the Solaredge app.

---

<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:** [April 22, 2024, 6:18pm UTC](https://community.homey.app/t/app-pro-modbus-connect-every-modbus-devices/104497/245 "2024-04-22T18:18:58Z")

</div>

@Edwin_Biemond Nothing special 🙂  
[homey.modbus/drivers/modbus/device.js at 0.8.0 · RonnyWinkler/homey.modbus · GitHub](https://github.com/RonnyWinkler/homey.modbus/blob/0.8.0/drivers/modbus/device.js#L514)

---

<div class="post-metadata">

**Author:** ![Edwin\_Biemond](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/edwin_biemond/32/72686_2.png) [@Edwin\_Biemond](https://community.homey.app/u/Edwin_Biemond)\
**Post date:** [April 22, 2024, 7:14pm UTC](https://community.homey.app/t/app-pro-modbus-connect-every-modbus-devices/104497/246 "2024-04-22T19:14:01Z")

</div>

oh you mean instead of fixed values. let me check

---

<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:** [April 23, 2024, 11:22am UTC](https://community.homey.app/t/app-pro-modbus-connect-every-modbus-devices/104497/247 "2024-04-23T11:22:05Z")

</div>

@RonnyW Have you considered adding a generic server device to your app, i.e. something that simulates a modbus device that others could connect to?

Example of a use case: my heat pump could - in theory - directly talk to my inverter. But in practice this doesn’t really work, because the heat pump just looks at the available DC power, which is not only PV yield, but also battery power. And - in my special case - it only looks at the DC power of one inverter, but I have two, so the heat pump completely misses the yield of the second inverter.  
A generic modbus server could simulate an inverter and return as available DC power the combined PV yield, but without battery power.

I have a (very) rough idea how that could look like in a flow that gets the requests and responds accordingly.

---

<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:** [April 23, 2024, 1:13pm UTC](https://community.homey.app/t/app-pro-modbus-connect-every-modbus-devices/104497/248 "2024-04-23T13:13:31Z")

</div>

But aren’t the devices connected serial by wire (Modbus RTU)?  
How could a device connect to a Modbus TCP server?

---

<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:** [April 23, 2024, 1:20pm UTC](https://community.homey.app/t/app-pro-modbus-connect-every-modbus-devices/104497/249 "2024-04-23T13:20:33Z")

</div>

> [@RonnyW](#):
>
> But aren’t the devices connected serial by wire (Modbus RTU)?

No necessarily. My heat pump connects via Modbus/TCP to the inverter.

---

<div class="post-metadata">

**Author:** ![Itz\_Volker](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/itz_volker/32/79451_2.png) [@Itz\_Volker](https://community.homey.app/u/Itz_Volker)\
**Post date:** [April 23, 2024, 5:44pm UTC](https://community.homey.app/t/app-pro-modbus-connect-every-modbus-devices/104497/250 "2024-04-23T17:44:07Z")

</div>

> [@RonnyW](#):
>
> New **test version 0.6.0** :
> 
> - Added new Types: little-endian (LE) for all typed,
> - Removed FLOAT16
> 
> @Itz_Volker: FYI. If I’m right you wanted FLOAT32LE as type?

Hi Ronny, I have no included my IDM Heatpump in the Modbus APP. I have now the Photvoltaic Installation and my IDM Heatpump. One with LE and one with BE. All works so far fine.

Thanks a lot!

---

<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:** [April 26, 2024, 11:11pm UTC](https://community.homey.app/t/app-pro-modbus-connect-every-modbus-devices/104497/251 "2024-04-26T23:11:44Z")

</div>

Im totaly new to this. Does anyone have a flow to forcecharge the Battery?

For example i want to set the minimum chargelimit to lets say 2000 w the cheapest hour. But i cant find the right register for that.

I have fronius Gen24 with Byd Battery.

I have managed to ser maximum discharge from the exampel

---

<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:** [April 27, 2024, 8:20am UTC](https://community.homey.app/t/app-pro-modbus-connect-every-modbus-devices/104497/252 "2024-04-27T08:20:17Z")

</div>

1. Download the [Modus reference](https://www.fronius.com/~/downloads/Solar%20Energy/Operating%20Instructions/gen24-modbus-api-external-docs.zip) from Fronius for Gen24+BYD

2. Use the file: Gen24\_Primo\_Symo\_Inverter\_Register\_Map\_Int&SF\_storage.xlsx

3. Search the List for your Register. Check this thread or the web for a use case.

4. Allow charging from grid in Fronius settings.

Example 1: Set minimun SoC  
You can set a minimun SoC during a cheap hour. Th ebattery will be charged until the SoC is reached.  
The benefit: You can charge to a wished SoC independent of the previous state. Teh battery will charge and stop at the SoC automatically.  
Then you can set the min SoC back to 0% to stop forced charging.

Fronius list:

 ![grafik](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/6/5/652582aebc9e749c3d4217a60832071d019c3363.png)

 ![grafik](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/d/c/dcbda460ca80d18ae324130d09c616756a3504f4.png)  
This is a flow woth a numeric input parameter. This parameter is written to the Register.  
The value is the percentage x 100 (5000 = 50%).

Example 2: Set charge power  
You can set the charge power to a ampere value. The battery is charged with this power until you reset the register to default values.  
Disadvantage: The battery will be charged independet of previous state. If you still have 50% SoC and want only to charge to 70%, you have to calculate by yourself, how many ampere and how long you need to charge.

Fronius list:

 ![grafik](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/0/3/03905dba61626f709b56347e0927ba46f024bdbd.png)  
 ![grafik](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/7/b/7b6c8571eb3816f26affd61bb34794041b9bd372.png)

Flow:

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

This flow can be started with a variable or directly (start button) with a preset power.  
-5000 means -50%: The battery is forced to charged with 50% of max charge power.

To stop forced chargin, reset the registers to the default.  
 ![grafik](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/f/b/fb55dad311163222ed5d050728106ed64ff13527.png)  
The last card sets min SoC to 5%

---

<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:** [April 27, 2024, 10:52am UTC](https://community.homey.app/t/app-pro-modbus-connect-every-modbus-devices/104497/253 "2024-04-27T10:52:29Z")

</div>

Thank you so much.

My plan is for example

The hour is one of the cheapest 6 hours. Chargé with 2000w delay 59 minutes and set the rule to 0 (no rules).

Tibber have great cards for cheapest hours

---

<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:** [April 27, 2024, 11:00am UTC](https://community.homey.app/t/app-pro-modbus-connect-every-modbus-devices/104497/254 "2024-04-27T11:00:06Z")

</div>

In this case, the example 2 should work. You have to try a bit with the value. If you have 10kW max set in your inverter, you can set -2000 (=20% of 10kW) to charge with 2kW.

---

<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:** [April 28, 2024, 9:16pm UTC](https://community.homey.app/t/app-pro-modbus-connect-every-modbus-devices/104497/255 "2024-04-28T21:16:50Z")

</div>

Thanks again. Is there any problem to forcecharge? what happens when the battery gets 100%. Just stop charging and will not discharge until i have set the registers to allow that?

---

<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:** [April 29, 2024, 10:57am UTC](https://community.homey.app/t/app-pro-modbus-connect-every-modbus-devices/104497/256 "2024-04-29T10:57:50Z")

</div>

Yes, I think this happens.  
Battery charges to max SoC. I also think it charges to the max SoC you set in Fronius inverter settings. And will keep this limit until you reset the registers. If you have some energy usage, it will also use energy from grid as the battery is forced to charge and won’t allow discharging during this period

---

<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:** [April 29, 2024, 2:58pm UTC](https://community.homey.app/t/app-pro-modbus-connect-every-modbus-devices/104497/257 "2024-04-29T14:58:32Z")

</div>

Thanks, i made a flow that checks SOC every 20min, if its \>80% it reset registers.

And a flow that charge the battery four of the chespest hours with 2000W. But only if the SOC is \<80%.

So the cheapest hours charging and stops after 55min or SOC \>80% that updates every 20min.

---

<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:** [April 30, 2024, 12:13pm UTC](https://community.homey.app/t/app-pro-modbus-connect-every-modbus-devices/104497/258 "2024-04-30T12:13:48Z")

</div>

Do Fronius inverters not have some kind of battery charging mode? I’m just curious, because there are multiple modes on Solaredge and I always thought that this is standard. So I’m a little surprised.

---

<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:** [April 30, 2024, 3:18pm UTC](https://community.homey.app/t/app-pro-modbus-connect-every-modbus-devices/104497/259 "2024-04-30T15:18:26Z")

</div>

What modes does a Solaredga offer?  
The Fronius is mainly an out of the box automated system.  
You can set min/max SoC and turn charging from grid on/off.  
Via local http access you can set timedependent rules to charge/discharge with a min and/or max ampere level.  
But most settings are more for advanced users and we can overrule them via Modbus now.

Fronius puts it’s main focus of integration of its own products.  
So you can easily set up and automate PV charging with a fronius wallbox. That’s really easy and extensive.  
And their hot water devices are also integrated with priorities for water/car etc.

But charhing/discharging from grid is not really focused. I think that’s not requested from many ‘normal’ users. They just use their PV energy and if the battery is empty, the grid is used.  
I think that"s caused by common fixed price electricity contracts.

---

<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 1, 2024, 6:48am UTC](https://community.homey.app/t/app-pro-modbus-connect-every-modbus-devices/104497/260 "2024-05-01T06:48:48Z")

</div>

> [@RonnyW](#):
>
> What modes does a Solaredga offer?

Every mode a nerdy heart desires.

- The usual maximise self consumption, i.e. use PV power first for consumption and charge the battery with any excess power
- The other way around: use PV power first to charge the battery and only use excess power to meet demand.
- Charge at the maximum power from PV and grid
- Only charge with power that exceeds the AC power of the inverter
- Don’t charge at all

And for discharging you may choose between meet demand, full power (i.e. export) and no discharge.

On top of this you may freely specify the maximum battery charge and discharge power and the maximum AC power of the inverter.

You can use all of this to optimise your costs, prolong battery life and support the grid. For example you can move available battery power to the hours of high electricity costs by disabling discharging in hours with lower prices (green=PV, blue=battery, red=grid, bar height is electricity price, percentages above are battery levels, 12% is my minimum SOC):

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

Or completely switch off PV production during hours of negative prices to support the grid and earn some money:

 ![Inverter aus](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/b/6/b63bb26539eebb9cdb5c0bddf68b36051e40c051.jpeg)

Or delay the battery charge on days with high yield and low consumption (aka summer) so that your battery doesn’t cook all day at 100%:

 ![Delayed charge](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/8/1/817f470cf2921d39dcd03e984d55d9a8177495ea.jpeg)

Or get 9.15kW out of a 8kW inverter by saving space in the battery for hours, when the module power exceeds the inverter’s AC limit.

 ![Clipper power charging](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/b/d/bd40bcc8bea39a97bd5b374cba73d5a62a2d154a.png)

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

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