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

0.0.15.b1 tomorrows prices gone after restart #404

Open
dana-se opened this issue Sep 3, 2024 · 21 comments
Open

0.0.15.b1 tomorrows prices gone after restart #404

dana-se opened this issue Sep 3, 2024 · 21 comments

Comments

@dana-se
Copy link

dana-se commented Sep 3, 2024

Version of the custom_component

0.0.15.b1

Homeassistant version

HA 2024.8.3

Configuration

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

# Load frontend themes from the themes folder
frontend:
  themes: !include_dir_merge_named themes

automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml

template: !include_dir_merge_list templates



homeassistant:
  #packages: !include_dir_named packages
  customize: !include customize.yaml
  customize_glob: !include customize_glob.yaml
#template: !include_dir_merge_list templates
  packages:
    cheapest_hours: !include cheapest_hours_energy.yaml

recorder: 
  exclude:
    entity_globs: 
    - sensor.system_monitor*
    - sensor.*_power_factor
    entities:
      - sensor.diff_sp_hus
      - sensor.sma_power_now # modbus, see sma_power
      - sensor.sma_total_now # modbus, see sma_energy
  #include:
    #entities:

logger:
  logs:
    nordpool: debug
    custom_components.nordpool: debug
    custom_components.nordpool.sensor: debug
    custom_components.nordpool.aio_price: debug

Describe the bug

After restarting HA, tomorrows values are gone. Even after reloading the integration at 14:50.

Debug log

