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

Prices not always updated after day change #178

Closed
Floppe opened this issue Aug 9, 2022 · 5 comments
Closed

Prices not always updated after day change #178

Floppe opened this issue Aug 9, 2022 · 5 comments

Comments

@Floppe
Copy link

Floppe commented Aug 9, 2022

Version of the custom_component

0.0.7

Homeassistant version

2022.7.4

Describe the bug

Sometime when day changes then the prices are not updated. Have started to happen more frequent these days.

This is logged every hour until I restart HA and it starts to work again.

Debug log

2022-08-09 09:00:00 ERROR (MainThread) [homeassistant.util.logging] Exception in check_stuff when dispatching 'nordpool_update': ()
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/statistics.py", line 258, 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 460, in check_stuff
    self._update(self._data_today)
  File "/config/custom_components/nordpool/sensor.py", line 314, in _update
    self._peak = mean(peak)
  File "/usr/local/lib/python3.10/statistics.py", line 329, in mean
    T, total, count = _sum(data)
  File "/usr/local/lib/python3.10/statistics.py", line 188, in _sum
    for n, d in map(_exact_ratio, values):
  File "/usr/local/lib/python3.10/statistics.py", line 261, in _exact_ratio
    raise TypeError(msg)
TypeError: can't convert type 'NoneType' to numerator/denominator

Perhaps related to #127 ?

@petepalm
Copy link

petepalm commented Aug 10, 2022

I've had the same problem for about a week.
Tried to reinstall too but with no luck.

edit: Thinking that could be same issue as #125

@sippe2
Copy link

sippe2 commented Aug 31, 2022

Same problem here

@PeterAndreS
Copy link

At midnight, there are only (wrong) values ​​for the first hour for both days. The rest of the fields are empty. A restart of HA is required.

@jpulakka
Copy link

This is very likely closely related to #125 which has apparently been fixed in #127 almost half year ago but somehow that fix has still not been merged to master.

One approach could be just using https://github.com/custom-components/nordpool/tree/fix-1 branch until it gets merged.

@PeterAndreS
Copy link

Fixed for me in: Home Assistant 2022.10.1

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

6 participants