nordpool icon indicating copy to clipboard operation
nordpool copied to clipboard

Not getting values from Nordpool after latest HA-Update

Open toMTen023 opened this issue 1 year ago • 7 comments

Version of the custom_component

Not sure if it is this version? MINIMUM_HA_VERSION = "2023.6.0"

Homeassistant version

Core 2024.6.4 Supervisor 2024.06.2 Operating System 12.4 Frontend 20240610.1

Configuration

# Loads default set of integrations. Do not remove.
default_config:

# Text to speech
tts:
  - platform: google_translate

  ######### SSL Inställningar ##########
http:
  ssl_certificate: /ssl/fullchain.pem
  ssl_key: /ssl/privkey.pem

##### YAML  file locations ###############
automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml
sensor: !include sensors.yaml

homeassistant:
  packages:
    car_heater: !include car_heater.yaml

## Describe the bug
Integration does not get any values from Nordpool after latest Home Assistant update.


## Debug log
Not sure what log you want but i getting some errors about Norpool integration in the log that since last HA update.

Log details (ERROR)
Logger: homeassistant.util.logging
Source: util/logging.py:95
First occurred: 00:00:00 (9 occurrences)
Last logged: 07: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

toMTen023 avatar Jun 26 '24 06:06 toMTen023

Same here stopped working

Logger: homeassistant.util.logging
Source: util/logging.py:95
First occurred: 4:04:49 PM (1 occurrences)
Last logged: 4:04:49 PM

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

MaBeniu avatar Jun 26 '24 13:06 MaBeniu

Count me in also.

DewGew avatar Jun 26 '24 13:06 DewGew

It’s probably some null value in the json response but I would t know as no one posted what is needed to debug. Please provide what zone your are trying to get data from?

Hellowlol avatar Jun 26 '24 14:06 Hellowlol

I'm in SE03.

toMTen023 avatar Jun 26 '24 15:06 toMTen023

Zone: NL

Erwiiinst avatar Jun 26 '24 15:06 Erwiiinst

Same for me. NL.

Logger: homeassistant.util.logging Source: util/logging.py:95 First occurred: 18:00:00 (4 occurrences) Last logged: 19:00:00

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

Swerfer avatar Jun 26 '24 17:06 Swerfer

Same here, no longer getting updates. Need to restart HA and then there is an update. However it will not update itself without a restart.

Zone: NL

arno-millenaar avatar Jun 27 '24 07:06 arno-millenaar

SE3, error logged every hour since 2024-06-26 00:00:00

2024-07-07 10:00:00.265 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 "/home/homeassistant/.homeassistant/custom_components/nordpool/sensor.py", line 492, in handle_new_hr self._update() File "/home/homeassistant/.homeassistant/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

rogerthn2019 avatar Jul 07 '24 08:07 rogerthn2019

Hi,

I'm able to reproduce this problem daily:

Zone: SE03

Reload the integration or restart Home assistant between midnight and before tomorrows prices has been published by Nordpool (00:00-13:00 Swedish time) and this error occurs, resulting in the sensor to become "unavailable". Do the same after tomorrows prices (13:00) has been published and it works fine.

Please also note that I have to reload the integration manually after 13:00 if it has been reloaded before 13:00, otherwise the sensor stays "unavailable". Seems like the regular 13.00 refresh of prices does not happen if it has failed once.

Once I have a successful refresh of prices then the integration keeps working. Usually until I restart Home Assistant before 13.00.

Currently on Home Assistant version 2024.8.3 but I have had this issue for a long time (can't remember when it started). At least 6 months.

Please let me know if I can provide any more information to help solve this issue.

ahinko avatar Aug 27 '24 18:08 ahinko

@Hellowlol , I've had similar issue reoccurring occasionally for about a month. I'm in EE region. From logs today:

Exception in handle_new_day when dispatching 'nordpool_update_day': () Traceback (most recent call last): File "/config/custom_components/nordpool/sensor.py", line 473, in handle_new_day await self.handle_new_hr() File "/config/custom_components/nordpool/sensor.py", line 478, in handle_new_hr today = await self._api.today(self._area, self._currency) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/nordpool/__init__.py", line 123, in today return await self._someday(area, currency, "today") ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/nordpool/__init__.py", line 119, in _someday return self._data.get(currency, {}).get(day, {}).get(area) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AttributeError: 'NoneType' object has no attribute 'get'
Exception in handle_new_hr when dispatching 'nordpool_update_hour': () Traceback (most recent call last): File "/config/custom_components/nordpool/sensor.py", line 478, in handle_new_hr today = await self._api.today(self._area, self._currency) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/nordpool/__init__.py", line 123, in today return await self._someday(area, currency, "today") ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/nordpool/__init__.py", line 119, in _someday return self._data.get(currency, {}).get(day, {}).get(area) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AttributeError: 'NoneType' object has no attribute 'get'

rene-neimann avatar Sep 30 '24 07:09 rene-neimann