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

exceptions, not updating randomly #352

Open
elektrinis opened this issue Nov 5, 2023 · 2 comments
Open

exceptions, not updating randomly #352

elektrinis opened this issue Nov 5, 2023 · 2 comments

Comments

@elektrinis
Copy link

Version of the custom_component

Latest

Homeassistant version

2023.10.1

Configuration

LT, eur, no vat

Describe the bug

I have two devices fow raw price and full price incl. all fees. Almost every day at least one of them fails to update. Was working fine, started few days back.

Debug log


Logger: homeassistant.util.logging
Source: util/logging.py:116
First occurred: November 2, 2023 at 00:00:00 (208 occurrences)
Last logged: 19:19:54

Exception in handle_new_day when dispatching 'nordpool_update_day': () 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 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.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_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

@elektrinis
Copy link
Author

elektrinis commented Nov 6, 2023

The result in graphs below.
Works well when integration is reloaded, for that moment.

I'm so tired of maintaining my HA due to many issues like this. What would be the suggestion to automate this? Like, to reload when it goes down etc? Perhaps someone could share their automation script?

Screenshot_20231106-080221

@enedberg
Copy link

enedberg commented Dec 6, 2023

I have the same issue.

Added another device for full price and after that there has been problem updating one or the other almost every day. Reloading the integration gets new prices.

Just enabled debug logging to see what it shows on next update.

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

2 participants