JaccoR / hass-entso-e

Integration for Home Assistant to fetch day ahead energy prices from European countries via ENTSO-e Transparency Platform
Apache License 2.0
185 stars 31 forks source link

incorrect lowest price time of day #96

Closed Mariusthvdb closed 1 month ago

Mariusthvdb commented 1 year ago

with the fixed PR in the timestamp for these sensors, this is revealed (today is dec 20th)

Scherm­afbeelding 2022-12-20 om 10 37 27

while it should really be like

Scherm­afbeelding 2022-12-20 om 10 37 33

note the timestamp is indeed 1 day off:

Scherm­afbeelding 2022-12-20 om 10 36 54

instead of

Scherm­afbeelding 2022-12-20 om 10 37 16

the correct timestamp is ,made by the custom intergration by @klaasnicolaas for the EnergyZero data

see:

Scherm­afbeelding 2022-12-20 om 10 40 26
sfstar commented 1 year ago

In what mode of calculation are you running with the integration? And to double check: the timestamp format is now ok?

Mariusthvdb commented 1 year ago

dont think I understand what you are asking about the mode of calculation.

(timestamp seems to be ok, that is, it is showing in the frontend correctly. only a day off ;-)

see this:

Scherm­afbeelding 2022-12-21 om 10 57 35

it just doesnt check todays prices and seems to go back a full day.

which is remarkable, because when I select 48 hours, these are not ready yet, and only todays prices are available:

Scherm­afbeelding 2022-12-21 om 10 57 51
sfstar commented 1 year ago

@Mariusthvdb you can find the selected calculation method in the options menu that you can access via the configure button on the entsoe integration. Should look like this:

Screenshot 2022-12-23 at 18 46 21

Based on your selected method this could be related to #77 and #98

JaccoR commented 1 year ago

I am in publish and i am having the same problem. Would choosing another calculation method fix this? The calculation method introduced some difficulties. I think #99 also has something to do with it.

klaasnicolaas commented 1 year ago

The hourprices list you get in the _filter_calculated_hourprices function, does it consist of data from multiple days?

JaccoR commented 1 year ago

Highest price is also incorrect and therefore the percentage is also incorrect.

lfdmn commented 1 year ago

The hourprices list you get in the _filter_calculated_hourprices function, does it consist of data from multiple days?

If I understand the code correctly, if self.calculation_mode == CALCULATION_MODE["publish"] it'll return data for 72h or 48h which makes these guys incorrect if you expect the values to be for the current day?

            "min_price": self.get_min_price(filtered_hourprices),
            "max_price": self.get_max_price(filtered_hourprices),
            "avg_price": self.get_avg_price(filtered_hourprices),
            "time_min": self.get_min_time(filtered_hourprices),
            "time_max": self.get_max_time(filtered_hourprices),

Or is this on purpose?

martin3000 commented 1 year ago

I'm in publish mode and the "sensor.entsoe_highest_energy_price_today" is showing a price for tomorrow. Also, sensor.entsoe_time_of_highest_price_today is for tomorrow.

Roeland54 commented 2 months ago

So it would be nice to hear some opinions on the calculation methods. Currently "rotation" is the only calculation method that uses only the data of "today". "sliding" is using data of today and tomorrow (if available) to calculate min/max,... and only returns dates in the future "publish" is using the latest 48 available data point which is yesterday and today or today and tomorrow to calculate min/max,...(so can change in the middle of the day when new prices arrive)

The naming of the entities suggest "sensor.entsoe_time_of_highest_price_today" that only data of today is being used. Publish is however the default option.

I my opinion rotation is the most logical calculation method so we could change the default to rotation. And I think we also should drop the "today" naming for the entities because it is confusing and only true for rotation. All feedback appreciated.

martin3000 commented 2 months ago

I'm using "rotation", but I forgot the reason for choosing it. Btw: how does it work to update a foreign repository?

Roeland54 commented 1 month ago

The beta version of v0.5.0-beta1 does contain a lot of changes to improve reliability. I have checked the calculations of the min/max,... for the different settings and they should all work as documented. Can you test and provide feedback?

Roeland54 commented 1 month ago

v0.5.0 is released. The discussed issues should be solved. Please feel free to open a new issue if you feel this is needed.