Fronius Symo Gen 24 plus Batteries

I’ve got a Symo GEN 24 Plus with BYD 22.9kWh battery. it’s running the latest code - 1.28.7-1 and I’ve got ModBusTCP working - I can read/write to it.

BUT - the ramp down time for the panels is very long. Even when I tweak WMaxLimPct_RmpTms and WMaxLimPct_WinTms it seems to take about 5minutes to go from max output (close to 10kw) down to close to zero. It seems to ignore the values written to these registers.

I sent a support request to Fronius but haven’t had a reply.

Anyone seen this or have a solution?

Hey there, the services are at most times part of a script or an automation. The services get called in said script or automation by typing modbus…
Wth the excel you are on the right track but you need to look if its the right config (float or int+SF) and also subtract 1 of the numbers from the excel.

Hi,

great work. I tried the NodeRed flow from @Klangen82 but my inverter resets StorCtl_Mod value after a few seconds to zero if I try to disable discharging. I suspected the wallbox to do that but even after switching it of the register is being reset. Any ideas?

Cheers
Nils

Hi alle.
trying to use Home assistant to charge the battery, when power price is low.

I can, dis- and enable battery use …
Is there some one, there can help me, to get the battery pack to charge and discharge from the grid.
I have tried ChatGPT, and there is not a answer.

Modbus

  • type: tcp

    Put your Gen24 IP address here

    host: 192.168.107.11
    port: 502
    name: gen24

scripts

disable_battery_usage:
alias: disable battery usage BYD
sequence:

  • service: modbus.write_register
    metadata: {}
    data:
    hub: gen24
    address: 40348
    slave: 1
    value: 2
  • service: modbus.write_register
    metadata: {}
    data:
    hub: gen24
    address: 40355
    slave: 1
    value: 0
    mode: single
    icon: mdi:battery-off
    enable_battery_usage:
    alias: enable battery usage BYD
    sequence:
  • service: modbus.write_register
    metadata: {}
    data:
    hub: gen24
    address: 40355
    slave: 1
    value: 8000
  • service: modbus.write_register
    metadata: {}
    data:
    hub: gen24
    address: 40348
    slave: 1
    value: 0
    mode: single
    icon: mdi:battery-check

I charge the battery from grid by setting the “% WChaMax” to an percentage to which I want the battery to charge. When you are using Int&SF that would be address 40351 in the excel table.
To control the power it should be “InWRte”/40357 but that doesn’t work for me. It always charges with ~500W.

Beware this hurt my head, but I’ve managed to force charge and discharge on command. The key is using negative numbers to set the minimum charge and discharge rates. Like setting the minimum rate in the solar start battery management:

This concept is explained really well here, picturing it really helped https://loxwiki.atlassian.net/wiki/spaces/LOXEN/pages/1316061809/Fronius+Hybrid+with+Modbus+TCP?focusedCommentId=1698594976#b.-Battery-Charging%2FDischarging-Options

Force charging:
You have to set the outWRte rate to negative, but I got errors passing a negative int to modbus. So, I have a template that sets the rate to 100%, multiplies by 100 for scale factor 2, and makes it negative using some form of twos compliment for decimals, I dunno, it works:
{% set outWRte = 100 | int %}
{{ 65536 - outWRte * 100 }}
Then I have an automation to set the outWRte rate and set mode to charge:
action:

  • service: modbus.write_register
    metadata: {}
    data:
    hub: fronius
    slave: 1
    address: 40366
    value: “{{ states(‘sensor.battery_outwrte’) }}”
  • service: modbus.write_register
    metadata: {}
    data:
    hub: fronius
    address: 40358
    slave: 1
    value: 2
    mode: single

Force discharge:
You have to set the inWRte rate to negative and set the mode to discharge. I have a template to set the charge rate based on the available max and min charge level, then divides by 3 hours available to discharge:
{% set SoC = states(‘sensor.battery_soc’) | int %}
{% set MinSoC = 25 | int %}
{% if (SoC > MinSoC) %}
{{ 65536 - ((SoC - MinSoC) / 3) * 100 }}
{% else %}
{{ 0 }}
{% endif %}

And an automation to set the inWRte rate and the mode to discharge:
action:

  • service: modbus.write_register
    metadata: {}
    data:
    hub: fronius
    slave: 1
    address: 40366
    value: “{{ states(‘sensor.battery_inwrte’) }}”
  • service: modbus.write_register
    metadata: {}
    data:
    hub: fronius
    address: 40358
    slave: 1
    value: 1
    mode: single

You can stop the forced charge/discharge at any time by setting the mode back to normal with 0:
action:

  • service: modbus.write_register
    metadata: {}
    data:
    hub: fronius
    address: 40358
    slave: 1
    value: 0
    mode: single

Note you’ll need to change all the address values if you’re using the Int&SF register map.

Also note the forced rates achievable are restricted by the limits of the inverter and battery and the load demand.

Hi huffy - I am very much a HA newbie and have got a Fronius inverter and BYD batteries. I have the Modbus link set up and working and am now looking to control things a bit more smartly.
I have a couple of queries on your solution - what is the metadata line for in your modbus service call? And I’m assuming that the template sensor you refer to that calculates the outWRTe is the sensor.battery_outwrte? I’m going to have a go at setting this up, just need a bit more explanation!

Thanks for your help,
Steve.

Hi @SteveM1 , happy to help. There’s nothing in the metadata, not even sure why it’s there, probably copied from somewhere else. Yes, that’s the template entity I’d, which you can find in the list of helpers.

1 Like

