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!
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.
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
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:
- 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!
This is great work. Are you going to publish this somehow? I am exactly thinking of building the same.
- checking the expensives hours => keep battery to have sufficient battery during exepnsive hours.
- checking cheapest hours => save on battery
- checking expected PV-production => start charging the battery after 11:00 am to flatten the curve
… Is there a project dealing with theses questions from HA?
Many thanks. Best regards,
Clemens
I think this is what you can look into GitHub - davidusb-geek/emhass: emhass: Energy Management for Home Assistant, is a Python module designed to optimize your home energy interfacing with Home Assistant..
I have not tried it myself because we dont have a hourly tariff, but it looks promising.
Hi,
Thank you all for contribution to this valuable thread. From my side just a short summary of values that triggeres charge and discharge limits.
@Lorbus
Hello,
I’m new in HA, and don’t know why don’t the script run :
alias: TEST BYD
description: ""
triggers:
- trigger: state
entity_id:
- switch.chargin_byd
from: null
to: "on"
conditions: []
actions:
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
mode: single
icon: mdi:battery-off
mode: single```
The message is : ‘’’ Message malformed: extra keys not allowed @ data[‘actions’][0][‘mode’]
Any idea?
actions is from automations
sequence is from scripts
You cant use both in one.
Also you have multiple modes and icons so try to redo the script or automation but use the UI
Hi,
Well, I just published it here in the forum.
I have made improvements as well, so now I run one Chart in the summer, and one I’m the winter.
The summer Chart is more focused on using the solar energy, while the one in the winter focuses more on peaq shaving and flatten the curve.
Just FYI I’ve started to work on a custom Fronius Modbus integration that makes it much easier to manage the battery system and doesn’t require to setup scripts.
More about in this thread: