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

Version 0.0.14 does not load tomorrow’s prices #326

Closed
uphillbattle opened this issue May 27, 2023 · 50 comments · Fixed by #333
Closed

Version 0.0.14 does not load tomorrow’s prices #326

uphillbattle opened this issue May 27, 2023 · 50 comments · Fixed by #333

Comments

@uphillbattle
Copy link

Version of the custom_component

0.0.14

Homeassistant version

2023.5.3 and 2023.5.4

Configuration

UI config

Describe the bug

After updating to the latest version, the integration no longer loads tomorrow’s prices. I have to reload the integration to get next day’s prices.

Debug log

Nothing in the normal logs. I have activate debug logging now, will follow up in a comment if something pops up.

@jires
Copy link

jires commented May 27, 2023

Version 0.0.13 has same issue. It started yesterday. No updates performed since 2 weeks ago, so it have to be Noorpool api issue..

@developerfromjokela
Copy link
Contributor

Double check entity/device name. Mine changed for some reason.

@yozik04
Copy link

yozik04 commented May 27, 2023

It did not load yesterday prices for today. Today it failed to load tomorrow prices as well.

@Lemming16
Copy link

I'm having the same problem.
Only loads the prices after restart of HA.

@agrauballe
Copy link

Same isse for me. Only a HA restart loads tomorrow prices.

@ats57
Copy link

ats57 commented May 27, 2023

Or to reload integration manually.
I have a feeling that this is linked to latest HA core update.

@thaowl
Copy link

thaowl commented May 27, 2023

Once per hour in home-assistant.log
Reloading integration works.

--
2023-05-27 20:00:00.201 ERROR (MainThread) [homeassistant.util.logging] Exception in handle_new_hr when dispatching 'nordpool_update_hour': ()
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.10/statistics.py", line 329, in mean
T, total, count = _sum(data)
File "/usr/local/lib/python3.10/statistics.py", line 187, in _sum
T = _coerce(T, typ) # or raise TypeError
File "/usr/local/lib/python3.10/statistics.py", line 237, in _coerce
raise TypeError(msg % (T.name, S.name))
TypeError: don't know how to coerce float and NoneType

@Aephir
Copy link

Aephir commented May 27, 2023

I have a few additional exceptions

Here, inn case they are useful
Logger: homeassistant.util.logging
Source: util/logging.py:156
First occurred: 00:00:00 (23 occurrences)
Last logged: 20:00:00

Exception in handle_new_day when dispatching 'nordpool_update_day': () 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 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.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
Exception in handle_new_hr when dispatching 'nordpool_update_hour': () 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 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.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
Exception in handle_new_price when dispatching 'nordpool_update_new_price': () 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 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.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

@PetrolHead2
Copy link

There is some issue with the data from nordpool, your error msg indicates that some data is missing (NoneType). And it started 00:00 today.
I have some other issues with nordpool and missing data and that also started at midnight.

@PetrolHead2
Copy link

PetrolHead2 commented May 27, 2023

I had to manually change the sensor.py to get it to work:

def _update(self):
    """Set attrs"""
    today = self.today

    if not today:
        _LOGGER.debug("No data for today, unable to set attrs")
        return

    if not filter(None, today):
        _LOGGER.debug("No filtered data for today, unable to set attrs")
        return

    self._average = mean(filter(None, today))
    self._min = min(filter(None, today))
    self._max = max(filter(None, today))
    self._off_peak_1 = mean(filter(None, today[0:8]))
    self._off_peak_2 = mean(filter(None, today[20:]))
    self._peak = mean(filter(None, today[8:20]))
    self._mean = median(filter(None, today))

@Hellowlol
Copy link
Collaborator

Just do a restart

@boogieman1402
Copy link

This issue is likely because the prices on the spot market weren't established at the regular time today and yesterday (and once before, a few weeks ago). The nordpool integration appears to only try to fetch the prices once, randomly between 13:00 and 14:00 hours. Today, the prices for tomorrow were delayed by 3 hours for NL (see https://www.epexspot.com/en/market-data) :

[ExC_01]: Thresholds reached - Reopening of the order books

Dear Member,