Thanks @huffy72 - the metadata line doesn’t seem to make any difference - I now have a number of scripts writing to modbus which don’t use it. Thanks for the reply!

Hi all,

i am getting the GEN24 Plus with BYD Batteries too. Looks like i can use this with modbus to control discharge rate.

Any tips or suggestions for my install before it happens (related to ha integration) ?

thank you very much

Hello Klangen82,

Thank you VERY much for your examples! I copied them and after some tweaking they work on my installation as designed (Full Charge / Full Discharge / Stop Activities).

What I still do not understand, after many hours of trial and error and checking many different forums, is why those numbers (60933 and 4603)?. All I found out is that they add up to the the value of 65536 which is Hex FFFF+1.

The reason I am asking is twofold:

  • I want to optimize my consumption from the grid and
  • I have 2 different inverters connected to a separate EVU. Hence I need to control the charge/discharge seamlessly and based on values from my EVU.

Now I am trying to setup a node-red automation, feeding the GEN24 10 Plus with the required values to keep the grid consumption at +/- 0.

The Fronius register map talks about +/- 1000 for the OutWRte and InWRte, but your values are much different. Am I right assuming (float setting assumed) that one number always need to be 65535 - the other value? Ideally I would want to keep the StorCtl_Mod always at 3?

Do you know where I can find more details on the topic?

Many thanks
Heinz

Hi @ruffieuxh, I need to be honest and say I don’t remember…I have had this running for so long and I don’t touch it anymore. I think there is some thinking how to calculate these values in the thread above.

I think you can find the answer in the documentation also.

Sorry not to be able to help, I blame my bad memory…

Negative values are used to set a minimum charge/discharge rate, and negatives are set using 65536 - A, where A is the percentage of your battery size (WChaMax) you want to charge/discharge in an hour.
It’s because the 65536 number range is in two halves, the bottom end for positive numbers and the higher end represents negative numbers.

Note, you need to multiply your percentage by 100 because of the scale factor in InOutWRte_SF.

To set minimum charging rate at 100%, OutWRte = 65536-(100x100) = 55536.
To set minimum discharging rate at 100%, IntWRte = 65536-(100x100) = 55536.

Also note, you may not get 100% of battery charged or discharged in the hour if the inverter or battery cannot charge/discharge at that rate.

If the above seems the wrong way around, see full details in my post above 20 March.

1 Like

Hi. In new to HA and im trying do make an automation.

I cant code so im trying via HA automations. I have made a button and when that Button is pressed i want do charge or discharge my battery.

My plan is to put that button in to Homey but the automation in HA. So when the button is pressed in Homey i want to run the automation in HA.

But im stuck, i dont know what to put in the THEN.

I have managed to select performe action with inverter (three phase) but i dont know witch action to choose.

Sorry for my bad english.

Thanks from Sweden.

You can create scripts and trigger them in THEN. Go to Settings → Automations & scenes → Scripts → Add Script

I’ve added the following three scripts (note that I use the int + SF setting on the inverter):

alias: Disable Discharging
sequence:
  - service: modbus.write_register
    data:
      slave: 1
      address: 40348
      value: 2
      hub: fronius
  - service: modbus.write_register
    data:
      slave: 1
      address: 40355
      value: 0
      hub: fronius
mode: single
icon: mdi:battery-off
alias: Force Charging
sequence:
  - service: modbus.write_register
    data:
      slave: 1
      address: 40348
      value: 2
      hub: fronius
  - service: modbus.write_register
    data:
      slave: 1
      address: 40355
      value: 55536
      hub: fronius
  - service: modbus.write_register
    data:
      slave: 1
      address: 40350
      value: 9900
      hub: fronius
mode: single
icon: mdi:battery-charging
alias: Reset Charging
sequence:
  - service: modbus.write_register
    data:
      slave: 1
      address: 40348
      value: 0
      hub: fronius
  - service: modbus.write_register
    data:
      slave: 1
      address: 40355
      value: 10000
      hub: fronius
  - service: modbus.write_register
    data:
      slave: 1
      address: 40350
      value: 500
      hub: fronius
  - service: modbus.write_register
    data:
      slave: 1
      address: 40356
      value: 10000
      hub: fronius
mode: single
icon: mdi:home-battery
2 Likes

see Fronius Symo Gen 24 plus Batteries - #46 by Lorbus

Thanks.
Do you have the register for force discharge or set a minimum discharge rate?

For example i want to discharge x watt when the price is high.

Im using Homey to set the flows but i cant find the right register in fronius documentation

I don’t think it is doable with modbus. There are no entrys in the register table for minimum.
Yet you can do it manually with the web interface…

You can set a minimum forced charge/discharge rate by using negative value in the charge/discharge rate.

See here for details Fronius Symo Gen 24 plus Batteries - #37 by huffy72

Thanks, this input has helped me a lot!
The single scripts work flawlessly.
Just one thing I don’t understand:

In case I run the following sequence, I observe the following:

  1. run “Disable Discharging”, the discharging is prevented.
  2. run “Force Charging” afterwards, the charging starts at high power.
  3. re-run “Disable Discharging”, the power gets significantly reduced.

Why?
Doesn’t the script “Disable Discharging” just set the max output power to zero?
The designated charge state of 99% is unaffected, right?
I assume, it will be related to the set value 55536 in address 40355. From the Fronius Excel, I don’t see how to interpret the number. This number exceeds the value range stated in the Fronius document.

How to include this?
How to interpret the value of that address?

I intend to use those

  • not to discharge my battery when charging the car
  • to re-charge the battery in dark times when needed

I would like to have these scripts not affecting each other.
Thanks in advance!