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
173 stars 28 forks source link

V0.3.0 doesn't seem to download the data anymore #98

Closed MrOzzOnline closed 1 month ago

MrOzzOnline commented 1 year ago

It looks like the platform is up, but the data isn't updating since I updated to v0.3.0. I don't see any errors. Reverting to V0.2.0 seems to fix it for now.

rest77 commented 1 year ago

I have the same problem and switched back to 0.2.0. It seems all fields contain zero values.

sfstar commented 1 year ago

What did the logs say?

MrOzzOnline commented 1 year ago

What did the logs say?

There is not a single entry in the logs relating to this integration.

I only got a template error right after restarting the integration:

2022-12-20 14:59:34.784 ERROR (MainThread) [homeassistant.helpers.template_entity] TemplateError('ValueError: Template error: float got invalid input 'unavailable' when rendering template '{% set totaal_prijs = states('sensor.current_electricity_market_price') | float %} {% set netto_prijs = states('sensor.injectie_current_electricity_market_price') | float %}
{{ totaal_prijs - netto_prijs | float }}' but no default was specified') while processing template 'Template("{% set totaal_prijs = states('sensor.current_electricity_market_price') | float %} {% set netto_prijs = states('sensor.injectie_current_electricity_market_price') | float %}
{{ totaal_prijs - netto_prijs | float }}")' for attribute '_attr_native_value' in entity 'sensor.distributiekosten_en_btw'
MrOzzOnline commented 1 year ago

I'm running V0.3.0 again with debug logging enabled. I'll keep an eye on it and see what happens.

MrOzzOnline commented 1 year ago

Last update was successful.

Behavior yesterday: The attributes of sensor.average_electricity_price_today still contained the old values at 15:15 which is well past the time that the API updates (it updates at 14:00 local time). No warnings or errors in the logs.

Reverting to 0.2 and now back to 0.3 seems to fix it. @rest77 maybe you can try again?

I'll leave the debug log running for a while.

MrOzzOnline commented 1 year ago

Update:

There was a HA core update and after reboot (? I think) the values got messed up somehow. The prices for tomorrow seem to come a bit early. Maybe a timezone issue? image

MrOzzOnline commented 1 year ago

Did some more testing. Reverting it back to v0.2 fixed it.

I saw it short after 23:00, so I guess it's a timezone thing. I'm in Belgium at GMT+1

MrOzzOnline commented 1 year ago

Might be interesting: it seems to be version 0.2 is an hour late. This is what it looks like right after 0:00 using V0.2:

image

MrOzzOnline commented 1 year ago

V 0.3 right after 0:00, I guess the previous day should be gone?

image

rest77 commented 1 year ago

I tried again with the loggs on debug but there are no errors.

I get: state_class: measurement unit_of_measurement: SEK/kWh device_class: monetary icon: mdi:cash-minus friendly_name: Average electricity price today prices_today:

prices_tomorrow: prices:

attribution: Data provided by ENTSO-e Transparency Platform

0.251 is my fixed additional cost which is added with the template.

JaccoR commented 1 year ago

I can't reproduce this. What mode of calculation are you using?

rest77 commented 1 year ago

I use "rotation" and area Sweden 3 (SE3).

sfstar commented 1 year ago

Perhaps this can be fixed with the same solution that will fix #77?

sfstar commented 1 year ago

So I'm currently seeing the behaviour as well on my "on publish" instance of the integration. Seems to happen if internet connectivity was lost during a update attempt in combination with the AVG sensor only being updated when the avg value changes.

JaccoR commented 1 year ago

Had this yesterday as well. Not sure what the cause was. Has this been introduced with #95?

MrOzzOnline commented 1 year ago

If you look at the changed code in case data or self.data is none, nothing happens and nothing is logged. Maybe add an else section and log a warning in it?

MrOzzOnline commented 1 year ago

FYI I've updated back to V0.3.0 with no issues so far. No idea why it went wrong a few weeks ago.

rest77 commented 1 year ago

I tried again but in v0.3.0 all prices are zero. In v0.2.0 everything works as expected.

MrOzzOnline commented 1 year ago

It happend / is happening again. The integration doesn't seem to be updating anymore. With debug logging enabled I don't see any warning or errors. I'm not sure what I can do to check what goes wrong? Any help would be appreciated.

@sfstar ?

MrOzzOnline commented 1 year ago

The data got downloaded somehow. Nothing in the logs so I don't know when/how it got fixed.

MrOzzOnline commented 1 year ago

I've been observing this error for a while now. The data always seems to recover after 1 or 2 hours. I often receive the data an hour late while it's still published in the Entso-e API.

my hypothesis: Is it possible this integration only polls for new data once each hour on xx:00? If the entso-e data is published late the integration will wait for an hour to try again? Can someone check this in the code?

martin3000 commented 1 year ago

Where do you find those version numbers 0.2.0 and 0.3.0?

MrOzzOnline commented 1 year ago

Where do you find those version numbers 0.2.0 and 0.3.0?

Using HACS, click on the integration:

image

martin3000 commented 1 year ago

I don't have HACS. I checked manifest.json

LeonJansen commented 1 year ago

I've been observing this error for a while now. The data always seems to recover after 1 or 2 hours. I often receive the data an hour late while it's still published in the Entso-e API.

my hypothesis: Is it possible this integration only polls for new data once each hour on xx:00? If the entso-e data is published late the integration will wait for an hour to try again? Can someone check this in the code?

Yes it does that, it collects the data again at the next hour sharp:

# Schedule the next update at exactly the next whole hour sharp
        self._unsub_update = event.async_track_point_in_utc_time(
            self.hass,
            self._update_job,
            utcnow().replace(minute=0, second=0) + timedelta(hours=1),
        )
Roeland54 commented 1 month ago

v0.4.0 is released this version contains fixes that solve a lot of warnings and known issues. This issue is probably also solved. Please update to the latest version. Closing this issue for now. If you still have issue please feel free to open a new issue.