Due to the exceeding of the predefined price thresholds, a Second Auction is triggered.

Consequently, the PX order books will be reopened at 12:50 for exactly 15 minutes.

Therefore, the publication of the Market Coupling Results is delayed.

Low prices are detected for:

  • The Netherlands (NL) on the following hours: 14,15 and 16

Disclaimer: The timings are expressed as CET timings.

Disclaimer for entering or modifying orders:

In case a Second Auction is triggered, an Exhange Member is authorized to adjust its orders according to the following rules:

a) For all hours(s) for which thresolds have been reached:

  • In case of low prices: add purchase volumes, remove sale volumes, increase the prices of the sell and/or purchase Orders;

b) For all hours(s) for which thresolds have not been reached:

  • Order modification is authorized if the Exchange Member can justify its intention to improve the situation of the markt Area >and hour(s) for which thresolds have been reached.

Please refer to the NEMO Operational Rules for other specific cases.

I suppose the best solution would be to add a periodic check every hour starting at 13: (the current logic) and repeating until valid date has been received.

@shadowano
Copy link

shadowano commented May 27, 2023

Or to reload integration manually. I have a feeling that this is linked to latest HA core update.

How do you reload a Hacs integration? Tried redownloading and restart HA without success, still no prices for today

@lovekull76
Copy link

IMG_1644

@lovekull76
Copy link

lovekull76 commented May 27, 2023

I do have the same problem since updating HA from 2023.4 to 2023.5 😕

@shadowano
Copy link

IMG_1644

I don't have the nordpool hacs integration visible in HA integration. I only see it in Hacs. It's not filtered away

@gulli1986
Copy link

Same problem with core 2023.5.4, looks like today's prices didn't load.

@Repsionu
Copy link
Contributor

How to reload integration when it is defined in configuration.yaml? Only restart?
Best, JR

@Hellowlol
Copy link
Collaborator

I will investigate and attempt to fix it today. Please provide debug logs.

@priiduonu
Copy link
Contributor

Same problem with 2023.4.6 - tomorrow's prices n/a. Maybe related to negative prices?

@boogieman1402
Copy link

Same problem with 2023.4.6 - tomorrow's prices n/a. Maybe related to negative prices?

#326 (comment)

