custom-components / nordpool

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

NordPool integration stops updating after HA supervisor update #420

Closed mario-pranjic-statnett closed 2 weeks ago

mario-pranjic-statnett commented 1 month ago

Version of the custom_component

0.0.15

Homeassistant version

Core 2024.10.2 Supervisor 2024.10.2 Operating System 13.2 Frontend 20241002.3

Describe the bug

Every time HA supervisor updates, NordPool integration stops updating until HA is restarted. Is this something that can be fixed in this integration or it is related to HA itself?

Hellowlol commented 1 month ago

I have no idea. Where are the logs?

ForKicks2 commented 1 month ago

This is what I am getting as a log entry:

Logger: homeassistant.components.sensor
Source: helpers/entity_platform.py:361
integration: Sensor ([documentation](https://www.home-assistant.io/integrations/sensor), [issues](https://github.com/home-assistant/core/issues?q=is%3Aissue+is%3Aopen+label%3A%22integration%3A+sensor%22))
First occurred: 7:37:55 AM (2 occurrences)
Last logged: 7:39:09 AM

Error while setting up nordpool platform for sensor
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 361, in _async_setup_platform
    await asyncio.shield(awaitable)
  File "/config/custom_components/nordpool/sensor.py", line 129, in async_setup_entry
    _dry_setup(hass, config, async_add_devices)
  File "/config/custom_components/nordpool/sensor.py", line 104, in _dry_setup
    sensor = NordpoolSensor(
             ^^^^^^^^^^^^^^^
  File "/config/custom_components/nordpool/sensor.py", line 166, in __init__
    self._vat = _REGIONS[area][2]
                ~~~~~~~~^^^^^^
KeyError: 'Kr.sand'

Have minimum config in config yaml as stated in the README

argoso commented 1 month ago

Some how in my case there was sensor name was changed. was: sensor.nordpool_kwh_ee_eur_3_10_02 become: sensor.nordpool_kwh_ee_eur_3_10_022 So I changed this in my yaml files and it works again

dana-se commented 1 month ago

This is what I am getting as a log entry:

Logger: homeassistant.components.sensor
Source: helpers/entity_platform.py:361
integration: Sensor ([documentation](https://www.home-assistant.io/integrations/sensor), [issues](https://github.com/home-assistant/core/issues?q=is%3Aissue+is%3Aopen+label%3A%22integration%3A+sensor%22))
First occurred: 7:37:55 AM (2 occurrences)
Last logged: 7:39:09 AM

Error while setting up nordpool platform for sensor
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 361, in _async_setup_platform
    await asyncio.shield(awaitable)
  File "/config/custom_components/nordpool/sensor.py", line 129, in async_setup_entry
    _dry_setup(hass, config, async_add_devices)
  File "/config/custom_components/nordpool/sensor.py", line 104, in _dry_setup
    sensor = NordpoolSensor(
             ^^^^^^^^^^^^^^^
  File "/config/custom_components/nordpool/sensor.py", line 166, in __init__
    self._vat = _REGIONS[area][2]
                ~~~~~~~~^^^^^^
KeyError: 'Kr.sand'

Have minimum config in config yaml as stated in the README

The README file hasn't been updated for version 0.0.15 yet. But you can't use Kr.sand anymore, use NO1, NO2, NO3 or NO4 instead.

Or install the Nordpool Integration, where you have the choices, for regions etc. and can set the formulas that you want! But then you MUST delete the Nordpool code from your yaml!

Nordpool region map https://data.nordpoolgroup.com/map?deliveryDate=latest&currency=SEK&market=DayAhead&mapDataType=Price&resolution=60

dana-se commented 1 month ago

Some how in my case there was sensor name was changed. was: sensor.nordpool_kwh_ee_eur_3_10_02 become: sensor.nordpool_kwh_ee_eur_3_10_022 So I changed this in my yaml files and it works again.

To avoid this in the future, use the tip from the README; Tip: By default, the integration will create a device with the name nordpool__. It is recommended to rename the device and all its entities to nordpool. If you need to recreate your sensor (for example, to change the additional cost), all automations and dashboards keep working.

mortenx commented 1 month ago

what exactly needs to be renamed where? nord

argoso commented 1 month ago

what exactly needs to be renamed where?

This sensor does not working (not grabing any information). So renaiming sensor name does not make it work again. You can rename working sensor name and then use it in yours automations/graphs/etc

argoso commented 1 month ago

Some how in my case there was sensor name was changed. was: sensor.nordpool_kwh_ee_eur_3_10_02 become: sensor.nordpool_kwh_ee_eur_3_10_022 So I changed this in my yaml files and it works again.

To avoid this in the future, use the tip from the README; Tip: By default, the integration will create a device with the name nordpool__. It is recommended to rename the device and all its entities to nordpool. If you need to recreate your sensor (for example, to change the additional cost), all automations and dashboards keep working.

Thank's! Good to know.

mortenx commented 1 month ago

I got numbers back to work so that I uninstalled the new version and then I installed the 0.0,13 version and then updated to 0,014 version

argoso commented 1 month ago

I got numbers back to work so that I uninstalled the new version and then I installed the 0.0,13 version and then updated to 0,014 version

Actually I also use 0.014 not newest one, but HA is 2024.10.2.

rrooggiieerr commented 1 month ago

@dana-se gave the explanation why it's not working anymore, maybe you read over it

But you can't use Kr.sand anymore, use NO1, NO2, NO3 or NO4 instead.