uvejota / homeassistant-edata

Home Assistant integration for spanish energy data providers (e.g., datadis)
GNU General Public License v3.0
263 stars 21 forks source link

Surplus aggregation at edata-card graphs not working correctly #263

Open cho0p opened 2 months ago

cho0p commented 2 months ago

Hi,

first of all thank you for the new release and the integration of surplus energy. I have installed version 2024.07.4 and it's loading all the data from Datadis. Still I noticed one issue with the surplus card.

When I create a custom edata card and use surplus daily it's working fine but when I choose weekly, monthly or yearly the calculation doesn't seem to work. This only affects the surplus. The monhly consumptions card works fine. Using the chart summary-month also seems to work correctly (consumption and surplus numbers are correct).

@uvejota Any advice or could you have a look at it?

Thank you!

image

image

image

uvejota commented 2 months ago

Let me take a look, it seems buggy :)

uvejota commented 2 months ago

I'm having some difficulties to reproduce this bug. Can you please try to reduce the number of records to 12 at the monthly card and check if the value is still wrong?

Thanks!

cho0p commented 2 months ago

Thanks for getting back. It doesn't work with 12 either but with 11.

image image
cho0p commented 2 months ago

I just checked the data in Datadis as well and there is no surplus recorded before September 2023.

image
uvejota commented 2 months ago

Can you try the latest version and run the new button "Import all data"? (First one in the capture)

It will try to rebuild consumption (and surplus) statisticas with last 2 years of data, so it may take a while ;)

assets/actions.png

cho0p commented 2 months ago

I have update from .04 to .05, restarted and used the update button. It seems that the original issue is gone and the surplus is displayed correctly now but I have a new issue with the consumption now:

image image
uvejota commented 2 months ago

There's clearly a bug, but I can think you can fix it by using the "Developer tools" section (at the left panel), and then go to "Statistics", then you can click on corrupt consumption statistics, press "Outliers" and manually fix the negative value.

Moreover, I will try to roll out a new version to fix it.

cho0p commented 2 months ago

I didn't know that you can change wrong values so easily in the frontend. Thanks for sharing. It did the trick for now.