[APP][Pro] Modbus

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

@Sasan_Khandanpour : should be fixed with version 0.7.10

1 Like

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

New test version 0.8.0:

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

@CaptainVoni FYI and test :wink:

1 Like

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.

1 Like

@Edwin_Biemond Nothing special :slight_smile:
homey.modbus/drivers/modbus/device.js at 0.8.0 · RonnyWinkler/homey.modbus · GitHub

1 Like

oh you mean instead of fixed values. let me check

1 Like

@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.

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

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

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!

2 Likes

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

  1. Download the Modus reference 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:


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:


Flow:

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
The last card sets min SoC to 5%

1 Like

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

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.

1 Like

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?

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

1 Like

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.

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.

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.

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):

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

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%:

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.

2 Likes