custom-components / nordpool

This component allows you to pull in the energy prices into Home-Assistant.
442 stars 104 forks source link

0.0.15.b1 tomorrows prices gone after restart #404

Open dana-se opened 1 week ago

dana-se commented 1 week ago

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 commented 1 week ago

yes, for me also tomorrow prices is gone

jammi commented 1 week ago

Same issue here.

dana-se commented 1 week ago

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 commented 1 week ago

for me also tomorrow prices is gone

jammi commented 1 week ago

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 commented 1 week ago

Same issues here also.

robertvandergiessen commented 1 week ago

Same issue here.

odelma commented 1 week ago

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 commented 1 week ago

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

odelma commented 1 week ago

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 commented 1 week ago

@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 commented 1 week ago

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 commented 1 week ago

Downgraded to 0.14

dana-se commented 1 week ago

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

KennethLavrsen commented 1 week ago

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

dana-se commented 1 week ago

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

Hellowlol commented 1 week ago

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