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

Basically, if the daily solar production forecast is lower than my daily needs, I trigger the battery charging until I get enough juice to go through the day.
My dashboard is very limited as I only use it occasionally:

2 Likes

Guys,

it may be not related wot Modbus, but need some help from this Fronius topic.
I need to get my AC voltage reference soemwhere for the CT clamps to calculate real power. In the code I fixed 240 volts however, the voltage varies from 238 to 245.
So, I want to use the voltage sensor from my fronius inverter.
Can you please advise me how to reference that for my other (power) calculations?
Also, the inverter is shut down at night time, Is it still possible to take the reference or that inverter’s sensor also getting shut down?

Why do you need to calculate the real power ?
The Fronius inverter provides you with all the necessary information, be it with Modbus or its integration:Fronius
If your inverter goes down at night, all values will become unavailable or unknown. To avoid errors, use a template sensor with a default like this:
value_template: "{{ states('sensor.power_ac_fronius_inverter')|int(0) }}"

Probably because of batteries. See Howto: Fronius Integration with battery into Energy Dashboard

In my setup, the Gen24 manages the batteries and never goes down, unlike the additional Snap Inverter.
I did not have to use the AC Voltage to get my energy dashboard reporting production, storage and usage.

Thank you mate

What you use for the main grid power sensor?

Hi mate,
Can you please help me out on this. you can see all the attributes are as per the requirement.
Also, it shows the values. but not listed in the energy dashboard. I am trying this for last three days, not able to solve myself.

Thanks


If you’re talking about the consumption and production items, you need to use the total Energy sensor, as shown in my dashboard config:


where:

Grid consumption: sensor.energy_real_consumed_fronius_smart_meter
Return to grid: sensor.energy_real_produced_fronius_smart_meter

Solar production:
Energy total Gen24: sensor.energy_total_fronius_gen24
Energy total snap inverter: sensor.energy_total_fronius_snap_inverter

Here is for example how my snap inverter sensor looks like:

Hope this will help

Glad to find this topic! I was able to configure Modbus in confuguration.yaml and get data from my GEN24 and Smartmeter Modbus. I allready can see the data in developer section and use sensors in my own cards. But can please anybody tell me, how to use the data as entity option for energy dashboard? I’m new with Home Assistant but it seems available options for this page has to be configured somewhere else?

Second Question: Is there some dokumentation of modbus sensor adresses for GEN24? I’m searching for the total PV production value.

Do i have to do this in configuration like this?

 # Adding Sensor for "reading_energy_main_meter"      
   template:
 - sensor:
     - name: "Modbus Energy Main Meter"
       unit_of_measurement: "W"
       state: {{ states('sensor.reading_energy_main_meter') }}

Because in developer area of HA i’m allready getting correct values.
But I am not able to to set this in Energy Dashboard Grid Consumption. Because this entity is missing there inside option dropdown. Ho to add this there? Any suggestions?

i think you need the RiemanSum Integral
so you change Power in Energy (for Energy Dashboard)

in my case see here: (configuration.yaml)

######## Energy Dashboard Anfang (RiemanSum Integral)


  - platform: integration
    source: sensor.derived_energy_pv_output_total
    name: energy_sonne
    unit_prefix: k
    round: 2

  - platform: integration 
    source: sensor.derived_energy_from_grid
    name: energy_verbrauch_Haus
    unit_prefix: k
    round: 2

  - platform: integration 
    source: sensor.derived_energy_to_grid
    name: energy_return_grid
    unit_prefix: k
    round: 0

  - platform: integration 
    source: sensor.derived_energy_tobattery
    name: energy_battery_Ladung
    unit_prefix: k
    round: 2

  - platform: integration 
    source: sensor.derived_energy_frombattery
    name: energy_battery_Entladung
    unit_prefix: k
    round: 2
    
  - platform: integration 
    source: sensor.energy_real_ac_consumed_fronius_ohmpilot_0_http_10_0_0_245
    name: energy_Ohmpilot_total
    unit_prefix: k
    round: 2
  
  - platform: integration 
    source: sensor.pv_leistung_total
    name: energy_gesamt_sonne
    unit_prefix: k
    round: 2
  
    
######## Energy Dashboard Ende (RiemanSum Integral)

and this one in customize.yaml:

sensor.fronius_total_energy:
  state_class: measurement
  last_reset: '1970-01-01T00:00:00+00:00'
  device_class: energy