Not the negative prices per se, but a delay in the markets (from how I'm interpreting it, because a balance could not be found at the first attempt, so repeat auctions were required) combined with just a single attempt from the sensor to fetch the prices.

@riksarchen
Copy link

Same issue here. Only restart of HA will solve the issue.

@StSaens
Copy link

StSaens commented May 28, 2023

Until a fix is in. Just auto restart the integration right after midnight (or whatever works for you)

@CrallH
Copy link

CrallH commented May 28, 2023

IMG_1644

I don't have the nordpool hacs integration visible in HA integration. I only see it in Hacs. It's not filtered away

Have you added it as an integration or do you still use the old yaml config?

@shadowano
Copy link

Yeah, I was using the config. I added it as an integration instead and that solved it. But the problem is not solved by reloading the integration, only by restarting HA

@ThePatricide
Copy link

ThePatricide commented May 29, 2023

Interestingly enough, even when I've restarted HA multiple times (using YAML config), still no prices for today show up. Yesterday this fixed the issue. I'll see if I can retrieve debug logging.
Edit: apparently the sensor name changed.

@Hellowlol
Copy link
Collaborator

@ThePatricide check if the sensor got a new name. Some of the settings are using in the entity id name. In the lastest release i merged a pr that changed back to the default vat thus changing the entity id for Finland

@amund7
Copy link

amund7 commented May 29, 2023

Log Details (ERROR)
Logger: homeassistant.util.logging
Source: util/logging.py:156
First occurred: May 27, 2023 at 00:00:00 (69 occurrences)
Last logged: 10:00:00

Exception in handle_new_day when dispatching 'nordpool_update_day': () 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 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.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
Exception in handle_new_hr when dispatching 'nordpool_update_hour': () 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 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.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
Exception in handle_new_price when dispatching 'nordpool_update_new_price': () 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 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.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

@Repsionu
Copy link
Contributor

Repsionu commented May 29, 2023

Do not know the cause, but after 3 days of misbehavior today tomorrow's prices automagically showed up :-) So it seems that the problem was on NPS side :-/ ?
Best, JR

@developerfromjokela
Copy link
Contributor

again - negative prices today - no updates for tomorrow

Logger: homeassistant.util.logging
Source: util/logging.py:156
First occurred: 00:00:00 (21 occurrences)
Last logged: 18:00:00

Exception in handle_new_day when dispatching 'nordpool_update_day': () Traceback (most recent call last): File "/home/homeassistant/.pyenv/versions/3.11.2/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 "/home/homeassistant/.homeassistant/custom_components/nordpool/sensor.py", line 475, in handle_new_day await self.handle_new_hr() 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 "/home/homeassistant/.pyenv/versions/3.11.2/lib/python3.11/statistics.py", line 430, in mean T, total, n = _sum(data) ^^^^^^^^^^ File "/home/homeassistant/.pyenv/versions/3.11.2/lib/python3.11/statistics.py", line 193, in _sum for n, d in map(_exact_ratio, values): File "/home/homeassistant/.pyenv/versions/3.11.2/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 "/home/homeassistant/.pyenv/versions/3.11.2/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 "/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 "/home/homeassistant/.pyenv/versions/3.11.2/lib/python3.11/statistics.py", line 430, in mean T, total, n = _sum(data) ^^^^^^^^^^ File "/home/homeassistant/.pyenv/versions/3.11.2/lib/python3.11/statistics.py", line 193, in _sum for n, d in map(_exact_ratio, values): File "/home/homeassistant/.pyenv/versions/3.11.2/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 "/home/homeassistant/.pyenv/versions/3.11.2/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 "/home/homeassistant/.homeassistant/custom_components/nordpool/sensor.py", line 506, in handle_new_price await self.handle_new_hr() 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 "/home/homeassistant/.pyenv/versions/3.11.2/lib/python3.11/statistics.py", line 430, in mean T, total, n = _sum(data) ^^^^^^^^^^ File "/home/homeassistant/.pyenv/versions/3.11.2/lib/python3.11/statistics.py", line 193, in _sum for n, d in map(_exact_ratio, values): File "/home/homeassistant/.pyenv/versions/3.11.2/lib/python3.11/statistics.py", line 330, in _exact_ratio raise TypeError(msg) TypeError: can't convert type 'NoneType' to numerator/denominator

Same happened in finland, tomorrow's prices didn't show up until i restarted HA

@priiduonu
Copy link
Contributor

@Hellowlol sorry, no logs for now. turned on debug and restarted HA, will collect logs next time.

viiru- pushed a commit to viiru-/nordpool that referenced this issue Jul 4, 2023
This happens if the first auction is unsuccessful.

Implemented by verifying that the data is valid (in
join_result_for_correct_time()) and raising an exception (which triggers
retry) if it isn't.

This fixes issue custom-components#326.
viiru- pushed a commit to viiru-/nordpool that referenced this issue Jul 5, 2023
viiru- pushed a commit to viiru-/nordpool that referenced this issue Jul 5, 2023
And this should fix the other side of issue custom-components#326 (the lack of retries if
data is not available at the usual polling time).
viiru- pushed a commit to viiru-/nordpool that referenced this issue Jul 6, 2023
viiru- pushed a commit to viiru-/nordpool that referenced this issue Jul 6, 2023
And this should fix the other side of issue custom-components#326 (the lack of retries if
data is not available at the usual polling time).
viiru- pushed a commit to viiru-/nordpool that referenced this issue Jul 6, 2023
viiru- pushed a commit to viiru-/nordpool that referenced this issue Jul 6, 2023
And this should fix the other side of issue custom-components#326 (the lack of retries if
data is not available at the usual polling time).
viiru- pushed a commit to viiru-/nordpool that referenced this issue Jul 6, 2023
viiru- pushed a commit to viiru-/nordpool that referenced this issue Jul 6, 2023
And this should fix the other side of issue custom-components#326 (the lack of retries if
data is not available at the usual polling time).
viiru- pushed a commit to viiru-/nordpool that referenced this issue Jul 6, 2023
And this should fix the other side of issue custom-components#326 (the lack of retries if
data is not available at the usual polling time).
viiru- pushed a commit to viiru-/nordpool that referenced this issue Jul 6, 2023
viiru- pushed a commit to viiru-/nordpool that referenced this issue Jul 6, 2023
And this should fix the other side of issue custom-components#326 (the lack of retries if
data is not available at the usual polling time).
viiru- pushed a commit to viiru-/nordpool that referenced this issue Jul 9, 2023
viiru- pushed a commit to viiru-/nordpool that referenced this issue Jul 9, 2023
And this should fix the other side of issue custom-components#326 (the lack of retries if
data is not available at the usual polling time).
@priiduonu
Copy link
Contributor

