Fronius inverter integration

Thanks; sorry about my English but it is not my best skill.

I’m pretty new to HA, sticky with zwave for years… damm vera :slight_smile:

I use the Fronius safepay config and every it’s working pretty fine. Today a problem with some card.

I have a Fronius + smartmeter on feed, connected via modbus to the inverter. I don’t have a Powerflow equipment but not working fine if not selected.

sensor:
  - platform: fronius_inverter
    ip_address: 192.168.1.200
    powerflow: true
    power_units: kW
    units: kWh
    smartmeter: true

Yesterday I open a PVOUTPUT account and it is working fine, inverter and meter there.

  - platform: pvoutput
    system_id: XXXXX
    api_key: YYYYYYYYYYYYY
    scan_interval: 150

1 .- Used energy kWh not working, I don’t know why. Maybe I can replace PVoutput with my utility_meter, it’s working fine in ENERGY DISTRIBUTION card.

utility_meter:
  # calculate daily energy consumed from grid (input must be in kWh)
  grid_consumed_energy_day:
    source: sensor.fronius_smartmeter_energy_ac_consumed
    cycle: daily
  # calculate daily energy sold to grid (input must be in kWh)
  grid_sold_energy_day:
    source: sensor.fronius_smartmeter_energy_ac_sold
    cycle: daily

2.- In POWER DISTRIBUTION I have KW and I prefer W. I can change in sensor platform: fronius_inverter but then dual gauges cards change too to W and I would like those in KW

3.- USE and SOLAR cards use KW in one are but Watts mixed with KW label in other. Since yesterday line graphs are not working as they should, stay flat.


for extra info I include my yaml

  - platform: template
    sensors:
      power_consumption:
        value_template: >
          {% set pc = state_attr('sensor.pvoutput', 'power_consumption') %}
          {{ '0' if pc == 'NaN' else pc }}
        friendly_name: 'Using'
        unit_of_measurement: 'Watt'

      energy_consumption:
        value_template: "{{ '{:.1f}'.format(state_attr('sensor.pvoutput', 'energy_consumption')|float/1000) }}"
        friendly_name: 'Used'
        unit_of_measurement: 'kWh'

      power_generation:
        value_template: >
          {% set pg = state_attr('sensor.pvoutput', 'power_generation') %}
          {{ '0' if pg == 'NaN' else pg }}
        friendly_name: 'Generating'
        unit_of_measurement: 'Watt'

      energy_generation:
        value_template: >
          {% set eg = state_attr('sensor.pvoutput', 'energy_generation') %}
          {{ '0' if eg == 'NaN' else '{:.2f}'.format(eg|float/1000) }}
        friendly_name: 'Generated'
        unit_of_measurement: 'kWh' 

      fronius_house_load_pos:
         value_template: "{{ (states('sensor.fronius_house_load') |float) | abs }}"


and all values I recover from smartmeter and inverter y an reply post (I am newbie)

THANS AGAIN¡¡¡¡

Captura de pantalla 2021-06-16 a las 15.39.48

I have two counters, grid_consumed and grid_sold working fine.

I think you might have missed something for the smartmeter configuration. Below is mine.

- platform: fronius_inverter
  ip_address: !secret fronius_host
  smartmeter: True
  smartmeter_device_id: 0
  powerflow: True
  power_units: 'W'
  units: 'kWh'

I try your code, only main change is power in Watts instead KW.

If I use Watts all is working fine :slight_smile: but now I should learn how to avoid decimals in both left cards.

Ok now i recall what was the problem. The default sensors are showing in Watts instead of kW. Therefore, if you want them to show up in kW you cannot use the default sensors. You will have to create another sensor and convert it to kW first.

it seems all it is working fine now. I change some rounds in sensor.py and in fronius.house_load_pos to avoid decimals

So, Watts are integers and Energy with 1 decimal.

Hi Marcus,

Did you resolve the problem with System option at scope position? When I put this option in configuration all Fronius entities become unavailable.

Hi Jurand,
I’m trying to remember what I did exactly. Below is my current working config.
The issue was with the physical Fronius inverter’s configuration - not HA.

I emailed Fronius support and they remotely changed something on the actual inverter’s data logger.

sensor:
  - platform: fronius_inverter
    ip_address: 192.168.0.xxx
    powerflow: True
    power_units: kW
    units: kWh    
    smartmeter: true
    smartmeter_device_id: 0

Thanks for your answer. I will check your configuration first, if it doesn’t work I contact Fronius.

Is there any major advantage of using fronius_inverter instead of the fronius platform?

I just installed an array of PV panels paired with a Fronius Primo inverter. I’m now in the process of configuring my Home Assistant to fetch the data of the power production.
I’m using the fronius platform and the names of the sensors that are automatically generated are a bit cumbersome, with the http_IP on it.
Is there a way to rename these sensors? I cannot do it on the GUI as these are read only entities, and the core.entity_registry file does not have these entities either.

I’m trying to setup the new Energy feature in HA 2021.8 but the Fronius daily energy sensor is not showing up in the dropdown menu. I have all the required attributes set as far as I can tell.

Any ideas what I need to do to get this working?

Do you use the builtin fronius integration? Have you updated to latest HA (2021.8.8 currently)?
You should be able to select the entity without any customization.
I’d use total / lifelong energy instead of daily. This avoids race conditions at midnight.

I assume you’re using the HACS integration not the official one. It could have to do with this. Basically the integration author needs to change some configurations behind the scenes:

The official fronius platform works just fine for me. I’ve no idea how to update the sensor names though, sorry.

Yep, I’m using the HACS one by Safepay which this thread is mostly related to. Hopefully he can sort it out, there is already an issue on the Git repo now that I look.

1 Like

Just a note on this. In the meantime I have created an integration entity in HA to calculate energy from the Fronius power data. Once adding the device_class etc attributes to it I can use this in the Energy panel. It’s only a work-around as this figure should be the same as the energy entity coming from the Fronius directly…

Would you be able to supply the code for the integration you have created as I am trying to incorporate my Fronius inverter into energy monitoring and honestly do not know where to start. Thanks.

sensor:
  - platform: integration      ###   Calculate energy from power
      source: sensor.fronius_ac_power  
      name: energy_fronius_produced_today
      unit_prefix: k
      round: 2

Thanks Dave for the syntax. Unfortunately entity created does not appear in the Energy dropdown selection. It shows though as an entity in Developer tools. Have restarted HA. Sorry to be a pain, but any suggestions?