Giter Club home page Giter Club logo

sensor.fronius's Introduction

hacs_badge fronius Maintenance

Fronius Sensor for Home Assistant

This component simplifies the integration of a Fronius inverter and optional PowerFlow/SmartMeter:

  • creates up to 22 individual sensors for easy display or use in automations
  • converts Wh to kWh
  • rounds values to 2 decimal places
  • converts yearly and total energy data to kWh or MWh (user-configurable)
  • optionally sums values if you have more than one inverter
  • supports the new Gen24 inverter (some sensors differs from Symo)

If you have a SmartMeter installed this component:

  • optionally connects to PowerFlow API for 5 additional sensors
  • optionally connects to SmartMeter API for 8 additional sensors
  • optionally converts PowerFlow units to W, kW or MW
  • compatible with the custom Power Wheel Card if using PowerFlow

Energy dashboard support - HA 2021.8+

All energy and power sensors provide required attributes to allow long term statistics to be recorded which enables support for the new Energy dashboard introduced in HA 2021.8.

BREAKING CHANGE - HA 2021.9.x

Unfortunately HA 2021.9 breaks energy sensors in earlier releases of this component. To upgrade to HA 2021.9.x, ensure you update to this release immediately afterwards.

2021.8.x can be made compatible by using customize.yaml to override the required entities as follows. These entries are not required if running 2021.9.x or later.

If it doesn't already exist, add the following into configuration.yaml:

homeassistant:
  customize: !include customize.yaml

If it doesn't already exist, create a "customize.yaml" file in the same directory as configuration.yaml and add the following:

sensor.fronius_total_energy:
  state_class: measurement
  last_reset: 1970-01-01T00:00:00+00:00
sensor.fronius_smartmeter_energy_ac_consumed:
  state_class: measurement
  last_reset: 1970-01-01T00:00:00+00:00
sensor.fronius_smartmeter_energy_ac_sold:
  state_class: measurement
  last_reset: 1970-01-01T00:00:00+00:00

Where "fronius" in the sensor name needs to match the name of the integration. Once upgraded to HA 2021.9.x the above entries may be safely removed.

Configuring the Energy dashboard:

The following "lifetime" sensors can be added to the energy configuration:

  • Solar production: total_energy
  • Grid consumption: smartmeter_energy_ac_consumed (smartmeter required)
  • Grid feed-in: smartmeter_energy_ac_sold (smartmeter required)

NOTE: The Energy dashboard expects units to be expressed in kWh otherwise they will not be available to add to the configuration. To resolve this, you must include the following in the Fronius component configuration.yaml entry to ensure units are converted appropriately:

units: kWh

URL's Utilised

The Default URL called is http://ip_address/GetInverterRealtimeData.cgi?Scope=Device&DeviceId=1&DataCollection=CommonInverterData

The optional PowerFlow URL is http://ip_address/solar_api/v1/GetPowerFlowRealtimeData.fcgi

The optional SmartMeter URL is http://ip_address/solar_api/v1/GetMeterRealtimeData.cgi?Scope=Device&DeviceId=1

Installation

Copy the fronius_inverter folder in the custom_components directory into your own custom_components directory in your config directory of Home Assistant.

E.g.:

../config/custom_components/fronius_inverter/__init__.py
../config/custom_components/fronius_inverter/manifest.json
../config/custom_components/fronius_inverter/sensor.py

Be sure to pull raw data from GitHub or use HACS

Configuration

# Minimal configuration.yaml entry:
sensor:
  - platform: fronius_inverter
    ip_address: LOCAL_IP_FOR_FRONIUS
# Example configuration.yaml entry where you can specify the sensors you want:
sensor:
  - platform: fronius_inverter
    ip_address: LOCAL_IP_FOR_FRONIUS
    monitored_conditions:
      - ac_power
      - day_energy
      - year_energy
      - total_energy
# Example configuration.yaml entry where you have more than one inverter:
sensor:
  - platform: fronius_inverter
    ip_address: LOCAL_IP_FOR_FRONIUS
    scope: System
# Example configuration.yaml entry where you have a SmartMeter device and add PowerFlow sensors:
sensor:
  - platform: fronius_inverter
    ip_address: LOCAL_IP_FOR_FRONIUS
    powerflow: True
    power_units: kW
# Example configuration.yaml entry where you have a SmartMeter device and add SmartMeter sensors:
sensor:
  - platform: fronius_inverter
    ip_address: LOCAL_IP_FOR_FRONIUS
    smartmeter: True

Configuration Variables

