home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
73.45k stars 30.68k forks source link

Fronius Sensor data not detailed enough #54491

Closed bartmarchand1 closed 2 years ago

bartmarchand1 commented 3 years ago

The problem

The polled data from a Fronius IG inverter with datamanager is only recorded in steps of 1kWh. Everything produced less than 1kWh is not recorded, everything less than 2kWh is recorded as 1kWh, etc...

Knipsel Knipsel2

What is version of Home Assistant Core has the issue?

core-2021.8.6

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant Supervised

Integration causing the issue

Fronius

Link to integration documentation on our website

No response

Example YAML snippet

-   platform: fronius
    resource: http://192.168.1.102
    scan_interval: 10
    monitored_conditions:
    - sensor_type: inverter
      scope: device
-   platform: fronius
    resource: http://192.168.1.103
    scan_interval: 10
    monitored_conditions:
    - sensor_type: inverter
      scope: device

Anything in the logs that might be useful for us?

No response

Additional information

No response

probot-home-assistant[bot] commented 3 years ago

fronius documentation fronius source (message by IssueLinks)

probot-home-assistant[bot] commented 3 years ago

Hey there @nielstron, mind taking a look at this issue as it has been labeled with an integration (fronius) you are listed as a code owner for? Thanks! (message by CodeOwnersMention)

nielstron commented 3 years ago

Did you try adding one of the other sensors I.e. power_flow? Is the data also not detailed when querying it directly (on the fronius website, using the pyfronius package)? You can also try to manually compute generated or consumed power via template sensors and the integration platform and try if that is more detailed (see #54047)

bartmarchand1 commented 3 years ago

@nielstron thank you for the response, it is an inverter only installation, power_flow is not available. Will try the mentioned options, pyfronius and template sensor, I'm even considering using modbus communication with the datamanager.

Bascht74 commented 3 years ago

@bartmarchand1 Have you find a solution for your problem? I just realized that I got the same... Thx for any help...

Bascht74 commented 3 years ago

Did you try adding one of the other sensors I.e. power_flow? Is the data also not detailed when querying it directly (on the fronius website, using the pyfronius package)? You can also try to manually compute generated or consumed power via template sensors and the integration platform and try if that is more detailed (see #54047)

If the data from the inverter is not any more detailed: Would it be possible to use the 1 KWh sensor data steps and calculate the missing data out of the generated power until the next 1 KWh is reached? I am now at my holiday location so I don't have any access to the devices, but I will check the plain output of the fronius datalogger... It would be a real shame if Fronius only sends 1 KWh steps for IG devices...

Funny side note: It is only happening above 1KWh at the day sensor of the IG: image I don't know why so far...

This is how it is shown at solarWEB: image

image

Sebastian

bartmarchand1 commented 3 years ago

@nielstron thank you for the response, it is an inverter only installation, power_flow is not available. Will try the mentioned options, pyfronius and template sensor, I'm even considering using modbus communication with the datamanager.

In did a workaround with the powerproduction and the Riemann sum integration. Not ideal but it works. I do need to find a solution for the large powerpeak at the start of the production.

nielstron commented 3 years ago

@Bascht74 if it only happens above 1kWh, this sounds like there is a division problem somewhere in the chain (when switching from Wh to kWh).

Could either of you @bartmarchand1 @Bascht74 try to open yourfroniusip/solar_api/v1/GetPowerFlowRealtimeData.fcgi?humanreadable=false in your browser and check if the 1kWh steps are actually returned from the datalogger? Just to make sure that this is not a problem of the pyfronius package or home assistant.

Bascht74 commented 3 years ago

It seems that the data is collected that way:

image

output of yourfroniusip/solar_api/v1/GetPowerFlowRealtimeData.fcgi?humanreadable=false: (quickly installed wireguard within home assistant :-)

{
   "Body" : {
      "Data" : {
         "Inverters" : {
            "1" : {
               "DT" : 193,
               "E_Day" : 6257,
               "E_Total" : 34177056,
               "E_Year" : 2434590,
               "P" : 2787
            },
            "2" : {
               "DT" : 177,
               "E_Day" : 4000,
               "E_Total" : 32569000,
               "E_Year" : 2700000,
               "P" : 2611
            }
         },
         "Site" : {
            "E_Day" : 10257,
            "E_Total" : 66746056,
            "E_Year" : 5134590,
            "Meter_Location" : "unknown",
            "Mode" : "produce-only",
            "P_Akku" : null,
            "P_Grid" : null,
            "P_Load" : null,
            "P_PV" : 5398,
            "rel_Autonomy" : null,
            "rel_SelfConsumption" : null
         },
         "Version" : "12"
      }
   },
   "Head" : {
      "RequestArguments" : {},
      "Status" : {
         "Code" : 0,
         "Reason" : "",
         "UserMessage" : ""
      },
      "Timestamp" : "2021-08-24T12:12:52+02:00"
   }
}

:-)

Now@13:15

image

image

{
   "Body" : {
      "Data" : {
         "Inverters" : {
            "1" : {
               "DT" : 193,
               "E_Day" : 8652,
               "E_Total" : 34179448,
               "E_Year" : 2436985,
               "P" : 3139
            },
            "2" : {
               "DT" : 177,
               "E_Day" : 6000,
               "E_Total" : 32571000,
               "E_Year" : 2702000,
               "P" : 3326
            }
         },
         "Site" : {
            "E_Day" : 14652,
            "E_Total" : 66750448,
            "E_Year" : 5138985,
            "Meter_Location" : "unknown",
            "Mode" : "produce-only",
            "P_Akku" : null,
            "P_Grid" : null,
            "P_Load" : null,
            "P_PV" : 6465,
            "rel_Autonomy" : null,
            "rel_SelfConsumption" : null
         },
         "Version" : "12"
      }
   },
   "Head" : {
      "RequestArguments" : {},
      "Status" : {
         "Code" : 0,
         "Reason" : "",
         "UserMessage" : ""
      },
      "Timestamp" : "2021-08-24T13:16:56+02:00"
   }
}
nielstron commented 3 years ago

Hm unfortunately there is little the package or HA can do about it then. My suggestion would be to add an integration sensor to HA manually and use it instead for the currently produced energy:

sensor:
  - platform: integration
    source: sensor.name_of_fronius_solar_power_production_sensor_in_watts
    unit_prefix: k
    unit_time: h
    unit: kWh
    name: "Solar Production Total"
Bascht74 commented 3 years ago

@nielstron I updated the comment. Now you can see how it is after some hours.

What ist funny, the total is 14,63 KWh on the webpage of the datacollector, and the sums are 8652 + 6000 = 14,652 (got it a little later). So the data displayed is wrong as well. It jumps after some time...

nielstron commented 3 years ago

thanks @Bascht74 ! This looks very much like it is an issue with the fronius datalogger, likely they do some integer division to calculate kWh from Wh.

Bascht74 commented 3 years ago

Probably...

If I am at home I will look at the display and compare the date so see if the inverter is sending the data that way. But that would be a very strange implementation...

bartmarchand1 commented 3 years ago

@nielstron & @Bascht74 looking at the export, i've noticed that the values of inverter 2 are rounded to thousands, kW or kWh. It is only with the IG+ inverter this way, the values of the TL are looking normal. My installation is made up of 2 IG inverters, older than the IG+ and much older than the TL.

Professionally we read out 100s of data managers by modbus TCP, with much detail. I think, for this private installation, that I will also use modbus, the resolution of the API results is not good enough.

Bascht74 commented 3 years ago

@nielstron & @Bascht74 looking at the export, i've noticed that the values of inverter 2 are rounded to thousands, kW or kWh. It is only with the IG+ inverter this way, the values of the TL are looking normal. My installation is made up of 2 IG inverters, older than the IG+ and much older than the TL.

Professionally we read out 100s of data managers by modbus TCP, with much detail. I think, for this private installation, that I will also use modbus, the resolution of the API results is not good enough.

I am not sure so far if it is a problem with the api as the values shown on the webpage of the Fronius datalogger are the same. but I am very interested in your results and wether you can get more detailed data via modbus2tcp that the datalogger is offering. I hope you are right and that you share your results/HA config.

sebastian

Bascht74 commented 3 years ago

@bartmarchand1 any success with modbus? Could you share your findings/configuration? for me I can only use https://www.home-assistant.io/integrations/integration/ for a better resolution.

The display of the IG-Plus shows the same value that is reported to home assistant. So it seams that it cannot provide a better value...

Seb

github-actions[bot] commented 2 years ago

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.