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
72.17k stars 30.2k forks source link

Fronius integration issue makes Energy dashboard data corruption #114613

Closed kgiedrius closed 5 months ago

kgiedrius commented 6 months ago

The problem

I use sensor.symo_17_5_3_m_1_energy_total value in home assistant Energy dashboard and from time to time (a few times a year) ir corrupts energy dashboard statistics. What I found in this sensor charts that at the moment when data corrupts it becomes 0 value and in next datapoint restores. In this case Home assistant Energy dashboard generate statistics from 0 - to restored value.

How it looks after data issue:

image image

How is should look:

image

What version of Home Assistant Core has the issue?

2024.3.0

What was the last working version of Home Assistant Core?

same issue with older versions

What type of installation are you running?

Home Assistant OS

Integration causing the issue

Fronius component / Energy dashboard

Link to integration documentation on our website

https://www.home-assistant.io/integrations/fronius/

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

home-assistant[bot] commented 6 months ago

Hey there @farmio, 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!

Code owner commands Code owners of `fronius` can trigger bot actions by commenting: - `@home-assistant close` Closes the issue. - `@home-assistant rename Awesome new title` Renames the issue. - `@home-assistant reopen` Reopen the issue. - `@home-assistant unassign fronius` Removes the current integration label and assignees on the issue, add the integration domain after the command. - `@home-assistant add-label needs-more-information` Add a label (needs-more-information, problem in dependency, problem in custom component) to the issue. - `@home-assistant remove-label needs-more-information` Remove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.

(message by CodeOwnersMention)


fronius documentation fronius source (message by IssueLinks)

farmio commented 6 months ago

Hi 👋! This should already be fixed by https://github.com/home-assistant/core/pull/102270 back in November 23. I'd need more detailed infos about what happened there to see why this didn't work for your specific case. Anyway, be sure to have your inverter and datalogger updated to the latest firmware version.

kgiedrius commented 6 months ago

strange, but probably fix is not working or still not in release ? My inverter is Fronius Symo and there was no firmware update or power outage when this spike in data happened.

kgiedrius commented 6 months ago

should I provide any other information to help solving this case ?

farmio commented 6 months ago

The fix was in the November 2023 release. I run 2 Symos and none of these shows such behaviour - nor did they before November. So I don't really have any lead to start investigating.

I would probably require lot more info like API responses when such happens. What exact entity are you using for your energy dashboard (to which HA device does it belong)? What firmware is running on the inverter and Datalogger?

kgiedrius commented 6 months ago

The issue was with latest and with 1 year old firmware. now both firmwares are latest.

image

Energy dashboard configuration:

image
kgiedrius commented 6 months ago

But as I understand if values which are: < 1 or null or false could be skipped - it can solve the issue in general.
Or maybe you can add check in code that if total energy is less than previous value - do nothing or etc.

kgiedrius commented 6 months ago

by the way why you use solarnet when Fronius itself has json api with much more data ?

farmio commented 6 months ago

The integration does only use Fronuis json API (SolarAPI). SolarNet is their underlying internal Modbus communication - the json API feeds from that. We don't use their cloud thing called SolarWeb (there is a custom component that does).

Not values <1, but values 0 or null are skipped.

I can't see which HA device this entity is from. Make sure it is the inverter device, not the SolarNet device.

kgiedrius commented 6 months ago

here is device:

image
farmio commented 6 months ago

yeah, that's the one to use.

kgiedrius commented 6 months ago

look at the recorder amount in both images (when issue happened):

image image

it was not timeout or 0 it was 10x less for 1 datapoint and then restores.
this value is from api ? if yes its very strange how it became 10x smaller for a moment:)

kgiedrius commented 6 months ago

in db it looks like this (accuracy become 5 digits instead of 3):

image
farmio commented 6 months ago

Well, it looks like it came from the API. You should probably consult Fronius support with this issue. I don't think there is anything I can do at this point.

kgiedrius commented 6 months ago

from this api? /solar_api/v1/GetInverterRealtimeData.cgi?Scope=Device&DataCollection=CumulationInverterData&DeviceId=1

or which call you use?

farmio commented 6 months ago

it uses /solar_api/v1/GetInverterRealtimeData.cgi?Scope=Device&DeviceId=1&DataCollection=CommonInverterData not "CumulationInverterData".

kgiedrius commented 6 months ago

but from this api call response I see that total_energy is integer (watt hours), not float, so can't it be wrong divider used in Home assistent, because in DB it is converted to kwh from wh

image
farmio commented 6 months ago

can't it be wrong divider used in Home assistent, because in DB it is converted to kwh from wh

I don't see why this would be a thing. Before doing guesswork, it would be better to log the API responses until the issue occurs again.

logger:
  default: info
  logs:
    # homeassistant.components.fronius: debug
    pyfronius: debug
dan87aut commented 5 months ago

Hello, since yesterday I no longer see current power (grid or PV) or self-sufficiency displayed in Home Assistant (SolarNet).

Does anyone else have this problem?

farmio commented 5 months ago

@dan87aut your comment doesn't look like its related to this issue. If you think you found a bug, please open a new issue. For support questions please head to the community forums.

issue-triage-workflows[bot] commented 5 months 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.