2024-09-03 14:29:03.878 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration spook which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2024-09-03 14:29:03.881 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration nordpool which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2024-09-03 14:29:03.884 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration hacs which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2024-09-03 14:29:03.886 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration spook_inverse which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2024-09-03 14:29:06.594 ERROR (MainThread) [homeassistant.helpers.translation] Validation of translation placeholders for localized (sv) string component.spook.issues.proximity_unknown_zone.description failed: ({'zone', 'entity_id', 'group'} != {'zone', 'name'})
2024-09-03 14:29:10.813 DEBUG (MainThread) [custom_components.nordpool] Added nordpool to hass.data
2024-09-03 14:29:10.819 DEBUG (MainThread) [custom_components.nordpool.sensor] Dumping config mappingproxy({'region': 'SE4', 'currency': 'SEK', 'VAT': False, 'precision': 3, 'low_price_cutoff': 1.0, 'price_in_cents': True, 'price_type': 'kWh', 'additional_costs': '{{0.0|float}}'})
2024-09-03 14:29:10.819 DEBUG (MainThread) [custom_components.nordpool.sensor] timezone set in ha 'Europe/Stockholm'
2024-09-03 14:29:10.820 DEBUG (MainThread) [custom_components.nordpool.sensor] Template {{0.0|float}}
2024-09-03 14:29:10.825 DEBUG (MainThread) [custom_components.nordpool.sensor] called async_added_to_hass nordpool_kwh_se4_sek_3_10_0
2024-09-03 14:29:10.826 DEBUG (MainThread) [custom_components.nordpool.sensor] handle_new_hr
2024-09-03 14:29:10.826 DEBUG (MainThread) [custom_components.nordpool] Updating today's prices.
2024-09-03 14:29:10.826 DEBUG (MainThread) [custom_components.nordpool] calling _update today None ['SE4']
2024-09-03 14:29:11.365 DEBUG (MainThread) [custom_components.nordpool.aio_price] requested https://www.nordpoolgroup.com/api/marketdata/page/10?currency=SEK&endDate=02-09-2024 {'currency': 'SEK', 'endDate': '02-09-2024'}
2024-09-03 14:29:11.619 DEBUG (MainThread) [custom_components.nordpool.aio_price] requested https://www.nordpoolgroup.com/api/marketdata/page/10?currency=SEK&endDate=04-09-2024 {'currency': 'SEK', 'endDate': '04-09-2024'}
2024-09-03 14:29:11.687 DEBUG (MainThread) [custom_components.nordpool.aio_price] requested https://www.nordpoolgroup.com/api/marketdata/page/10?currency=SEK&endDate=03-09-2024 {'currency': 'SEK', 'endDate': '03-09-2024'}
2024-09-03 14:29:12.477 DEBUG (MainThread) [custom_components.nordpool.sensor] handle_new_hr
2024-09-03 14:29:12.483 DEBUG (MainThread) [custom_components.nordpool.sensor] Updated nordpool_kwh_se4_sek_3_10_0 _current_price 849.05
2024-09-03 14:29:12.496 DEBUG (MainThread) [custom_components.nordpool.sensor] Updated nordpool_kwh_se4_sek_3_10_0 _current_price 849.05
2024-09-03 14:29:29.013 WARNING (MainThread) [homeassistant.components.sensor.helpers] sensor.cheapest_hours_energy rendered invalid timestamp: 
2024-09-03 14:29:29.799 WARNING (MainThread) [homeassistant.components.netatmo] Webhook not registered - https and port 443 is required to register the webhook
2024-09-03 14:50:16.948 DEBUG (MainThread) [custom_components.nordpool] Added nordpool to hass.data
2024-09-03 14:50:16.971 DEBUG (MainThread) [custom_components.nordpool.sensor] Dumping config mappingproxy({'region': 'SE4', 'currency': 'SEK', 'VAT': False, 'precision': 3, 'low_price_cutoff': 1.0, 'price_in_cents': True, 'price_type': 'kWh', 'additional_costs': '{{0.0|float}}'})
2024-09-03 14:50:16.972 DEBUG (MainThread) [custom_components.nordpool.sensor] timezone set in ha 'Europe/Stockholm'
2024-09-03 14:50:16.972 DEBUG (MainThread) [custom_components.nordpool.sensor] Template {{0.0|float}}
2024-09-03 14:50:16.973 DEBUG (MainThread) [custom_components.nordpool.sensor] called async_added_to_hass nordpool_kwh_se4_sek_3_10_0
2024-09-03 14:50:16.974 DEBUG (MainThread) [custom_components.nordpool.sensor] handle_new_hr
2024-09-03 14:50:16.974 DEBUG (MainThread) [custom_components.nordpool] Updating today's prices.
2024-09-03 14:50:16.974 DEBUG (MainThread) [custom_components.nordpool] calling _update today None ['SE4']
2024-09-03 14:50:17.507 DEBUG (MainThread) [custom_components.nordpool.aio_price] requested https://www.nordpoolgroup.com/api/marketdata/page/10?currency=SEK&endDate=04-09-2024 {'currency': 'SEK', 'endDate': '04-09-2024'}
2024-09-03 14:50:17.578 DEBUG (MainThread) [custom_components.nordpool.aio_price] requested https://www.nordpoolgroup.com/api/marketdata/page/10?currency=SEK&endDate=02-09-2024 {'currency': 'SEK', 'endDate': '02-09-2024'}
2024-09-03 14:50:17.722 DEBUG (MainThread) [custom_components.nordpool.aio_price] requested https://www.nordpoolgroup.com/api/marketdata/page/10?currency=SEK&endDate=03-09-2024 {'currency': 'SEK', 'endDate': '03-09-2024'}
2024-09-03 14:50:17.869 DEBUG (MainThread) [custom_components.nordpool.sensor] handle_new_hr
2024-09-03 14:50:17.873 DEBUG (MainThread) [custom_components.nordpool.sensor] Updated nordpool_kwh_se4_sek_3_10_0 _current_price 849.05
2024-09-03 14:50:17.875 DEBUG (MainThread) [custom_components.nordpool.sensor] handle_new_hr
2024-09-03 14:50:17.880 DEBUG (MainThread) [custom_components.nordpool.sensor] Updated nordpool_kwh_se4_sek_3_10_0 _current_price 849.05
2024-09-03 14:50:17.894 DEBUG (MainThread) [custom_components.nordpool.sensor] Updated nordpool_kwh_se4_sek_3_10_0 _current_price 849.05



@Dvun
Copy link

Dvun commented Sep 3, 2024