the prices for tomorrow were not updated today and there were the following log messages:

Logger: homeassistant.util.logging
Source: util/logging.py:156
First occurred: 00:00:00 (23 occurrences)
Last logged: 21:00:00

Exception in handle_new_day when dispatching 'nordpool_update_day': () Traceback (most recent call last): File "/home/homeassistant/.pyenv/versions/3.11.2/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 "/home/homeassistant/.homeassistant/custom_components/nordpool/sensor.py", line 475, in handle_new_day await self.handle_new_hr() 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 "/home/homeassistant/.pyenv/versions/3.11.2/lib/python3.11/statistics.py", line 430, in mean T, total, n = _sum(data) ^^^^^^^^^^ File "/home/homeassistant/.pyenv/versions/3.11.2/lib/python3.11/statistics.py", line 193, in _sum for n, d in map(_exact_ratio, values): File "/home/homeassistant/.pyenv/versions/3.11.2/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 "/home/homeassistant/.pyenv/versions/3.11.2/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 "/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 "/home/homeassistant/.pyenv/versions/3.11.2/lib/python3.11/statistics.py", line 430, in mean T, total, n = _sum(data) ^^^^^^^^^^ File "/home/homeassistant/.pyenv/versions/3.11.2/lib/python3.11/statistics.py", line 193, in _sum for n, d in map(_exact_ratio, values): File "/home/homeassistant/.pyenv/versions/3.11.2/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 "/home/homeassistant/.pyenv/versions/3.11.2/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 "/home/homeassistant/.homeassistant/custom_components/nordpool/sensor.py", line 506, in handle_new_price await self.handle_new_hr() 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 "/home/homeassistant/.pyenv/versions/3.11.2/lib/python3.11/statistics.py", line 430, in mean T, total, n = _sum(data) ^^^^^^^^^^ File "/home/homeassistant/.pyenv/versions/3.11.2/lib/python3.11/statistics.py", line 193, in _sum for n, d in map(_exact_ratio, values): File "/home/homeassistant/.pyenv/versions/3.11.2/lib/python3.11/statistics.py", line 330, in _exact_ratio raise TypeError(msg) TypeError: can't convert type 'NoneType' to numerator/denominator

viiru- pushed a commit to viiru-/nordpool that referenced this issue Jul 29, 2023
This happens if the first auction is unsuccessful.

Implemented by verifying that the data is valid (in
join_result_for_correct_time()) and raising an exception if it isn't.

This partially fixes issue custom-components#326.
@shadowano
Copy link

Sorry for commenting on a closed thread, but two times this week I had to reload the integration because prices were not automatically fetched for next day. Even after the new day started no data was visible, and around 02 in the night I reloaded the integration and prices appeared.

Seems like this issue is not solved, or maybe it is not published yet?

@agrauballe
Copy link

Sorry for commenting on a closed thread, but two times this week I had to reload the integration because prices were not automatically fetched for next day. Even after the new day started no data was visible, and around 02 in the night I reloaded the integration and prices appeared.

Seems like this issue is not solved, or maybe it is not published yet?

I noticed the same. Had to reload Saturday and today (Wednesday)

@lovekull76
Copy link

Same here, checked Nordpool and Tibber, they did not update until around 15.00 (UTC+1).

@jtfidje
Copy link
Contributor

jtfidje commented Nov 1, 2023 via email

