Integration of a Fronius Symo Gen 24 plus Inverter via Modbus TCP

@heyyitsal It all works now as expected, and I have removed the Fronius app. Finally everything is local!

Also, I have now run my Node-RED for some weeks and are satisfied, a few more parameters are now set as well (only charge the home battery if my HVAC doesn’t need to work hard for example)

The whole scheme is to large to add here, but if someone’s interested, please ask.

1 Like

Hi, thank you for the great examples!

My setup:

  • GEN24 10.0 plus
  • Tesla M3 battery (with BYD emulator) and capable of charge/discharge 10kW.

When I test it with my Gen24, I need to use start address 40358. With 40348 it doe snot work. How can that be?

If I do the following:

msg.StorCtl_Mod = "2"
// 4500W (65536-1500)
msg.OutWRte = "64036"

msg.newstate = "forcecharge1500w"

return msg

My inverter starts to charge with 6,2kW. I can not figure out why that is happening. Do you have an idea?

This is how I do force discharge of 1500W

msg.StorCtl_Mod = "1"
// 65536 - 1500
msg.InWRte = "64036"

msg.newstate = "1500wdischarge"

return msg

And force 1500 charge:

msg.StorCtl_Mod = "2"
// 4500W (65536-1500)
msg.OutWRte = "64036"

msg.newstate = "forcecharge1500w"

return msg

I’m also on the Gen24 Plus 10 kw, so it should be the same. But it may be related to your battery…

Try with 6 kw:

msg.StorCtl_Mod = "1"
// 65536 - 6000
msg.InWRte = "59536"

msg.newstate = "6000wdischarge"

return msg

And force charge:

msg.StorCtl_Mod = "2"
// 65536 - 6000
msg.InWRte = "59536"

msg.newstate = "6000wcharge"

return msg

You’re using “Int + SF” instead of “floats” (or the reverse …) this is set in the inverter under Modbus settings and the addresses change depending on that. Might also be why your charge is set to 6.2kW since that address is close to others if you’ve selected the “wrong” typesetting for your Modbus. Might also be the defaults in the BYD emu that is messing with your charge settings.

6.22kW also matches the testbed for the emu and when I read about it on github i always felt they missed the point of one of the datapoints they got “6240W” reported from the battery, now this is just a theory but i do believe the Gen24 actually utilitizes this data for setting the charge and discharge speeds when communicating with the battery since I know when my HVS 5.1 drops below 5 degrees the charge and discharge gets derated from 4.6kW-ish to 1500W-ish or so before it starts to heat up to proper temperatures again.

Very intrested in your complete works. Also have you considered using the calender function to create a map of sorts over the next 24 hours from 13.30 forward to try and optimize on a per day basis? Usually I have a baseload of around 2-5kW in the household during winter. Alleviating the most expensive hours with batterypower from the cheapest hours thus needs around 6 - 15 kWh to transfer those to the previous night or during mid-day cheap prices.

Here you go: Pastebin.com - Locked Paste

Password: qfgk5CaEPU

2 Likes

I think I’ve figured out a slight improvment of sort. (Ab)using the I/O Power Managment Controll Priorities to reduce yours (and my) number of writes to nvram on the inverter. By setting up a Export limitation that says NO discharge combined with a previous discharge command already written to modbus previously. We’ve now reduced the "normal switch to just a single Enable / Disable Export limitations command over Modbus. This requires Export Limitation to take the top spot in the Controlling Priorities que however, but as long as it is disabled this won’t affect the modbus commands.

Can you please post an example?

Small update: Just added a few buttons in the HAOS UI so that I can reach them easily from my mobile phone, since Node-RED is a nightmare on small screens.

3 Likes

Hi there @enoch85, your setup looks great. I’m so new to HA (literally just installed on my Pi4 today) and have no idea where to start, it looks so complicated and involved. I don’t want to head down the wrong path from the start, so I’m wondering if you might be able to recommend an up to date workflow to setup a Gen24 with BYD battery.

Looking at the post at the top of this thread it talks about ‘modbus configuration and registers’, I have no idea which file in HA need these changes, I think some changes to configuration.yaml are required, but where does ‘derived template sensors’ go? Should Gen24 be float or int+SF?

There seems to be differing ways to integrate Fronius throughout the thread, like Modbus (which I’m familiar with), or Solar.API or SunSpec. Looks like some don’t allow you to control (write) to the inverter and so on. What is the preferred currently method?

Any help very much appreciated.

check here
https://www.libe.net/byd-modbus

1 Like

Thanks @mxcxpx :slightly_smiling_face:

