Not updating, exceptions logged related to new_data_cb(...), handle_new_day and more
Version of the custom_component
[45b4087] (https://github.com/custom-components/nordpool/commit/45b4087643b4c59fca95a6e792ea5e97501f1c4f)
Homeassistant version
2024.6.1
Configuration
sensor:
- platform: nordpool
region: "LT"
currency: "EUR"
VAT: true
precision: 5
low_price_cutoff: 0.95
price_in_cents: false
price_type: kWh
additional_costs: "{{ 0.08470 + 0.007 | float }}" # 0.08470 ESO, 0.007 ENEFIT
Describe the bug
Nordpool integration stops updating. While checking the log file, various exceptions are observed.
The last exception repeats every hour.
Debug log
2024-06-25 16:30:57.749 ERROR (MainThread) [custom_components.nordpool] Giving up new_data_cb(...) after 13 tries (custom_components.nordpool.aio_price.InvalidValueException: Invalid value in {'start': datetime.datetime(2024, 6, 25, 22, 0, tzinfo=<UTC>), 'end': datetime.datetime(20
24, 6, 25, 23, 0, tzinfo=<UTC>), 'value': inf} for area 'LT')
2024-06-25 16:30:57.749 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved (None)
Traceback (most recent call last):
File "/usr/local/lib/python3.12/site-packages/backoff/_async.py", line 151, in retry
ret = await target(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/nordpool/__init__.py", line 166, in new_data_cb
await api.update_tomorrow()
File "/config/custom_components/nordpool/__init__.py", line 91, in update_tomorrow
await self._update(type_="tomorrow", dt=dt_utils.now() + timedelta(hours=24), areas=self.areas if len(self.areas) > 0 else None)
File "/config/custom_components/nordpool/__init__.py", line 75, in _update
data = await spot.hourly(end_date=dt, areas=self.areas if len(self.areas) > 0 else None)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/nordpool/aio_price.py", line 246, in hourly
return await self.fetch(self.HOURLY, end_date, areas)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/backoff/_async.py", line 151, in retry
ret = await target(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/nordpool/aio_price.py", line 233, in fetch
return await join_result_for_correct_time(raw, end_date)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/nordpool/aio_price.py", line 145, in join_result_for_correct_time
raise InvalidValueException(f"Invalid value in {val} for area '{key}'")
custom_components.nordpool.aio_price.InvalidValueException: Invalid value in {'start': datetime.datetime(2024, 6, 25, 22, 0, tzinfo=<UTC>), 'end': datetime.datetime(2024, 6, 25, 23, 0, tzinfo=<UTC>), 'value': inf} for area 'LT'
2024-06-26 00:00:14.079 ERROR (MainThread) [homeassistant.util.logging] Exception in handle_new_day when dispatching 'nordpool_update_day': ()
Traceback (most recent call last):
File "/config/custom_components/nordpool/sensor.py", line 475, in handle_new_day
await self.handle_new_hr()
File "/config/custom_components/nordpool/sensor.py", line 480, in handle_new_hr
today = await self._api.today(self._area, self._currency)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/nordpool/__init__.py", line 124, in today
return await self._someday(area, currency, "today")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/nordpool/__init__.py", line 120, in _someday
return self._data.get(currency, {}).get(day, {}).get(area)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'get'
2024-06-26 01:00:00.214 ERROR (MainThread) [homeassistant.util.logging] Exception in handle_new_hr when dispatching 'nordpool_update_hour': ()
Traceback (most recent call last):
File "/config/custom_components/nordpool/sensor.py", line 480, in handle_new_hr
today = await self._api.today(self._area, self._currency)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/nordpool/__init__.py", line 124, in today
return await self._someday(area, currency, "today")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/nordpool/__init__.py", line 120, in _someday
return self._data.get(currency, {}).get(day, {}).get(area)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'get'
Same problem for me.
I have something similar happening. Also my utility providers spot price presentation doesn't work, same with the line company. So I assume Nordpool changed something in their api.
I assume there is something in the latest HA-update. I updated Home assistant core and OS and after that i didnt get any more prices from Nordpool
What zone are you guys in?
SE03
I had the same issue, it was a null value in the json response. Please try reloading the sensor
I had the same issue, it was a null value in the json response. Please try reloading the sensor
Sorry, but how do I reload the sensor?
Ill add the invalid value as something that should be retried later in the next release. It will be released this weekend
Using the reload sensor button in devices if you setup the sensor in the UI. If not you need to restart homeassistant
Using the reload sensor button in devices if you setup the sensor in the UI. If not you need to restart homeassistant
Thanks! Now I see prices again.
My sensor setup is in the config file as listed in the issue description. I used "RESTART" button from the HA Developer tools menu and it recovered the sensor.
Using the reload sensor button in devices if you setup the sensor in the UI. If not you need to restart homeassistant
I've used HA restart as my go to method previously when prices hasn't loaded. This time it didn't work at first but when rebooting the following day it did work. What was interesting was that neither EON nor Greenely had the day ahead prices in their apps and when looking at nordpool (20240625 after 1330) site they (20240626 prices) weren't there either.
Anybody knows what caused this?
Anybody knows what caused this?
Yes, one producer had problems to supply their bid 25.6.2024 and the day-ahead prices were late that day
https://www.epexspot.com/en/news/decoupling-session-was-run-according-procedures-single-day-ahead-coupling
Please test the new pre release.
I have tested 0.0.15b0 since it came out, without any problems. Core: 2024.6.4
Thanks
Thank you @Hellowlol, upgraded to the 0.0.15b0. Will close this issue after 1 week if no more errors are visible.
No more errors observed, closing the issue.