nordpool icon indicating copy to clipboard operation
nordpool copied to clipboard

Error message on update attempt

Open romlisrl opened this issue 1 year ago • 3 comments

Configuration: HA 2023.6.3 Supervised Docker installation supervisor-2023.07.1 Integration manual install

Error: Periodically receive error message, assuming happens on update.

Logger: homeassistant.util.logging Source: util/logging.py:156 First occurred: 10:00:00 (14 occurrences) Last logged: 22:00:00

Exception in handle_new_hr when dispatching 'nordpool_update_hour': () Traceback (most recent call last): File "/usr/local/lib/python3.11/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.11/statistics.py", line 430, in mean T, total, n = _sum(data) ^^^^^^^^^^ File "/usr/local/lib/python3.11/statistics.py", line 193, in _sum for n, d in map(_exact_ratio, values): File "/usr/local/lib/python3.11/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.11/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.11/statistics.py", line 430, in mean T, total, n = _sum(data) ^^^^^^^^^^ File "/usr/local/lib/python3.11/statistics.py", line 193, in _sum for n, d in map(_exact_ratio, values): File "/usr/local/lib/python3.11/statistics.py", line 330, in _exact_ratio raise TypeError(msg) TypeError: can't convert type 'NoneType' to numerator/denominator

romlisrl avatar Jul 06 '23 19:07 romlisrl

There is s None value. Please provide what settings you use, currency, area etc. reload the sensor

Hellowlol avatar Jul 06 '23 20:07 Hellowlol

I have HA object nordpool_kwh_lv_eur_4_10_0. It’s difficult to remember initial setup configurations, I believe the region is LV and the currency is EUR. Is there a easy way to see configs for the integration?

romlisrl avatar Jul 07 '23 09:07 romlisrl

I found the same error in my logs, for 24 hours. During that time no price information was updated either. After that, it restored itself. I'm guessing some HTTP request sometimes fails, resulting in that None. I'll investigate some more and see if I can track it down further.

jypma avatar Oct 30 '23 07:10 jypma