yes, for me also tomorrow prices is gone

@jammi
Copy link

jammi commented Sep 3, 2024

Same issue here. This commit probably explains it, since the feature was deleted: 46e66ba

@dana-se
Copy link
Author

dana-se commented Sep 4, 2024

Update:
2024-09-04 00:00:56 Exception in handle_new_day when dispatching 'nordpool_update_day.
So, at 02:00 I restarted HA, and todays values was back.

home-assistant.log

@Marko-112
Copy link

for me also tomorrow prices is gone

@jammi
Copy link

jammi commented Sep 4, 2024

The problem with missing "tomorrow" isn't just that you don't see the next day, it's that once the day changes to the tomorrow, there's no information, because the "today" becomes "yesterday" and there's no "tomorrow" to show for the ongoing day until it updates the data from the nordcloud api again either forced by a restart or perhaps afternoon next day. This also coincides with the highest peak hour prices in a long while.

@MusicmanP3
Copy link

Same issues here also.

@robertvandergiessen
Copy link

Same issue here.

@odelma
Copy link

odelma commented Sep 4, 2024

I have two sensors, one with VAT and the other without. Strangely the one without is missing tomorrow prices, the other sensor with VAT gets them. Could it be something related to VAT change in Finland? 🤔

@Hellowlol
Copy link
Collaborator

@odelma that is really weird. Can you provide logs? Anyway if you are having issues please downgrade

@odelma
Copy link

odelma commented Sep 5, 2024

Yes, weird. And now I noticed that the sensor that shows tomorrow’s prices still gets sort of stuck after midnight with last price from yesterday. For example it showed 0,46 after midnight until morning and only got new prices after reloading the integration.

I will try to downgrade and see what happens…

@MusicmanP3
Copy link

@odelma that is really weird. Can you provide logs? Anyway if you are having issues please downgrade

Downgrading did not help for me.. (2 days ago)
I have 3 (Finland) entities and non of them is fetching tomorrows prices. ("Tomorrow valid - false" under Attributes)
For testing I also tried out Sweden but same thing..

@odelma
Copy link

odelma commented Sep 5, 2024

To which version did you downgrade? I remember the last time I tried to upgrade (0.15xx 🤔) it did not load the integration at all at startup and going back to 0.14 did not help either. Once I downgraded to 0.13 it started working again…🤷‍♂️

@MusicmanP3
Copy link

Downgraded to 0.14

@dana-se
Copy link
Author

dana-se commented Sep 5, 2024

Or, if you are on 0.0.15b1, never restart HA, after tomorrow's values are available works for me.

@KennethLavrsen
Copy link

I see this too. Downgraded to 0.0.14 again. Errors in logs is preferred over not working.

@dana-se
Copy link
Author

dana-se commented Sep 5, 2024

@Hellowlol I'm a newbie here, so is there anything else I can do to help resolve this issue?

@Hellowlol
Copy link
Collaborator

The latest commit needs to be reverted. A part for that I’m not sure. Need to have time to debug it. Seems strange

@lindsand
Copy link

I'm on 0.0.14 and same situation, tomorrows prices are totally gone after HA restart today 2024-09-22 at 20:10 EEST (so UTC+03:00) and 'Tomorrow valid' i set to false. Restarting Nordpool doesn't help until the day has changed.
The interface is then fetching 'todays' values as 'tomorrow' is not available after midnight until new values are published.

So is restart only fetching 'todays' values and logic fails for 'tomorrow' until new values are published?

