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

Error message on update attempt #335

Open
romlisrl opened this issue Jul 6, 2023 · 3 comments
Open

Error message on update attempt #335

romlisrl opened this issue Jul 6, 2023 · 3 comments

Comments

@romlisrl
Copy link

romlisrl commented Jul 6, 2023

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

@Hellowlol
Copy link
Collaborator

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

@romlisrl
Copy link
Author

romlisrl commented Jul 7, 2023

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?

@jypma
Copy link

jypma commented Oct 30, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants