Stopped working
Worked like a charm, stopped working last night my guess is due to changes in Nordpools website
Issues not containing the minimum requirements will be closed:
- worked like a charm without issues until last evening, used my browser and try accessing nordpool and they state that the data is moved.
Tried reloading the integration? Mine still works
Mine worked fine until midnight, since then no updates until manual reset at 4 pm.
Ok, well nothing usefull in the issue to debug the problem. Please provide the required info
Only logs I have available, I guess, are here (country FI):
`Traceback (most recent call last): File "/config/custom_components/nordpool/sensor.py", line 492, in handle_new_hr self._update() File "/config/custom_components/nordpool/sensor.py", line 340, in _update self._average = mean(today) ^^^^^^^^^^^ File "/usr/local/lib/python3.12/statistics.py", line 484, in mean T, total, n = _sum(data) ^^^^^^^^^^ File "/usr/local/lib/python3.12/statistics.py", line 193, in _sum for n, d in map(_exact_ratio, values): File "/usr/local/lib/python3.12/statistics.py", line 330, in _exact_ratio raise TypeError(msg) TypeError: can't convert type 'NoneType' to numerator/denominator
2024-02-18 15:00:00.090 ERROR (MainThread) [homeassistant.util.logging] Exception in handle_new_hr when dispatching 'nordpool_update_hour': () Traceback (most recent call last): File "/usr/local/lib/python3.12/statistics.py", line 327, in _exact_ratio return (x.numerator, x.denominator) ^^^^^^^^^^^ AttributeError: 'NoneType' object has no attribute 'numerator'
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "/config/custom_components/nordpool/sensor.py", line 492, in handle_new_hr self._update() File "/config/custom_components/nordpool/sensor.py", line 340, in _update self._average = mean(today) ^^^^^^^^^^^ File "/usr/local/lib/python3.12/statistics.py", line 484, in mean T, total, n = _sum(data) ^^^^^^^^^^ File "/usr/local/lib/python3.12/statistics.py", line 193, in _sum for n, d in map(_exact_ratio, values): File "/usr/local/lib/python3.12/statistics.py", line 330, in _exact_ratio raise TypeError(msg) TypeError: can't convert type 'NoneType' to numerator/denominator
2024-02-18 16:00:00.091 ERROR (MainThread) [homeassistant.util.logging] Exception in handle_new_hr when dispatching 'nordpool_update_hour': () Traceback (most recent call last): File "/usr/local/lib/python3.12/statistics.py", line 327, in _exact_ratio return (x.numerator, x.denominator) ^^^^^^^^^^^ AttributeError: 'NoneType' object has no attribute 'numerator'
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "/config/custom_components/nordpool/sensor.py", line 492, in handle_new_hr self._update() File "/config/custom_components/nordpool/sensor.py", line 340, in _update self._average = mean(today) ^^^^^^^^^^^ File "/usr/local/lib/python3.12/statistics.py", line 484, in mean T, total, n = _sum(data) ^^^^^^^^^^ File "/usr/local/lib/python3.12/statistics.py", line 193, in _sum for n, d in map(_exact_ratio, values): File "/usr/local/lib/python3.12/statistics.py", line 330, in _exact_ratio raise TypeError(msg) TypeError: can't convert type 'NoneType' to numerator/denominator`
What files more can configuration.yaml shall i upload?
Skickat från Outlook för Androidhttps://aka.ms/AAb9ysg
From: Steffen Fredriksen @.> Sent: Sunday, February 18, 2024 5:58:26 PM To: custom-components/nordpool @.> Cc: ejansson88 @.>; Author @.> Subject: Re: [custom-components/nordpool] Stopped working (Issue #372)
Ok, well nothing usefull in the issue to debug the problem. Please provide the required info
— Reply to this email directly, view it on GitHubhttps://github.com/custom-components/nordpool/issues/372#issuecomment-1951385027, or unsubscribehttps://github.com/notifications/unsubscribe-auth/A3BOJUUZB4YB6QOGRYLS2Y3YUIXLFAVCNFSM6AAAAABDOIYTR6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNJRGM4DKMBSG4. You are receiving this because you authored the thread.Message ID: @.***>
Enable debug logging grab the url that was used to parse the data.
same here stopped working yesterday it seems.
@sazern what region?
@sazern what region?
SE3
I reloaded it and now it seems to work again
Reloaded. Still not working completely. Logger: homeassistant.util.logging Source: util/logging.py:102 First occurred: 00.00.00 (24 occurrences) Last logged: 20.00.00
Exception in handle_new_day when dispatching 'nordpool_update_day': () Traceback (most recent call last): File "/usr/local/lib/python3.12/statistics.py", line 327, in _exact_ratio return (x.numerator, x.denominator) ^^^^^^^^^^^ AttributeError: 'NoneType' object has no attribute 'numerator' During handling of the above exception, another exception occurred: 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 492, in handle_new_hr self._update() File "/config/custom_components/nordpool/sensor.py", line 340, in _update self._average = mean(today) ^^^^^^^^^^^ File "/usr/local/lib/python3.12/statistics.py", line 484, in mean T, total, n = _sum(data) ^^^^^^^^^^ File "/usr/local/lib/python3.12/statistics.py", line 193, in _sum for n, d in map(_exact_ratio, values): File "/usr/local/lib/python3.12/statistics.py", line 330, in _exact_ratio raise TypeError(msg) TypeError: can't convert type 'NoneType' to numerator/denominator Exception in handle_new_hr when dispatching 'nordpool_update_hour': () Traceback (most recent call last): File "/usr/local/lib/python3.12/statistics.py", line 327, in _exact_ratio return (x.numerator, x.denominator) ^^^^^^^^^^^ AttributeError: 'NoneType' object has no attribute 'numerator' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/config/custom_components/nordpool/sensor.py", line 492, in handle_new_hr self._update() File "/config/custom_components/nordpool/sensor.py", line 340, in _update self._average = mean(today) ^^^^^^^^^^^ File "/usr/local/lib/python3.12/statistics.py", line 484, in mean T, total, n = _sum(data) ^^^^^^^^^^ File "/usr/local/lib/python3.12/statistics.py", line 193, in _sum for n, d in map(_exact_ratio, values): File "/usr/local/lib/python3.12/statistics.py", line 330, in _exact_ratio raise TypeError(msg) TypeError: can't convert type 'NoneType' to numerator/denominator Exception in handle_new_price when dispatching 'nordpool_update_new_price': () Traceback (most recent call last): File "/usr/local/lib/python3.12/statistics.py", line 327, in _exact_ratio return (x.numerator, x.denominator) ^^^^^^^^^^^ AttributeError: 'NoneType' object has no attribute 'numerator' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/config/custom_components/nordpool/sensor.py", line 506, in handle_new_price await self.handle_new_hr() File "/config/custom_components/nordpool/sensor.py", line 492, in handle_new_hr self._update() File "/config/custom_components/nordpool/sensor.py", line 340, in _update self._average = mean(today) ^^^^^^^^^^^ File "/usr/local/lib/python3.12/statistics.py", line 484, in mean T, total, n = _sum(data) ^^^^^^^^^^ File "/usr/local/lib/python3.12/statistics.py", line 193, in _sum for n, d in map(_exact_ratio, values): File "/usr/local/lib/python3.12/statistics.py", line 330, in _exact_ratio raise TypeError(msg) TypeError: can't convert type 'NoneType' to numerator/denominator
@quenthal what zone is this? Seems like there is a null value in the prices
@quenthal what zone is this? Seems like there is a null value in the prices
FI(nland). This started either today or yesterday.
For quick fix, I made automation to reload the integration. Looking at the attributes, it seems that all values for today and tomorrow are there, but error logs like I copy&pasted keep coming in.
Same issue on 2 different instances: Have tried reload and re installed. No Change.
Sweden, SE3 area.
Logger: homeassistant.util.logging Source: util/logging.py:102 First occurred: 12:00:00 AM (50 occurrences) Last logged: 8:32:34 PM
Exception in handle_new_day when dispatching 'nordpool_update_day': () Traceback (most recent call last): File "/usr/local/lib/python3.12/statistics.py", line 327, in _exact_ratio return (x.numerator, x.denominator) ^^^^^^^^^^^ AttributeError: 'NoneType' object has no attribute 'numerator' During handling of the above exception, another exception occurred: 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 492, in handle_new_hr self._update() File "/config/custom_components/nordpool/sensor.py", line 340, in _update self._average = mean(today) ^^^^^^^^^^^ File "/usr/local/lib/python3.12/statistics.py", line 484, in mean T, total, n = _sum(data) ^^^^^^^^^^ File "/usr/local/lib/python3.12/statistics.py", line 193, in _sum for n, d in map(_exact_ratio, values): File "/usr/local/lib/python3.12/statistics.py", line 330, in _exact_ratio raise TypeError(msg) TypeError: can't convert type 'NoneType' to numerator/denominator Exception in handle_new_hr when dispatching 'nordpool_update_hour': () Traceback (most recent call last): File "/usr/local/lib/python3.12/statistics.py", line 327, in _exact_ratio return (x.numerator, x.denominator) ^^^^^^^^^^^ AttributeError: 'NoneType' object has no attribute 'numerator' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/config/custom_components/nordpool/sensor.py", line 492, in handle_new_hr self._update() File "/config/custom_components/nordpool/sensor.py", line 340, in _update self._average = mean(today) ^^^^^^^^^^^ File "/usr/local/lib/python3.12/statistics.py", line 484, in mean T, total, n = _sum(data) ^^^^^^^^^^ File "/usr/local/lib/python3.12/statistics.py", line 193, in _sum for n, d in map(_exact_ratio, values): File "/usr/local/lib/python3.12/statistics.py", line 330, in _exact_ratio raise TypeError(msg) TypeError: can't convert type 'NoneType' to numerator/denominator Exception in handle_new_price when dispatching 'nordpool_update_new_price': () Traceback (most recent call last): File "/usr/local/lib/python3.12/statistics.py", line 327, in _exact_ratio return (x.numerator, x.denominator) ^^^^^^^^^^^ AttributeError: 'NoneType' object has no attribute 'numerator' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/config/custom_components/nordpool/sensor.py", line 506, in handle_new_price await self.handle_new_hr() File "/config/custom_components/nordpool/sensor.py", line 492, in handle_new_hr self._update() File "/config/custom_components/nordpool/sensor.py", line 340, in _update self._average = mean(today) ^^^^^^^^^^^ File "/usr/local/lib/python3.12/statistics.py", line 484, in mean T, total, n = _sum(data) ^^^^^^^^^^ File "/usr/local/lib/python3.12/statistics.py", line 193, in _sum for n, d in map(_exact_ratio, values): File "/usr/local/lib/python3.12/statistics.py", line 330, in _exact_ratio raise TypeError(msg) TypeError: can't convert type 'NoneType' to numerator/denominator
I still have the same issue. The old sensor is gone, the device is there but no sensor. I have added new device, making a new sensor with a digit increased by one. But needs manual reloading every day
After a HA restart this intgration fails to start
Error adding entity sensor.nordpool_kwh for domain sensor with platform nordpool Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 576, in _async_add_entities await coro File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 865, in _async_add_entity await entity.add_to_platform_finish() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1327, in add_to_platform_finish await self.async_added_to_hass() File "/config/custom_components/nordpool/sensor.py", line 518, in async_added_to_hass 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 110, in today return await self._someday(area, currency, "today") ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/nordpool/init.py", line 99, in _someday await self.update_today(None) File "/config/custom_components/nordpool/init.py", line 80, in update_today await self._update("today") File "/config/custom_components/nordpool/init.py", line 73, in _update data = await spot.hourly(end_date=dt) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/nordpool/aio_price.py", line 228, 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 217, in fetch res = await asyncio.gather(*jobs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/nordpool/aio_price.py", line 174, in _fetch_json return await self._io( ^^^^^^^^^^^^^^^ File "/config/custom_components/nordpool/aio_price.py", line 160, in _io resp = await self.client.get(url, params=kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/aiohttp/client.py", line 605, in _request await resp.start(conn) File "/usr/local/lib/python3.12/site-packages/aiohttp/client_reqrep.py", line 961, in start with self._timer: File "/usr/local/lib/python3.12/site-packages/aiohttp/helpers.py", line 735, in exit raise asyncio.TimeoutError from None TimeoutError
Seems like Nordpool has changed their API to a new host https://data.nordpoolgroup.com and integration doesn't seem to work anymore. Does any other service work with minimal change to code? Still looking into it, but my Python skills are very much lacking...
@Lrputola please reload the integration and see if it still works. The issue was in related and willbe closed
Thanks, yes. After 3 hours past publishing and multiple restarts it suddenly started to work.