Attributes
Average 0.12
Off peak 1 0.1
Off peak 2 0.2
Peak 0.11
Min 0.04
Max 0.32
Mean 0.11
Unit kWh
Currency EUR
Country Finland
Region FI
Low price false
Price percent to average 1.18
Today
0.06, 0.1, 0.09, 0.09, 0.11, 0.12, 0.12, 0.12, 0.12, 0.13, 0.09, 0.05, 0.04, 0.07, 0.04, 0.04, 0.11, 0.16, 0.18, 0.31, 0.32, 0.19, 0.14, 0.13
Tomorrow
Tomorrow valid false
Raw today

  • start: '2024-09-22T00:00:00+03:00'
    end: '2024-09-22T01:00:00+03:00'
    value: 0.063
  • start: '2024-09-22T01:00:00+03:00'
    end: '2024-09-22T02:00:00+03:00'
    value: 0.095
  • start: '2024-09-22T02:00:00+03:00'
    end: '2024-09-22T03:00:00+03:00'
    value: 0.085
  • start: '2024-09-22T03:00:00+03:00'
    end: '2024-09-22T04:00:00+03:00'
    value: 0.085
  • start: '2024-09-22T04:00:00+03:00'
    end: '2024-09-22T05:00:00+03:00'
    value: 0.107
  • start: '2024-09-22T05:00:00+03:00'
    end: '2024-09-22T06:00:00+03:00'
    value: 0.115
  • start: '2024-09-22T06:00:00+03:00'
    end: '2024-09-22T07:00:00+03:00'
    value: 0.115
  • start: '2024-09-22T07:00:00+03:00'
    end: '2024-09-22T08:00:00+03:00'
    value: 0.119
  • start: '2024-09-22T08:00:00+03:00'
    end: '2024-09-22T09:00:00+03:00'
    value: 0.122
  • start: '2024-09-22T09:00:00+03:00'
    end: '2024-09-22T10:00:00+03:00'
    value: 0.129
  • start: '2024-09-22T10:00:00+03:00'
    end: '2024-09-22T11:00:00+03:00'
    value: 0.093
  • start: '2024-09-22T11:00:00+03:00'
    end: '2024-09-22T12:00:00+03:00'
    value: 0.046
  • start: '2024-09-22T12:00:00+03:00'
    end: '2024-09-22T13:00:00+03:00'
    value: 0.044
  • start: '2024-09-22T13:00:00+03:00'
    end: '2024-09-22T14:00:00+03:00'
    value: 0.066
  • start: '2024-09-22T14:00:00+03:00'
    end: '2024-09-22T15:00:00+03:00'
    value: 0.044
  • start: '2024-09-22T15:00:00+03:00'
    end: '2024-09-22T16:00:00+03:00'
    value: 0.041
  • start: '2024-09-22T16:00:00+03:00'
    end: '2024-09-22T17:00:00+03:00'
    value: 0.106
  • start: '2024-09-22T17:00:00+03:00'
    end: '2024-09-22T18:00:00+03:00'
    value: 0.163
  • start: '2024-09-22T18:00:00+03:00'
    end: '2024-09-22T19:00:00+03:00'
    value: 0.176
  • start: '2024-09-22T19:00:00+03:00'
    end: '2024-09-22T20:00:00+03:00'
    value: 0.314
  • start: '2024-09-22T20:00:00+03:00'
    end: '2024-09-22T21:00:00+03:00'
    value: 0.322
  • start: '2024-09-22T21:00:00+03:00'
    end: '2024-09-22T22:00:00+03:00'
    value: 0.188
  • start: '2024-09-22T22:00:00+03:00'
    end: '2024-09-22T23:00:00+03:00'
    value: 0.143
  • start: '2024-09-22T23:00:00+03:00'
    end: '2024-09-23T00:00:00+03:00'
    value: 0.127
    Raw tomorrow
    Current price 0.14
    Additional costs current hour 0
    Price in cents false

@lindsand
Copy link

Then it fails after midnight because there are no values for current day

Logger: homeassistant.util.logging
Source: util/logging.py:95
First occurred: 00:00:15 (11 occurrences)
Last logged: 09:51:13

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'

@lindsand
Copy link

A reload of nordpool integration now after midnight fetches the values for 2023-09-23 that were missing yesterday after HA restart. Tomorrow is not published yet, that will happen in the afternoon.