variable required type default description
ip_address yes string The local IP address of your Fronius Inverter.
name no string Fronius The preferred name of your Fronius Inverter.
model no string symo Type of inverter from gen24, symo
always_log no boolean True Set to False if your Fronius Inverter shuts down when the sun goes down.
scan_interval no string 60 The interval to query the Fronius Inverter for data.
powerflow no boolean False Set to True if you have a PowerFlow meter (SmartMeter) to add grid_usage, house_load, panel_status, rel_autonomy and rel_selfconsumption sensors.
smartmeter no boolean False Set to True if you have a SmartMeter to add smartmeter_current_ac_phase_one, smartmeter_current_ac_phase_two, smartmeter_current_ac_phase_three, smartmeter_voltage_ac_phase_one, smartmeter_voltage_ac_phase_two, smartmeter_voltage_ac_phase_three, smartmeter_energy_ac_consumed and smartmeter_energy_ac_sold sensors.
smartmeter_device_id no string 0 The Device ID of your Fronius SmartMeter.
units no string MWh The preferred units for Year and Total Energy from Wh, kWh, MWh.
power_units no string W The preferred PowerFlow units from W, kW, MW.
device_id no string 1 The Device ID of your Fronius Inverter.
scope no string Device Set to System if you have multiple inverters. This will return ac_power, day_energy, year_energy and, total_energy only. Case-sensitive.
monitored_conditions no list All List of monitored conditions from: ac_power, ac_current, ac_voltage, ac_frequency, dc_current, dc_voltage, day_energy, year_energy, total_energy, grid_usage, house_load, panel_status, rel_autonomy, rel_selfconsumption, smartmeter_current_ac_phase_one, smartmeter_current_ac_phase_two, smartmeter_current_ac_phase_three, smartmeter_voltage_ac_phase_one, smartmeter_voltage_ac_phase_two, smartmeter_voltage_ac_phase_three, smartmeter_energy_ac_consumed, smartmeter_energy_ac_sold

Custom Power Wheel Card (if using a Powerflow)

Follow the instructions for installation on Github

Add the following to the Lovelace resource config in the Raw Config Editor:

resources:
  - type: module
    url: /local/custom_ui/power-wheel-card.js?v=1

Then add and configure a basic custom card for displaying the power view:

type: 'custom:power-wheel-card'
title: Solar Power
production_is_positive: false
solar_power_entity: sensor.fronius_panel_status
grid_power_entity: sensor.fronius_grid_usage

If you also want to have an energy view in the Power Wheel you need three more sensors. And these sensors will be different depending on if your smart meter is installed in the feed-in-path or consumption-path.

This is the configuration you need to add to your Power Wheel config in Lovelace. This will be the same regardless of where your smart meter is installed.

solar_energy_entity: sensor.fronius_day_energy
grid_energy_consumption_entity: sensor.grid_consumed_energy_day
grid_energy_production_entity: sensor.grid_sold_energy_day

Next you need to create two new sensors for grid energy consumption and production. And this is what will differ depending on your smart meter installation.

  1. Feed-in path. This is the simplest setup. With the smart meter in the feed-in path (next to your main electricity meter) it already knows what you are consuming and producing. But it counts the accumulative values. And we need daily vaules, in kWh, to match the sensor.fronius_day_energy.

Create the two sensors for daily consumption and production. Note: if smart meter energy sensors are not in kWh you need to convert those two to kWh using template sensors.

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
  1. Consumption path. With the smart meter in the consumption path (between the inverter and your consumers) it cannot know how much you are consuming or producing from/to the grid. So the only sensor that will have a value is the sensor.fronius_smartmeter_energy_ac_consumed. But it will not show what is consumed from the grid. It will show how much your house has consumed. So we need to create sensors that will give us what the Power Wheel needs.
utility_meter:
  # convert consumed energy to daily energy (this is what the house consumes)
  house_energy_day:
    source: sensor.fronius_smartmeter_energy_ac_consumed
    cycle: daily
sensor:
  - platform: template
    sensors:
      # calculate grid energy (negative will be to grid, positive from grid)
      grid_energy_day:
        friendly_name: 'Grid energy'
        unit_of_measurement: 'kWh'
        value_template: '{{ (states("sensor.fronius_day_energy") | float - states("sensor.house_energy_day") | float) * -1 }}'
      # calculate energy consumed from grid
      grid_consumed_energy_day:
        unit_of_measurement: 'kWh'
        value_template: >
          {% if states("sensor.grid_energy_day") | float > 0 -%}
            {{ states("sensor.grid_energy_day") | float }}
          {%- else -%}
            {{ 0 | float }}
          {%- endif %}
      # calculate energy produced to grid
      grid_sold_energy_day:
        unit_of_measurement: 'kWh'
        value_template: >
          {% if states("sensor.grid_energy_day") | float < 0 -%}
            {{ states("sensor.grid_energy_day") | float * -1 }}
          {%- else -%}
            {{ 0 | float }}
          {%- endif %}

sensor.fronius's People

Contributors

cathelest avatar colwilliamsnz avatar d3wy avatar nilrog avatar rtornstrom avatar safepay avatar v-rejected avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

sensor.fronius's Issues

Error after update to Ha .109.0

Error
Detected I/O inside the event loop. This is causing stability issues. Please report issue to the custom component author for fronius_inverter doing I/O at custom_components/fronius_inverter/sensor.py, line 325: result = requests.get(self._build_url(), timeout=10).json()

scan_interval in sensor.yaml not working

If I change the scan_interval in HA sensor.yaml config to 10 seconds it wont work.

if i go to the sensor.py in custom_components\fronius_inverter and change to the following:
MIN_TIME_BETWEEN_UPDATES = timedelta(seconds=10)

It works and changes the interval to 10 seconds.

It does end up eventually changing back however to 60 seconds, i think on next restart.

Not receiving data

I tried to add this integration, but I get no data. It works fine with the native integration.

- platform: fronius_inverter
  ip_address: 192.168.1.176
  name: fronius

- platform: fronius
  resource: http://192.168.1.176
  monitored_conditions:
  - sensor_type: inverter

The log tells me:

Failed to update: invalid response received

Update for sensor.fronius_ac_power fails after sunset

Hi,

Thanks for your great add on. It was working flawlessly so far. With the recent to 0.8.7, i could see many error messages in the logs when the inverter goes offline after sunset.

Following error message fills up the log every minute until the Inverter is back up in the morning

UnboundLocalError: local variable 'state' referenced before assignment
2019-11-23 04:50:09 ERROR (MainThread) [homeassistant.helpers.entity] Update for sensor.fronius_ac_power fails
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 270, in async_update_ha_state
await self.async_device_update()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 448, in async_device_update
await self.async_update()
File "/config/custom_components/fronius_inverter/sensor.py", line 207, in async_update
self._state = round(state, 2)

Take some rest between poll elements

From time to time I get null values for various parameters. I suspect this must be because during each poll the inverter is stressed three times: inverter_data, powerflow_data and smartmeter_data are pulled immediately after each other, which may cause the small webserver embedded in the unit to lock up for a while.

kép
This is the graph of Fronius DC Current, for example. The gaps don't appear when using Home Assistant native fronius integration (which is disabled now).

I suggest to add a 5-second sleep between the consecutive data pulls somewhere around lines 107 and 115.

I'd do it but I've zero experience with proper python programming.

Using a Fronius Symo 3.7-3-M and a Smart Meter 63A.

Getting unnecessary errors while the inverter is offline by nights

While the inverter is automatically offline (by nights and by long sunless days of nordic winter when the inverter can't produce enough power to turn on) sensor can't connect. That is just a fact, not an error. Allowing to pause polling while sun is under horizon could be useful. But I don't know how we could recognise those almost sunless days. That would be useful too. But trusting "could data" might be an issue.

fronius gen24 & fronius symo always 0

Hello, I'm currently trying to integrate and display at least one Fronius.

I don't get any error messages in the log, but the display is 0 no matter where
i have a fronius gen24 with 2 smart meters + 1x fronius symo in the same building.
later I wanted to add a second symo with a smart meter that is external.
But I can't even get one to run

I have now installed release 0.9.6
my config looks like this

sensor:
#  - platform: fronius_inverter
#    ip_address: http://192.168.4.96
  - platform: fronius_inverter
    name: Gen24Home
    ip_address: http://192.168.10.96
    powerflow: True
    power_units: kW
    smartmeter: True
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
  energy_solar_production_daily:
   name: "PV Generation (Daily)"
   source: sensor.energy_solar_production
   cycle: daily
  energy_grid_consumption_daily:
   name: "Grid Consumption (Daily)"
   source: sensor.energy_grid_consumption
   cycle: daily
  energy_grid_feedin_daily:
   name: "Grid Export (Daily)"
   source: sensor.energy_grid_feedin
   cycle: daily

 ## Not used in Energy Dashboard
  energy_house_consumption_daily:
   name: "Total Consumption (Daily)"
   source: sensor.energy_total_consumption
   cycle: daily
sensor:
- platform: template
  sensors:
    power_total_consumption:
      friendly_name: Total Consumption
      unit_of_measurement: "W"
      value_template: '{{ (states("sensor.fronius_house_load") | float * -1) | round | int }}'
- platform: template
  sensors:
    power_grid_consumption:
      friendly_name: Grid Consumption
      unit_of_measurement: "W"
      value_template: >-
        {% if states('sensor.fronius_grid_usage') | float > 0 %}
          {{ states('sensor.fronius_grid_usage') | round | int }}
        {% else %}
          0
        {% endif %}
- platform: integration
  source: sensor.power_total_consumption
  name: energy_total_consumption
  unit_prefix: k
  unit_time: h
  round: 2
  method: left
- platform: integration
  source: sensor.fronius_panel_status
  name: energy_solar_production
  unit_prefix: k
  unit_time: h
  round: 2
  method: left
- platform: integration
  source: sensor.power_grid_consumption
  name: energy_grid_consumption
  unit_prefix: k
  unit_time: h
  round: 2
  method: left
- platform: integration
  source: sensor.power_grid_feedin
  name: energy_grid_feedin
  unit_prefix: k
  unit_time: h
  round: 2
  method: left
- platform: template
  sensors:
    power_grid_feedin:
      friendly_name: Grid Feed-in
      unit_of_measurement: "W"
      value_template: >-
        {% if states('sensor.fronius_grid_usage') | float < 0 %}
          {{ (states('sensor.fronius_grid_usage') | float * -1) | round | int }}
        {% else %}
          0
        {% endif %}
- platform: template
  sensors:
     energy_consumption_cost_aud:
      icon_template: mdi:currency-usd
      value_template: >
        {{(states('input_number.grid_consumption_energy_cost')|float / 100)|round(4, 'ceil')}}
      unit_of_measurement: 'EUR/kWh'
     energy_generation_cost_aud:
      icon_template: mdi:currency-usd
      value_template: >
        {{(states('input_number.grid_generation_energy_cost')|float / 100)|round(4, 'ceil')}}
      unit_of_measurement: 'EUR/kWh'

input_number:
 # Grid Consumption Energy Cost (EUR/kWh)
   grid_consumption_energy_cost:
     name: 'Grid Consumption Energy Cost'
     mode: box
     min: 0
     max: 1000
     step: 0.001
     unit_of_measurement: "EUR (cents)/kWh"
     icon: mdi:currency-usd
 # Grid Generation Energy Cost (EUR/kWh)
   grid_generation_energy_cost:
     name: 'Grid Generation Energy Cost'
     mode: box
     min: 0
     max: 1000
     step: 0.001
     unit_of_measurement: "EUR (cents)/kWh"
     icon: mdi:currency-usd

fronius error

Logger: homeassistant.loader
Source: loader.py:786
First occurred: 9:40:27 AM (2 occurrences)
Last logged: 9:40:28 AM

No 'version' key in the manifest file for custom integration 'fronius_inverter'. As of Home Assistant 2021.6, this integration will no longer be loaded. Please report this to the maintainer of 'fronius_inverter'
No 'version' key in the manifest file for custom integration 'midea_ac'. As of Home Assistant 2021.6, this integration will no longer be loaded. Please report this to the maintainer of 'midea_ac'

Added pause of polling from sunset to sunrise

Hello Safepay, Thanks again for working on this,

As per your comments, my powerflow seems to stop working during sundown,

Im sure making the times as you have it the "default" is probably best for most users which only have the inverter and not the smart meter,

But, I have the smart meter, and would love to see stats during the night please,

Can you add an option to disable the timer,

On a side note, the configurator checker kept throwing errors anytime i tried to use the end_time config line,

Invalid config for [sensor.fronius_inverter]: [end_time] is an invalid option for [sensor.fronius_inverter]. Check: sensor.fronius_inverter->end_time. (See ?, line ?). Please check the docs at https://home-assistant.io/components/sensor.fronius_inverter/

Errors filling up the log file after upgrade to .109

Hi,

Since my upgrade to.109, i could see this error filling up my log files. Everything else is working fine though.

2020-05-08 09:33:14 WARNING (MainThread) [homeassistant.util.async_] Detected I/O inside the event loop. This is causing stability issues. Please report issue to the custom component author for fronius_inverter doing I/O at custom_components/fronius_inverter/sensor.py, line 325: result = requests.get(self.build_url(), timeout=10).json()
2020-05-08 09:33:15 WARNING (MainThread) [homeassistant.util.async
] Detected I/O inside the event loop. This is causing stability issues. Please report issue to the custom component author for fronius_inverter doing I/O at custom_components/fronius_inverter/sensor.py, line 356: result = requests.get(self._build_url(), timeout=10).json()

Current Version : 0.9.2

Any help is greatly appreciated

Sugerencia

Thank you very much for the development but the truth is that it was not easy for me to configure the application.
My inverter is a Fronius Primo 5:

I would recommend putting a configuration example with the following with smartmeter, since the units come in MWh:

sensor

  • platform: fronius_inverter
    ip_address: ([IP_Fronius_smartmeter]
    smartmeter: True
    powerflow: True
    power_units: kW
    units: kWh

In "utility meters" the solar production sensor is missing, also the application did not recognize nee sensors if I did not modify them as "device_class": energy and its "units" in kWh, (attention: Kwh is not worth it for de W without capital letters). I had to modify the sensors manually in developer tools

utility_meter

#Energy (safepay)
#Calculate dayly energy consumed from grid
grid_consumed_energy_day:
source: sensor.fronius_smartmeter_energy_ac_consumed
cycle: daily

#calculate daily energy sold to grid
grid_sold_energy_day:
source: sensor.fronius_smartmeter_energy_ac_sold
cycle: daily

#calculate daily energy produced from solar panels
solar_produced_energy_day:
source: sensor.fronius_total_energy
cycle: daily

powerflow and smartmeter clarification

What's the difference between SmartMeter and PowerFlow?

I have a Fronius Symo 3.7-3-M with a datamanager card and a Smart Meter 63A. Reading through the documentation there's a noteSet to True if you have a PowerFlow meter (SmartMeter) - thus I've enabled both powerflow and smartmeter parameters. If I disable one of them, some data will be missing. In my understanding based on the above, if I have a Smart Meter, i also have a PowerFlow, right?

Why are these separate?

missing import asyncio in sensor.py

I think sensor.py is missing import asyncio
Got Timeout Error and find the error in log file that asyncio.TimeoutError cannot be resolved.

Fixed it by importing asyncio module

Scanning Interval below 300s

Love your work!
But you've set a hard minium scan_interval in your code
MIN_TIME_BETWEEN_UPDATES = timedelta(seconds=300)

not sure if this was on purpose but users trying to set scan_interval manually below this level are unable

Adding support for 2020.8 Energy dashboard?

Has any one got time to add support for the new energy dashboard?
I think all that's needed is to add support for the new statistics framework by adding to each sensor sensor a state_class that is set to measurement.

Not An Issue!

Hello Richard,

Many thanks for all your work on the plugin, its great, and thanks for allowing the flowmeter to monitor after sunset, works great now, iv sent you some beer money, have 1 or 2 on me, enjoy!!

Do you have any plans to make a custom card view (like the fronius app) or do you know if theres a way to use the power wheel card https://community.home-assistant.io/t/lovelace-power-wheel-card/82374

Iv tried to use it before but could never work it out properly,

All im missing now is the view!!

Many thanks again for all your hard work, sorry to open an issue but dont know how to contact you otherwise??

Ben (Cathelest)

Total and year energy issue

First of all thanks for sharing this! I have some issues with the total and yearly sensor. The first image is the integration installed via HACS. The second my old one where I use the API directly. I have tried to change the units but it does not report correct.

My total production is 10.39 MWh when I look in Solar webb.

f1
f2

This how the api call looks like.

f3

Error: "Detected I/O inside the event loop."

After recent upgrade of Home Assistant Core to 0.109.6 from 0.109.4 I have notices processor use increase from typical 1% to appr. 4% and the following logs

Source: util/async_.py:120
First occurred: May 14, 2020, 4:23:32 PM (1846 occurrences)
Last logged: 8:16:30 AM

    Detected I/O inside the event loop. This is causing stability issues. Please report issue to the custom component author for fronius_inverter doing I/O at custom_components/fronius_inverter/sensor.py, line 325: result = requests.get(self._build_url(), timeout=10).json()
    Detected I/O inside the event loop. This is causing stability issues. Please report issue to the custom component author for fronius_inverter doing I/O at custom_components/fronius_inverter/sensor.py, line 356: result = requests.get(self._build_url(), timeout=10).json()

On the full log this error is reported 1-2 time every minute.
What can I do to fix it ?

Other Sensors

Sorry not sure if right place to post,

Love the new add on many thanks, much cleaner and better implementation then what i am using,

I use 3 other sensors which are not in the addon on i think?
Although i also have the fronius smart meter, so not sure if these are available to others without it?

These are

P_Grid which will give me a negative value if sending power to grid, or positive value if drawing from grid.

P_Load - Must be a smart meter one i guess?
P_PV - Shows amount of energy being produce by panels? None of the plugin ones seem to match that one so not sure if i am missing it?

Thanks
Ben

This is the below i have been using, I had a sensor 1, which was day total i have removed as was in the plugin,

#FRONIUS GRID USAGE NEGATIVE VALUE IS SENDING POWER BACK POSITIVE IS DRAWING FROM GRID
sensor 2:
platform: rest
resource: http://IPOFINVERTER/solar_api/v1/GetPowerFlowRealtimeData.fcgi
name: Fronius Grid Usage
value_template: '{{ (value_json.Body.Data.Site.P_Grid ) | round(3) }}'
unit_of_measurement: W
#FRONIUS LOAD
sensor 3:
platform: rest
resource: http://IPOFINVERTER/solar_api/v1/GetPowerFlowRealtimeData.fcgi
name: Fronius House Load
value_template: '{{ (value_json.Body.Data.Site.P_Load ) | round(3) | replace("-","") }}'
unit_of_measurement: W

#FRONIUS PANEL GENERATION CURRENTLY
sensor 4:
platform: rest
resource: http://IPOFINVERTER/solar_api/v1/GetPowerFlowRealtimeData.fcgi
name: Fronius Panel Status
value_template: '{{ (value_json.Body.Data.Site.P_PV ) | round(3) | replace("-","") }}'
unit_of_measurement: W

Energy Cost Sensor - last_reset deprecation (2021.9.4→2021.9.5)

Yet another change in home assistant (pertaining to energy dashboard), energy sensor cost has been updated with:
STATE_CLASS_MEASUREMENT resulting in a warning:

Entity sensor.fronius_smartmeter_energy_ac_sold_compensation (<class 'homeassistant.components.energy.sensor.EnergyCostSensor'>) with state_class measurement has set last_reset. Setting last_reset is deprecated and will be unsupported from Home Assistant Core 2021.11. Please update your configuration if state_class is manually configured, otherwise create a bug report at https://github.com/home-assistant/core/issues?q=is%3Aopen+is%3Aissue+label%3A%22integration%3A+energy%22

See here for details: home-assistant/core#55962

0.8.7 Sensors Missing

Using the same config on both 0.8.3 and 0.8.7
some of the sensors arnt being created,

Im missing
sensor.fronius_ac_current
sensor.fronius_ac_frequency
sensor.fronius_ac_power
sensor.fronius_ac_voltage
sensor.fronius_panel_status

Config im using, (i havent changed anything between the 2 versions, was i meant to?)

Sorry to bother you with this again,
Thanks for your help,

Ben,

P.S in the home assistant HACS addon, the dropdown with the versions, all other versions have a
v in front, eg v0.8.3, except 0.8.7, causing it to show at bottom of dropdown, not an issue but thought ill let you know,

Sensors

sensor:

  • platform: fronius_inverter
    ip_address: 192.168.1.75
    device_id: 1
    scan_interval: 20
    powerflow: True

Confused by utility_meter sensors for Power Wheel Card when using Powerflow

In the section Custom Power Wheel Card (if using a Powerflow) it describes creating a utility_meter sensor to provide the necessary information for energy monitoring, however, if using PowerFlow rather than smartmeter you have neither sensor.fronius_smartmeter_energy_ac_consumed nor sensor.fronius_smartmeter_energy_ac_sold.
Do I need to enable both powerflow and smartmeter?
Next issue is that those inputs are in MWh and I think I need them in kWh? Do I need to create a template sensor to convert it into the correct unit?

Sorry if this covered somewhere but I couldn't find it.

Help: power-wheel-card Energy view?

Using the default config sample presented on the first page I don't get the Energy view:

title: Solar Power
production_is_positive: false
solar_power_entity: sensor.fronius_panel_status
grid_power_entity: sensor.fronius_grid_usage
home_energy_entity: sensor.fronius_house_load

Although in power-wheel-card documentation it states that specifying home_energy_entity should be enough to see the Energy view.

Any idea on how to configure power-wheel-card with this integration in order to see the Energy view too?

AC Power can’t be 0 At night since last update

The last update was working fine, no drop outs, until the evening. The panels are not producing anything but AC power can’t go down to 0. So the whole power wheel and other things shows wrong data.
Otherwise, great work!!
37255639-FD1F-4A57-AC0F-E154AC066E5A

Adding MPPT1 and MPPT2 string volatge, watts, Temp - API call included

Hi thanks for a great sensor in Home Assistant. Its working well for me, could you add this feature if possible?

Here is the code below for the API call.

// API URL - Fronius
$inverterDataURL = "http://".$dataManagerIP."/solar_api/v1/GetArchiveData.cgi?Scope=System&StartDate=".$date."&EndDate=".$date."&Channel=Voltage_DC_String_1&Channel=Current_DC_String_1&Channel=Voltage_DC_String_2&Channel=Current_DC_String_2&Channel=Temperature_Powerstage";

More info here, sorry im not a programmer so limited on explaining.

https://github.com/grann0s/_pushPVStringData.php/blob/master/_pushPVStringData.php

Bob

Problems losing entities

I've been having problems with the integration losing the entities ... in that they become unavailable.

I can fix the problem removing the entities, removing the integration from the config, rebooting, re-inserting the config back again and the rebooting again ... a painful process. Occasionally that doesn't work and I need to rename the integration so it creates brand new entities, losing all my history. I'm not sure if there's a better way, but it's the only way I know how to fix it.

It seems to happen on a complete reboot of the server or when patching Home Assistant. It occasionally happens on a soft reboot. It never used to be unstable, but I think it may be an issue with later patches breaking it.

Fronius Battery Support in Energy Manager

Thanks for your great work! I have integrated my Fronius and have no issues, just one thing I would like to know. Since the latest HA update 2021.9 they also offer to read data from Solar Battery. Do you think you could provide integration for the Fronius Solar Battery as well? That would be really great to read data stored in the battery and consumed from the battery.
image

Thanks

Please add version key to the manifest file. Else, as of june 2021 the component will not load anymore

Hello,
Please add the version key to the manifest file, cause as of homeassistant version 2021.6 (June 2021), the version key is required to load a component. I have seen you have responded to another request that in v0.9.3 the version has been added. I have installed v0.9.3 but I still get the following message.

Thanks a lot in advance
Regards

Logger: homeassistant.loader
Source: loader.py:786
First occurred: 12:07:22 (1 occurrences)
Last logged: 12:07:22

No 'version' key in the manifest file for custom integration 'fronius_inverter'. As of Home Assistant 2021.6, this integration will no longer be loaded. Please report this to the maintainer of 'fronius_inverter'

Platform error: sensor - Integration 'fronius_inverter' not found.

I am running version Home Assistant 0.102.2, on a Synology Docker, and I keep getting this error, when trying to install this components.

Platform error: sensor - Integration 'fronius_inverter' not found.

  1. december 2019 14.25 config.py (ERROR)

I even tried it on a Ubuntu 18.4, and get the same error.

I have followed the Read.me, and everything seems to be set up correctly.

What am I doing wrong?

Regards,
Per

Support for older Fronius dataloggers

The current sensor.fronius add-on is based on v1 of the Fronius Solar API. I have an older Fronius Datalogger Web that uses v0 of the Fronius Solar API. I was able to make the add-on work with my equipment by changing the URL on line 21 of sensor.py to read:

_INVERTERRT = 'http://{}/solar_api/GetInverterRealtimeData.cgi?Scope={}&DeviceIndex={}&DataCollection=CommonInverterData'

... and line 338 to read:

json_response = await response.json(content_type=None)

That's it. No changes are needed for the PowerFlow or Meter URLs, since neither were supported in v0 of the Solar API, as far as I can tell. I think that the changes to line 338 should work with either API. The reason for the change that I made to line 338 is that v0 of the Solar API returns a valid json response, but incorrectly tags it with a mime type of javascript. Disabling content checking in the json() call fixes the issue.

If we could have a config option to let the end user pick a version of the Solar API (with v1 as a default), then line 21 could select the correct URL format for that version of the API. Alternatively, a call to http://{}/solar_api/GetAPIVersion.cgi will return "1" for v1 of the API and HTTP error 404 for v0 of the API, allowing you to test which version of the API is used by your Fronius device, then use that information to automatically pick the correct URL format.

Copies of the Fronius Solar API documentation are available here:
v0 -- https://www.fronius.com/~/downloads/Solar%20Energy/Operating%20Instructions/42%2C0410%2C2011.pdf
v1 -- https://www.fronius.com/~/downloads/Solar%20Energy/Operating%20Instructions/42%2C0410%2C2012.pdf

version field not updated in the manifest.json file

manifest.json file is not updated to the newest version (0.9.5) accordingly

{ "domain": "fronius_inverter", "name": "Fronius", "documentation": "https://github.com/safepay/sensor.fronius/blob/master/README.md", "dependencies": [], "codeowners": ["@safepay"], "requirements": [], "version": "v0.9.3" }

Few issues with 0.9.7

I just installed 0.9.7,

Just a few questions.

It seems for
Grid consumption: smartmeter_energy_ac_consumed
Grid feed-in: smartmeter_energy_ac_sold
which are required for the energy dashboard, you need to specify
smartmeter: True

Please add those to sensors to the list on the github, as i was stumped for a few mins when they were not showing up, and as
it wasnt in the list on github i presumed they were default entities, (Thankfully i do have a smart meter) but if you dont
doesnt that mean you cant get those sensors, may need to mention that smartmeter is required under energy dashboard section.

  1. Once the entities are created, it seems HA core-2021.9.2 (Current)
    Wants the sensors to have a state class of state_class: total_increasing for all 3 sensors,
    easy fix using the customize.yaml, or could do via the gui,
    sensor.fronius_total_energy:
    state_class: total_increasing
    last_reset: "homeassistant.util.dt.utc_from_timestamp(0)"
    sensor.fronius_smartmeter_energy_ac_consumed:
    state_class: total_increasing
    last_reset: "homeassistant.util.dt.utc_from_timestamp(0)"
    sensor.fronius_smartmeter_energy_ac_sold:
    state_class: total_increasing
    last_reset: "homeassistant.util.dt.utc_from_timestamp(0)"

  2. The last_reset
    When i pull up the entity's in Developer Tools > States > Search for sensor.fronius_smartmeter_energy_ac_consumed
    Under attributes (for all three customized entities)

state_class: total_increasing
attribution: Fronius Inverter Data
unit_of_measurement: kWh
friendly_name: Fronius SmartMeter Energy AC Consumed
icon: mdi:solar-power
device_class: energy
last_reset: homeassistant.util.dt.utc_from_timestamp(0)

Should the last_reset not be a date, eg 2021-01-01T00:00:01
Is that "homeassistant.util.dt.utc_from_timestamp(0)" line correct or hasnt been brought in properly??

kWh instead of MWh in day energy

From the new update I have MWh in fronius day energy. It should be kWh. Even if I change to kWh in customize.yaml Istill have MWh count. Before new update I had kWh and it was fine to me.

Entity id already exists

There is an issue with the integration which does not stop the integration working at all but it continues to raise the same errors and warning for a while now over all of releases I have tested since 0.107.7.

I am now testing in 0.110.1 and these are the errors and warnings which persist:

Logger: homeassistant.components.sensor
Source: helpers/entity_platform.py:436
Integration: Sensor (documentation, issues)
First occurred: 10:58:15 PM (9 occurrences)
Last logged: 10:58:15 PM


Entity id already exists - ignoring: sensor.fronius_ac_current. Platform fronius_inverter does not generate unique IDs
Entity id already exists - ignoring: sensor.fronius_ac_voltage. Platform fronius_inverter does not generate unique IDs
Entity id already exists - ignoring: sensor.fronius_ac_frequency. Platform fronius_inverter does not generate unique IDs
Entity id already exists - ignoring: sensor.fronius_dc_current. Platform fronius_inverter does not generate unique IDs
Entity id already exists - ignoring: sensor.fronius_dc_voltage. Platform fronius_inverter does not generate unique IDs

I am using this environment:


arch | x86_64
-- | --
dev | false
docker | true
hassio | false
installation_type | Home Assistant Core on Docker
os_name | Linux
os_version | 4.2.8
python_version | 3.7.7
timezone | Australia/Brisbane
version | 0.110.1
virtualenv | false

Cheers for building such a fantastic integration!

Failed to update: connection error

Thank you for this integration and your work! Great stuff!

In my log I get this error:
Failed to update: connection error
and the relevant sensors stay unknown

Fronius firmware:

Datalogger ID: 240.1147052
Software version: 3.16.7-1
Search for Firmware Update
Fronius Solar Net connection: Connected
Solar.web connection: Connected

Fronius integration v0.9.5
HA Config:

  - platform: fronius_inverter
    ip_address: http://192.168.1.25

When I go to the address mentioned in your readme I get a 404 error but both urls mentioned below it do work.
http:///GetInverterRealtimeData.cgi?Scope=Device&DeviceId=1&DataCollection=CommonInverterData
404 Not Found

I really need the array voltage and amperage so I do hope to get this working again.

get rel_Autonomy and rel_SelfConsumption values from powerflow

Hi,
I make a powerflow query i have this result:

{
"Body" : {
"Data" : {
"Inverters" : {
"1" : {
"DT" : 78,
"E_Day" : 2104.699951171875,
"E_Total" : 2001023.125,
"E_Year" : 2104.699951171875,
"P" : 0
}
},
"Site" : {
"E_Day" : 2104.699951171875,
"E_Total" : 2001023.125,
"E_Year" : 2104.699951171875,
"Meter_Location" : "grid",
"Mode" : "meter",
"P_Akku" : null,
"P_Grid" : 430.77999999999997,
"P_Load" : -430.77999999999997,
"P_PV" : null,
"rel_Autonomy" : 0,
"rel_SelfConsumption" : null
},
"Version" : "12"
}
},
"Head" : {
"RequestArguments" : {},
"Status" : {
"Code" : 0,
"Reason" : "",
"UserMessage" : ""
},
"Timestamp" : "2020-01-01T21:04:20+01:00"
}
}

Can you add this two variables?

This is a description of these variables:
mandatory field
available since Fronius Hybrid version 1.3.1-1
available since Fronius Non Hybrid version 3.7.1-2
current relative self consumption in %, null if no smart meter is connected
number rel_SelfConsumption;

mandatory field
available since Fronius Hybrid version 1.3.1-1
available since Fronius Non Hybrid version 3.7.1-2
current relative autonomy in %, null if no smart meter is connected
number rel_Autonomy;

Thank you.
Peter.

Sensors Unknown 0.8.4 >

Hello,

Sorry to be a pain,

Just noticed that something breaks my setup since 0.8.4 >

My config

sensor:

  • platform: fronius_inverter
    ip_address: 192.168.1.75
    device_id: 1
    scan_interval: 20
    powerflow: True

0.8.3 Seems to work great,
Screenshot
83

0.8.4 > (Tested 0.8.4, 0.8.5, 0.8.6)
86

Thanks again for taking time develop this,

Ben

Not working on 0.106.6

Hi,

I am currently running on Hassio v0.102.3 with no issue. However, once i update to Hassio v0.106.6. everything broke.

Below is error on one of the cards.

Any idea?
image

Using two Fronius Symo Inverters

Basically, I have two Symo Inverters with two different IPs
As long as I enter one IP or the other, everything is fine.... for one inverter at a time
I must do something wrong with the scope... should I enter both IP with a special syntax ?
The Fronius software merge the data from the two inverters, I supposed that the scope: System would do the same or am I wrong ??
Thanks

Support Smart Meter TS 100A-1

Hi, really nice work
I have a Fronius inverter GEN 24 PLUS
with a Smart Meter TS 100A-1

i have added this config file to HA

 - platform: fronius_inverter
    ip_address: myip
    powerflow: True
    power_units: kW
    smartmeter: True
    smartmeter_device_id: 0

and the result are:
fronius

as u see, many sensor, report UNKNOW status

this is the result from api
http://myip/solar_api/v1/GetMeterRealtimeData.cgi?Scope=Device&DeviceId=0

{
   "Body" : {
      "Data" : {
         "ACBRIDGE_CURRENT_ACTIVE_MEAN_01_F32" : -5.7779999999999996,
         "ACBRIDGE_CURRENT_AC_SUM_NOW_F64" : -5.7779999999999996,
         "COMPONENTS_MODE_ENABLE_U16" : 1.0,
         "COMPONENTS_MODE_VISIBLE_U16" : 1.0,
         "COMPONENTS_TIME_STAMP_U64" : 1623686508.0,
         "Details" : {
            "Manufacturer" : "Fronius",
            "Model" : "Smart Meter TS 100A-1",
            "Serial" : "2651324894"
         },
         "GRID_FREQUENCY_MEAN_F32" : 50.0,
         "SMARTMETER_ENERGYACTIVE_ABSOLUT_MINUS_F64" : 355124.0,
         "SMARTMETER_ENERGYACTIVE_ABSOLUT_PLUS_F64" : 577337.0,
         "SMARTMETER_ENERGYACTIVE_CONSUMED_SUM_F64" : 577337.0,
         "SMARTMETER_ENERGYACTIVE_PRODUCED_SUM_F64" : 355124.0,
         "SMARTMETER_ENERGYREACTIVE_CONSUMED_SUM_F64" : 221.0,
         "SMARTMETER_ENERGYREACTIVE_PRODUCED_SUM_F64" : 576646.0,
         "SMARTMETER_FACTOR_POWER_01_F64" : -0.98599999999999999,
         "SMARTMETER_FACTOR_POWER_SUM_F64" : -0.98599999999999999,
         "SMARTMETER_POWERACTIVE_01_F64" : -1333.9000000000001,
         "SMARTMETER_POWERACTIVE_MEAN_01_F64" : -1425.8602006688966,
         "SMARTMETER_POWERACTIVE_MEAN_SUM_F64" : -1333.9000000000001,
         "SMARTMETER_POWERAPPARENT_01_F64" : 1352.0999999999999,
         "SMARTMETER_POWERAPPARENT_MEAN_01_F64" : 1441.9705685618733,
         "SMARTMETER_POWERAPPARENT_MEAN_SUM_F64" : 1352.0999999999999,
         "SMARTMETER_POWERREACTIVE_01_F64" : -221.19999999999999,
         "SMARTMETER_POWERREACTIVE_MEAN_SUM_F64" : -221.19999999999999,
         "SMARTMETER_VALUE_LOCATION_U16" : 0.0,
         "SMARTMETER_VOLTAGE_01_F64" : 241.80000000000001,
         "SMARTMETER_VOLTAGE_MEAN_01_F64" : 241.78963210702304
      }
   },
   "Head" : {
      "RequestArguments" : {
         "DeviceClass" : "Meter",
         "DeviceId" : "0",
         "Scope" : "Device"
      },
      "Status" : {
         "Code" : 0,
         "Reason" : "",
         "UserMessage" : ""
      },
      "Timestamp" : "2021-06-14T16:01:49+00:00"
   }
}

http://myip/solar_api/v1/GetPowerFlowRealtimeData.fcgi

{
   "Body" : {
      "Data" : {
         "Inverters" : {
            "1" : {
               "DT" : 1,
               "P" : 1655
            }
         },
         "Site" : {
            "BatteryStandby" : false,
            "E_Day" : null,
            "E_Total" : null,
            "E_Year" : null,
            "Meter_Location" : "grid",
            "Mode" : "meter",
            "P_Akku" : null,
            "P_Grid" : -1054.5999999999999,
            "P_Load" : -600.47312011718759,
            "P_PV" : 1707.7088012695312,
            "rel_Autonomy" : 100.0,
            "rel_SelfConsumption" : 36.280760820686339
         },
         "Version" : "12"
      }
   },
   "Head" : {
      "RequestArguments" : {},
      "Status" : {
         "Code" : 0,
         "Reason" : "",
         "UserMessage" : ""
      },
      "Timestamp" : "2021-06-14T16:12:05+00:00"
   }
}

Solar consumption

Hello.

I have been using this for a while but have noticed that I only get a solar consumption reading when I am also importing from the grid.

Unsure if this is something in H.A or something to with the setup here.

image

image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.