tijsverkoyen / HomeAssistant-FusionSolar

Integrate FusionSolar into your Home Assistant.
MIT License
149 stars 27 forks source link

Daily Solar Energy sometimes exceeds the day and is displayed in the Energy Dashboard #81

Closed hufkens closed 10 months ago

hufkens commented 1 year ago

I'm using this Integration and the https://github.com/wlcrs/huawei_solar Integration. The last one can give me realtime data, but for some reason I can't get the actual Solar Production since I added a Home Battery. So I have been using this Integration which I discovered recently. It's a lot easier to setup and monitors perfectly the app features.

But when I display the data in the energy Dashboard I sometimes (not every day) get weird results. See attachments: Energy Dashboard:

Screenshot 2023-03-23 at 19 24 19

Grafana details:

Screenshot 2023-03-23 at 19 26 18

It looks like I get data after midnight which is counted for the next dat already an it adds a peak in the dashboard. Do you have any idea if there is something wrong with the timestamps? Or might it be cause by the fact that the API limits the amount of calls and therefore I can get data too late.

Is there anybody else having the same issue?

Thanks in advance, Alain

tijsverkoyen commented 1 year ago

Just to be 100% sure: are you using the latest version of the integration?

There is already some code in place to prevent this. The root cause is Huawei sending wrong data.

Normally the value should only be updated if the plant is producing.

Could you check which entity you are using? Because I suspect you are using?

hufkens commented 1 year ago

Thanks for the fast reply. I'm using the 'sensor.fusionsolar_station_total_current_day_energy' and I installed the Integration via HACS. Not sure where I can see what version I am running?

hufkens commented 1 year ago

Sometimes the Solar in the Energy Dashboard drops below Zero. So indeed it feels like the API sends incorrect data.

Screenshot 2023-03-23 at 20 59 24
tijsverkoyen commented 1 year ago

If you have installed it through HACS and there are no updates available then you are running the latest version.

tijsverkoyen commented 1 year ago

The check for invalid data is only in place for the total lifetime energy.

hufkens commented 1 year ago

But adding that to the Energy Dashboard also does not show correct data. Before I used the Inverters Daily Energy, but when you have batteries it is not the Solar Energy alone. So I looked like the total_current_day_energy was the one I needed.

Thanks for the help, but as long as Huawei sends incorrect data it will not be solved I guess. Would be nice if that check could also be added to the total_current_day_energy

tijsverkoyen commented 1 year ago

The problem is that it is not that easy to check.

At the moment the check for the lifetime value is that it is only updated if the plant is producing.

We can't do this for the daily energy as the data would otherwise be moved over to the next day. Returning 0 while not producing is also not an option, because Home Assistant will see this as a reset of the data.

I don't have a clue on how to check if the data is invalid as there is no real logic to it.

hufkens commented 1 year ago

Thanks. I understand.

danielhunt commented 1 year ago

I am seeing similar behaviour with this integration - every night between 2300-0000 there is a large spike image

When I look at the underlying data in Grafana, I see there is a burst of (what appears to be invalid) data between 2300 and 0000, every 10 minutes, starting at 23:12. (there is a zero data tick @ 23:12, followed by 5 ticks of bad data before it is zero again at 00:12) image

tijsverkoyen commented 1 year ago

I think we all should report this to Huawei. You can mail them at eu_inverter_support@huawei.com

danielhunt commented 1 year ago

Did anyone get a response from Huawei on this?

In the meantime, is it easy to get this addon to ignore any solar-panel generation data coming from the inverter between 11pm and 1am as a precaution?

tijsverkoyen commented 1 year ago

I did not reported it, as I don't get the invalid data. Did you reported it, and got a response?

As the timeframe of "invalid" data will not be the same for everyone, and there is no easy way to check if the data is invalid I don't see a generic work around.

A possible way could be:

  1. Add a switch entity "Disable fetching data" in this integration
  2. In the UpdateCoordinator check for the state of this switch
  3. Use a schedule to turn on/off the "Disable fetching data" switch.