@uphillbattle
Copy link
Author

uphillbattle commented Nov 2, 2023

Add these automations to your configurations. One automatically reloads the Nordpool integration after midnight if the tomorrow_valid flag has not been cleared, the other keeps reloading the integration every half hour after 13:00 if tomorrow_valid has not been set (if, for example, the prices are not publish on time. I've never had issues with the Nordpool prices after I set these up.

(Note: replace the sensor name in entity_id at the end of each automation and in the is_state_attr functions with the name of your Nordpool sensor.)

- id: reload_nordpool_after_midnight_if_tomorrow_not_removed
  alias: Reload Nordpool after midnight if tomorrow not removed
  trigger:
    platform: time
    at: '00:05:00'
  condition:
    - condition: template
      value_template: >
        {{ is_state_attr('sensor.nordpool_kwh_oslo_nok_4_10_025','tomorrow_valid', True) }}
  action:
    service: homeassistant.reload_config_entry
    data: {}
    target:
      entity_id: sensor.nordpool_kwh_oslo_nok_4_10_025

- id: reload_nordpool_after_13_hrs_if_tomorrow_not_valid
  alias: Reload Nordpool after 13 hrs if tomorrow not valid
  trigger:
    - platform: time_pattern
      minutes: 20
    - platform: time_pattern
      minutes: 50
  condition:
    - and:
      - condition: template
        value_template: >
          {{ is_state_attr('sensor.nordpool_kwh_oslo_nok_4_10_025','tomorrow_valid', False) }}
      - condition: template
        value_template: >
          {{ now().hour >= 13 }}
  action:
    service: homeassistant.reload_config_entry
    data: {}
    target:
      entity_id: sensor.nordpool_kwh_oslo_nok_4_10_025

@shadowano
Copy link

Add these automations to your configurations. One automatically reloads the Nordpool integration after midnight if the tomorrow_valid flag has not been cleared, the other keeps reloading the integration every half hour after 13:00 if tomorrow_valid has not been set (if, for example, the prices are not publish on time. I've never had issues with the Nordpool prices after I set these up.

(Note: replace the sensor name in entity_id at the end of each automation and in the is_state_attr functions with the name of your Nordpool sensor.)

- id: reload_nordpool_after_midnight_if_tomorrow_not_removed
  alias: Reload Nordpool after midnight if tomorrow not removed
  trigger:
    platform: time
    at: '00:05:00'
  condition:
    - condition: template
      value_template: >
        {{ is_state_attr('sensor.nordpool_kwh_oslo_nok_4_10_025','tomorrow_valid', True) }}
  action:
    service: homeassistant.reload_config_entry
    data: {}
    target:
      entity_id: sensor.nordpool_kwh_oslo_nok_4_10_025

- id: reload_nordpool_after_13_hrs_if_tomorrow_not_valid
  alias: Reload Nordpool after 13 hrs if tomorrow not valid
  trigger:
    - platform: time_pattern
      minutes: 20
    - platform: time_pattern
      minutes: 50
  condition:
    - and:
      - condition: template
        value_template: >
          {{ is_state_attr('sensor.nordpool_kwh_oslo_nok_4_10_025','tomorrow_valid', False) }}
      - condition: template
        value_template: >
          {{ now().hour >= 13 }}
  action:
    service: homeassistant.reload_config_entry
    data: {}
    target:
      entity_id: sensor.nordpool_kwh_oslo_nok_4_10_025

Thank you for this! I will test it later when I get time for it. Thanks for sharing

@StSaens
Copy link

StSaens commented Nov 2, 2023

Doesn’t seem to be an issue that’s hard to handle properly in the addon is it?

It’s a situation (=prices not available at a certain time) that obviously happens from time to time. So a re-check every random minutes until the prices have been received properly.

@Repsionu
Copy link
Contributor

Repsionu commented Nov 2, 2023

Ditto :-)

@JenusL
Copy link

JenusL commented Nov 7, 2023

@Hellowlol Maybe it's time to do a release with this fix so it gets out to the masses?

@JannikL87
Copy link

@Hellowlol, still alive? :-)

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

Successfully merging a pull request may close this issue.