I’m trying to setup controls for Amber energy (https://www.amber.com.au/) [wholesale prices], which means I need to control when and how much is imported or exported by the system and currently Amber doesn’t support Fronius inverters :frowning: so I have to do it myself. Or is there anyone doing this already?

What type of battery do you have?

Have a look at EMHASS.

This is what I set up but I have a sonnen battery and I don’t control anything through my Fronius inverter. I control the battery directly.
See here.


Control priorities, just disable export control to let modbus control the battery again.

Export Limits nothing to see here folks except the 0% export setting ofc.

Started typing this like 2 months ago :smiley: but almost instantly realised it wouldn’t work in my specific case since I need to have my export limit on at all times. However for the rest of you that isn’t dumb enough to have a solar system capable of blowing your main fuses on a daily basis … but I re-read this thread and user @heyyitsal has already figured this out for you but you seem to have missed the point on it somewhat :smiley: I’ll revisit this when I got this working properly in a week or three.

Hi @rcruikshank, thanks for the info. I have a BYD battery, which doesn’t appear to have any user accessible controls, its just a battery. Fronius does all the work, talking to it via Modbus RTU.

I did find an Amber Electric HA intergration, https://www.home-assistant.io/integrations/amberelectric/, should i install this too?

@friskens, my Fronius controlling priorities has 1: I/O, 2: Export & 3: Modbus, it looks like you can drag them to change the priorities and in your screen shot you have modbus in the middle, but you say ‘disable export control’, what do you mean by that?

All this slight stresses me out because we’re dealing with large amounts of stored energy, money and grid connected things. I fill if you make a mistake you could easily damage hardware or cost yourself money. :grimacing:

thanks

Yes this integration gives Home Assistant access to the amber API and sets up a number of sensors in HA that you can use to automate control over loads in your house.

I understand you’re new to HA so a bit of work to get used to this system.

In summary what I do is use that data from amber to control deferrable loads in the house. Things like pool pumps, hot water system, and charging your EV etc. To allow HA to control these things you need smart switches and OCPP EV charger (or Tesla car which can be controlled from HA with a HACS integration).

I also use the forecast data from amber and forecast PV data etc. to feed into EMHASS so it can come up with a plan to manage these loads and the charging/discharging of the battery. This can be represented with apex charts in HA like this:


The top one is the forecast supply and feed-in tariff from amber compared to the plan to charge and discharge the battery and turn on and off pool pump and car charger etc. Also the expected solar energy for tomorrow as predicted by solcast.com, expected energy consumption extrapolated from the last two days of household consumption and grid consumption forecast.

The bottom one is the battery SOC forecast which is what I’m currently using to charge and discharge the battery via the sonnen REST API. You would have to achieve the same control over your BYD battery via inverter MODBUS. I think there are plenty of people doing this but not sure.

If you read through my document you’ll see there’s a lot involved and most of what is there was figured out by people before me who are active in the EMHASS group. I only started looking into this in August last year.

EMHASS itself is a complicated tool that takes all these forecasts and uses different methods to come up with these plans. I pass the various forecast arrays to EMHASS every 60 seconds and it continuously recalculates the plan as the data changes to take advantage of the wholesale prices and the deferrable loads and battery capacity in my home.

If you go to the EMHASS group and ask if anybody has implemented in a Fronius+BYD environment there maybe somebody who has figured it out. There’s actually two groups, the latter being the main one I think:

  1. EMHASS add-on: An energy management optimization add-on for Home Assistant OS and supervised
  2. EMHASS: An Energy Management for Home Assistant

EMHASS itself can be fount here

Solar curtailment can be an important factor if you have a lot of PV so this forum here is where that is solved and that’s a different problem than what EMHASS solves.

I haven’t had to curtail PV yet so haven’t figured out how to do it via my Fronius inverter. I should read through this topic to figure it out.

Oh wow, that’s sounds like a fully configured house you have there, nice work. Thanks for all the info, I’ve started reading about EMHASS (I just installed it into HA)

On a different note, I am being presented with “No site provided” from Amber integration, people say its related to “an issue with your account (most likely a delay in processing)”.

Anyway, i wont hijack this thread with Amber integration. Thanks everyone.

When I import the NodeRed Flows, I have many missing NodeRed Palettes, especially related to the SolarAPI, can anyone tell me, which Palettes I need to install before importing the flows?

//EDIT
Okay it was only HomeAssistant, which was missing, cause I will not use HA, I try to make it as simple as possible with NR

Hi,

Thanks!

Yes, it was a bit of tinkering to get working, but now when it works as intended I haven’t touched it. So the one I posted here is basically still the same. :slight_smile:

1 Like