Average 0.08
Off peak 1 0.07
Off peak 2 0.02
Peak 0.1
Min 0.02
Max 0.17
Mean 0.08
Unit kWh
Currency EUR
Country Finland
Region FI
Low price false
Price percent to average 2.26
Today
0.09, 0.11, 0.09, 0.03, 0.03, 0.04, 0.06, 0.13, 0.17, 0.17, 0.13, 0.1, 0.08, 0.08, 0.09, 0.09, 0.08, 0.1, 0.05, 0.03, 0.02, 0.02, 0.02, 0.02
Tomorrow
Tomorrow valid
false
Raw today

  • start: '2024-09-23T00:00:00+03:00'
    end: '2024-09-23T01:00:00+03:00'
    value: 0.093
  • start: '2024-09-23T01:00:00+03:00'
    end: '2024-09-23T02:00:00+03:00'
    value: 0.114
  • start: '2024-09-23T02:00:00+03:00'
    end: '2024-09-23T03:00:00+03:00'
    value: 0.093
  • start: '2024-09-23T03:00:00+03:00'
    end: '2024-09-23T04:00:00+03:00'
    value: 0.034
  • start: '2024-09-23T04:00:00+03:00'
    end: '2024-09-23T05:00:00+03:00'
    value: 0.03
  • start: '2024-09-23T05:00:00+03:00'
    end: '2024-09-23T06:00:00+03:00'
    value: 0.035
  • start: '2024-09-23T06:00:00+03:00'
    end: '2024-09-23T07:00:00+03:00'
    value: 0.061
  • start: '2024-09-23T07:00:00+03:00'
    end: '2024-09-23T08:00:00+03:00'
    value: 0.129
  • start: '2024-09-23T08:00:00+03:00'
    end: '2024-09-23T09:00:00+03:00'
    value: 0.172
  • start: '2024-09-23T09:00:00+03:00'
    end: '2024-09-23T10:00:00+03:00'
    value: 0.173
  • start: '2024-09-23T10:00:00+03:00'
    end: '2024-09-23T11:00:00+03:00'
    value: 0.131
  • start: '2024-09-23T11:00:00+03:00'
    end: '2024-09-23T12:00:00+03:00'
    value: 0.101
  • start: '2024-09-23T12:00:00+03:00'
    end: '2024-09-23T13:00:00+03:00'
    value: 0.084
  • start: '2024-09-23T13:00:00+03:00'
    end: '2024-09-23T14:00:00+03:00'
    value: 0.081
  • start: '2024-09-23T14:00:00+03:00'
    end: '2024-09-23T15:00:00+03:00'
    value: 0.086
  • start: '2024-09-23T15:00:00+03:00'
    end: '2024-09-23T16:00:00+03:00'
    value: 0.093
  • start: '2024-09-23T16:00:00+03:00'
    end: '2024-09-23T17:00:00+03:00'
    value: 0.083
  • start: '2024-09-23T17:00:00+03:00'
    end: '2024-09-23T18:00:00+03:00'
    value: 0.095
  • start: '2024-09-23T18:00:00+03:00'
    end: '2024-09-23T19:00:00+03:00'
    value: 0.045
  • start: '2024-09-23T19:00:00+03:00'
    end: '2024-09-23T20:00:00+03:00'
    value: 0.027
  • start: '2024-09-23T20:00:00+03:00'
    end: '2024-09-23T21:00:00+03:00'
    value: 0.024
  • start: '2024-09-23T21:00:00+03:00'
    end: '2024-09-23T22:00:00+03:00'
    value: 0.021
  • start: '2024-09-23T22:00:00+03:00'
    end: '2024-09-23T23:00:00+03:00'
    value: 0.02
  • start: '2024-09-23T23:00:00+03:00'
    end: '2024-09-24T00:00:00+03:00'
    value: 0.016
    Raw tomorrow
    Current price
    0.17
    Additional costs current hour
    0
    Price in cents
    false

@jammi
Copy link

jammi commented Sep 24, 2024

Just to confirm that I've been running the past three weeks without issues by omitting this commit, where the try/catch exists for the exact scenario of no tomorrow when the time switches to the "old tomorrow" as the "current day" between midnight and availabality of a "new tomorrow" dataset the next afternoon: 46e66ba

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

10 participants