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.
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.
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?
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:
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:
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:
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:
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!
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.
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!
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?
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.
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:
run “Disable Discharging”, the discharging is prevented.
run “Force Charging” afterwards, the charging starts at high power.
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!