Fronius inverter integration

The “resource” is wrong. It should be like this (the documentation is confusing on this part):

resource: http://192.168.0.196

And the core integration does work…I tried it a few days ago just to see how it compares to the other integration by @safepay, which I am running 24/7 without major issues. And they have also changed the core integration so that it now publishes all readings as individual sensors and not as attributes.

1 Like

@nilrog Thanks for clearing that up. If that’s the case though then the documentation needs to be updated as it is definitely unclear the way it is now. Fronius - Home Assistant

resource

(string)(Required)

The IP address of the Fronius device

OR

sensor:
  - platform: fronius
    resource: FRONIUS_IP_ADDRESS

OR

sensor:
  - platform: fronius
    resource: FRONIUS_URL

Well I guess the core integration would work given the correct configuration information.

For the effort to switch to the core integration now I really can’t see the point atm.
If it ever breaks maybe I will.

@nilrog. Thanks for the advice on prefixing http:// It was about the only thing I didn’t try!
I have it working now - however all of the measurements are in Watts. Do you know how I can display results in kW and kWh? The following commands don’t pass the config test.

power_units: W
units: kWh

Also some of the results have 10+ decimal points. How do you round them off?

@Delbz The core fronius integration is not as customisable as @safepay custom component at the moment. You could modify the sensors using template sensors

OK - Cheers! I will swap back.

not meant to be as publicity, however I see some analogies between your GUI and what I have set up here: Photovoltaics (PV) + battery + hass = maximize auto-consumption

Maybe you find some configs that you’d like to integrate?

1 Like

I’ve been working on enhancing the GUI.
Here’s my current energy screen.
Does anyone know how I can display the ‘rel_Autonomy’ field from the fronius API?

4 Likes

This looks awesome, well done.

Would you mind sharing all your fronius related setup? Particularly the pvoutput config in the inverter. Thank you!

Hi, looks really nice, would you share that screen with me?
I am interested in the card for Grid Usage, don’t know how to do that and which kind of card you are using.

Thanks

Sure.
Here’s the PVOutput configuration.yaml section

sensor:
  - platform: pvoutput
    system_id: xxx
    api_key: xxx
    scan_interval: 150
  - 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' 

and the dual gauge card that uses sensor.energy_consumption from PVOutput.

inner:
  colors:
    - color: var(--label-badge-green)
      value: 30
    - color: var(--label-badge-yellow)
      value: 10
    - color: var(--label-badge-red)
      value: 0
  entity: sensor.fronius_day_energy
  label: Gen
max: 80
min: 0
outer:
  colors:
    - color: var(--label-badge-red)
      value: 40
    - color: var(--label-badge-yellow)
      value: 20
    - color: var(--label-badge-blue)
      value: 0
  entity: sensor.energy_consumption
  label: Used
title: Energy (kWh)
type: 'custom:dual-gauge-card'


Sure. It’s the mini-graph card.
plus the tod platform in configuration.yaml to get the day/night effect

binary_sensor:
  - platform: tod
    name: Night
    after: sunset
    before: sunrise

color_thresholds:
  - color: '#00ff00'
    value: 0
  - color: '#fff000'
    value: 1
  - color: '#FFA500'
    value: 3
  - color: '#ff0000'
    value: 5
  - color: '#000000'
    value: 7
entities:
  - entity: sensor.fronius_grid_usage
    name: Grid Power
  - aggregate_func: min
    color: gray
    entity: binary_sensor.night
    name: Night Time
    show fill: true
    show legend: false
    show_line: false
    show_points: false
    show_state: true
    smoothing: false
    y_axis: secondary
hours_to_show: 72
name: Grid Usage
points_per_hour: 1
show:
  extrema: true
  labels: false
  labels_secondary: false
  smoothing: false
state_map:
  - label: Day
    value: 'off'
  - label: Night
    value: 'on'
type: 'custom:mini-graph-card'


Hi Marcus, thanks for your quick response.
I have added the tod platform in configuration.yaml, so that part is ok, but for the manual card I have issues when I try to add it, I get just errors, I am quite new to home assistant, I guess I am doing something wrong. Tried to copy and past the color_tresholds: part to the manual card config but that doesn’t really work…
Maybe you can give me a hint.
thanks

You’ve probably already done it, but mini-graph-card is a custom component that needs to be installed:

Otherwise I am going to try this later today, I’ll see how I go too…

Awesome, thank you! Can you post the push service to pvoutput config on the inverter? I never could work that out properly.

yes I haev installed the mini-graph-card but had to restart the server, now it looks good. Do you know if I can set the timeinterval to update the figures so it will be shorter?

Sure.

And for house energy consumption (I think you need to be a paid donator to PVOutput for this to display)

Hi Delbz,

That’s a great view you have there.

I managed to setup the Energy and Grid Usage based on the codes you provided…

Are you able to provide the ‘Solar & Consumption’ and ‘Power’ cards as well?

Thank you in advance.

@Delbz, thanks for posting those inspirational views :slight_smile:
I started reworking my setup and used your views as base and so far ended up with this…still tweaking the setup.

Sure.

Solar and Consumption - Note I had to create a new sensor in configuration.yaml called ‘sensor.fronius_house_load_pos’ to display the ‘house load’ number as a positive - it’s negative by default.

sensor:
  - platform: template
      sensors:
        fronius_house_load_pos:
          value_template: "{{ (states('sensor.fronius_house_load') |float) | abs }}"
entities:
  - color: '#27ae60'
    entity: sensor.fronius_panel_status
    name: Solar Gen
  - color: '#e74c3c'
    entity: sensor.fronius_house_load_pos
    name: House Usage
    show_state: true
  - aggregate_func: min
    color: gray
    entity: binary_sensor.night
    name: Night Time
    show fill: true
    show legend: false
    show_line: false
    show_points: false
    show_state: true
    smoothing: false
    y_axis: secondary
hours_to_show: 72
name: Solar & Consumption
points_per_hour: 1
show:
  extrema: true
  labels: false
  labels_secondary: false
  smoothing: false
state_map:
  - label: Day
    value: 'off'
  - label: Night
    value: 'on'
type: 'custom:mini-graph-card'

and Power Card

inner:
  colors:
    - color: var(--label-badge-green)
      value: 4.5
    - color: var(--label-badge-yellow)
      value: 3
    - color: var(--label-badge-red)
      value: 0
  entity: sensor.fronius_panel_status
  label: Gen
max: 8
min: 0
outer:
  colors:
    - color: var(--label-badge-red)
      value: 5
    - color: var(--label-badge-yellow)
      value: 3
    - color: var(--label-badge-blue)
      value: 0
  entity: sensor.fronius_house_load_pos
  label: Using
title: Power (kW)
type: 'custom:dual-gauge-card'


Thanks mate. They all look great except for the sensor.energy_consumption which is constantly showing 0.0