sensor.fronius_smartmeter_energy_ac_consumed:
  state_class: measurement
  last_reset: "homeassistant.util.dt.utc_from_timestamp(0)"
sensor.fronius_smartmeter_energy_ac_sold:
  state_class: measurement
  last_reset: "homeassistant.util.dt.utc_from_timestamp(0)"
sensor.derived_energy_pv_output_total:
  state_class: total_increasing 
  last_reset: '1970-01-01T00:00:00+00:00'
  device_class: energy
sensor.derived_energy_from_grid:
  state_class: total_increasing 
  last_reset: '1970-01-01T00:00:00+00:00'
  device_class: energy
sensor.derived_energy_to_grid:
  state_class: total_increasing 
  last_reset: '1970-01-01T00:00:00+00:00'
  device_class: energy
sensor.derived_energy_tobattery:
  state_class: total_increasing 
  last_reset: '1970-01-01T00:00:00+00:00'
  device_class: energy
sensor.derived_energy_frombattery:
  state_class: total_increasing 
  last_reset: '1970-01-01T00:00:00+00:00'
  device_class: energy
sensor.energy_gesamt_sonne:
  state_class: total_increasing 
  last_reset: '1970-01-01T00:00:00+00:00'
  device_class: energy

good luck!

for your total PV production value:

in my case (Fronius GEN24)…configuration.yaml:

- platform: rest 
    resource: http://10.0.0.245/solar_api/v1/GetPowerFlowRealtimeData.fcgi
    method: GET
    name: "Energie_total_api"
    value_template: "{{ ( value_json['Body']['Data']['Inverters']['1']['E_Total'] |float/ 1000000 )| round(2) }}"
    unit_of_measurement: 'MWh'
    scan_interval: 90
    force_update: true 

change the IP Adress for your Case

Hey guys,

My goal is to set the minimum soc on gen24 to ‚100‘ to ensure that the byd battery is not used during electric vehicle charging. After it is charged I want to set the minimum soc back to ‚5‘. This won’t work via json api but I guess it should work with modbus tcp. But to be honest: never did something with modbus and I am absolutely unsure if it should generally work and if so how.

Any help (or other idea) is heavily appreciated.

Best
Dirk

My solution is described here: Fronius Symo Gen 24 plus Batteries - #15 by dm82m

1 Like

Hello All,
just a quick heads-up: I installed this morning Core 2023.8.3 and it broke the Fronius Modbus integration for me. As I did not have time to analyze the issue I restored to 2023.8.2. A look into the change log of 2023.8.3 showed some chagnes to the modbus integration, that may effect this configuration here.

Just as a heads-up to at least create a backup when moving to 2023.8.3 in case you run into the some issue.

Best
Stephan

Should be fixed with 2023.8.4: `structure` illegal with `slave_count` / `slave` @ data['modbus'] · Issue #98643 · home-assistant/core · GitHub

2 Likes

Hi all,
I have been using Home Assistant for +7 years now, and got a Gen24 inverter half a year ago.
Everything is perfectly integrated, I can change everything from either NodeRED Modbus-Flex-Write nodes or Home Assistant modbus service calls and perfectly read out everything. One thing that continues to nag me, is whenever I set the “StorCtl_Mod” setting (40347, the one that enables or disable the use of the In/OutWRte settings - and address is tripple checked). Whenever I change the value to “3” to active both limits, it keeps the setting for a few seconds, and afterwards resets it to 0, so no limits is enabled.

It doesn’t matter if I have Battery Management enabled in Fronius administrative interface or have disabled / removed all the settings for time-dependent battery control. It is the only setting that gets overwritten, and kinda annoys me as I wan’t to control charge/discharge to perfection during the day, if theres cheap energy and no sun - but still wan’t to keep zero export with grid.

Anyone knowing what is going on and can help me out on this? :slight_smile:

I’ve found lots of “samples” that does work for other people, so seems to be a setting in the inverter that I’ve missed. First time I’ve ever given up

Best regards
Steffan

Sounds like “InOutWRte_RvrtTms” is not set to 0.

1 Like

Hi Stephan,

You were 100% correct on you assumption. Got total control on the battery charge/discharge now - thank you so much! Really appreciate your help. Never saw or found the connection and dependability anywhere else.

Best regards
Steffan

1 Like

Hi,
Thanks a lot, but how can i use the Derived Template Sensors?

Copying into the configuration.yaml does not work.

Thanks

Hi Stephan, Could you show your work. I am new in Node-Red. And want to control my Gen24. and BYD