Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong date/time in average_electricity_price_today #171

Open
VictorvandenHoven opened this issue Sep 2, 2024 · 13 comments
Open

Wrong date/time in average_electricity_price_today #171

VictorvandenHoven opened this issue Sep 2, 2024 · 13 comments
Assignees
Labels
bug Something isn't working

Comments

@VictorvandenHoven
Copy link

Unfortunately, the old closed issue #144 about the dates of the attributes of the entity 'sensor.average_electricity_price_today' that remain fixed and don't change anymore, is still there.
The issue happens every now and then, also in version 0.4.2.

@SjaakPeer
Copy link

SjaakPeer commented Sep 2, 2024

Yes, I have the same issue again as well, since update to 0.4.2.

Even worse: The previously proposed fix in issue #155 does no longer work: A full (manual) cleanup the core.restore_state file does somehow does not fix the bug, as old data keeps on re-appearing after a "ha core start". Any other work-around suggestions would be great!

@maartenlandman89
Copy link

I have the same. The data of 1 September is tomorrow and 2 September is today.
Even when I make a new setup, it’s still the same.

@Roeland54
Copy link
Collaborator

Multiple things are at play here. Currently the entso-e platform is not responding with the prices of tomorrow. That is something we will not be able to solve.

But there is also a bug in the parsing of an incomplete response of the API where dates gets mixed-up. I'll look into fixing that a.s.a.p.

Thanks for reporting.

@Roeland54 Roeland54 added the bug Something isn't working label Sep 2, 2024
@Roeland54 Roeland54 self-assigned this Sep 2, 2024
@firefixmaarten
Copy link

Nice to have someone on this project, highly appreciated! @Roeland54

@SjaakPeer
Copy link

Multiple things are at play here. Currently the entso-e platform is not responding with the prices of tomorrow. That is something we will not be able to solve.

But there is also a bug in the parsing of an incomplete response of the API where dates gets mixed-up. I'll look into fixing that a.s.a.p.

Thanks for reporting.

Update: Now (september 3rd) my issues appear to have resolved itself as I get updated data in the right format again. You may have been correct on the multiple issues at play here.

@richardstroobach
Copy link

Here it is also fixed now, after a restart of home assistant.

@Roeland54
Copy link
Collaborator

@richardstroobach can you look in de logs from before your restart? They should be in the "home-assistant.log.1" file.
And search for entsoe. Do you find logs in de last 2 hours? can you paste them here?

@richardstroobach
Copy link

richardstroobach commented Sep 3, 2024

The last entso-e logs are from these:

0.25833, Timestamp('2024-09-02 16:00:00+0200', tz='Europe/Amsterdam'): 0.26558, Timestamp('2024-09-02 17:00:00+0200', tz='Europe/Amsterdam'): 0.28823, Timestamp('2024-09-02 18:00:00+0200', tz='Europe/Amsterdam'): 0.32491, Timestamp('2024-09-02 19:00:00+0200', tz='Europe/Amsterdam'): 0.46084, Timestamp('2024-09-02 20:00:00+0200', tz='Europe/Amsterdam'): 0.40634, Timestamp('2024-09-02 21:00:00+0200', tz='Europe/Amsterdam'): 0.31298, Timestamp('2024-09-02 22:00:00+0200', tz='Europe/Amsterdam'): 0.29045, Timestamp('2024-09-02 23:00:00+0200', tz='Europe/Amsterdam'): 0.27749}, 'dataTomorrow': {}}

Before the restart, during today, I see a lot of these errors:

2024-09-03 00:00:00.568 ERROR (MainThread) [homeassistant.helpers.entity] Update for sensor.entsoeplatform_average_electricity_price_today fails
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 942, in async_update_ha_state
await self.async_device_update()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1300, in async_device_update
await self.async_update()
File "/config/custom_components/entsoe/sensor.py", line 210, in async_update
self._attr_extra_state_attributes = {x: self.coordinator.processed_data()[x] for x in self.coordinator.processed_data() if x not in invalid_keys and x not in existing_entities}
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/entsoe/coordinator.py", line 167, in processed_data
"min_price": self.get_min_price(filtered_hourprices),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/entsoe/coordinator.py", line 209, in get_min_price
return min(hourprices.values())
^^^^^^^^^^^^^^^^^^^^^^^^
ValueError: min() iterable argument is empty

@Roeland54
Copy link
Collaborator

Ok that helps. Should be fixed in the next release.

@Roeland54
Copy link
Collaborator

The beta version of v0.5.0-beta1 does contain a lot of changes to improve reliability.
Can you test and provide feedback?

@max19751
Copy link

Also the beta v0.5.0-beta3 still shows the average electricity prices for tomorrow with dates of yesterday and today.

@Roeland54
Copy link
Collaborator

Also the beta v0.5.0-beta3 still shows the average electricity prices for tomorrow with dates of yesterday and today.

If you are using the default calculation method (publish) and the prices of tomorrow are not know yet this is expected behavior. Please open a new issue if you think there is something wrong.

@max19751
Copy link

Also the beta v0.5.0-beta3 still shows the average electricity prices for tomorrow with dates of yesterday and today.

If you are using the default calculation method (publish) and the prices of tomorrow are not know yet this is expected behavior. Please open a new issue if you think there is something wrong.

Understood, the solves the problem. Many thanks for the swift reaction

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

7 participants