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

Nordpool sensor is empty - "Error adding entities for domain sensor with platform nordpool" #70

Closed
TheArcturian opened this issue Apr 14, 2021 · 9 comments

Comments

@TheArcturian
Copy link

I get this error this afternoon:

`Logger: homeassistant.components.sensor
Source: custom_components/nordpool/aio_price.py:255
Integration: Sensor (documentation, issues)
First occurred: 6:36:55 PM (2 occurrences)
Last logged: 6:36:55 PM

Error adding entities for domain sensor with platform nordpool
Error while setting up nordpool platform for sensor
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 322, in async_add_entities
await asyncio.gather(*tasks)
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 514, in _async_add_entity
await entity.add_to_platform_finish()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 546, in add_to_platform_finish
await self.async_added_to_hass()
File "/config/custom_components/nordpool/sensor.py", line 485, in async_added_to_hass
await self.check_stuff()
File "/config/custom_components/nordpool/sensor.py", line 443, in check_stuff
today = await self._api.today(self._area, self._currency)
File "/config/custom_components/nordpool/init.py", line 107, in today
res = await self._someday(area, currency, "today")
File "/config/custom_components/nordpool/init.py", line 97, in _someday
await self.update_today(None)
File "/config/custom_components/nordpool/init.py", line 78, in update_today
await self._update("today")
File "/config/custom_components/nordpool/init.py", line 69, in _update
data = await spot.hourly(end_date=dt)
File "/config/custom_components/nordpool/aio_price.py", line 260, in hourly
return await self.fetch(self.HOURLY, end_date, areas)
File "/config/custom_components/nordpool/aio_price.py", line 255, in fetch
raw = [self._parse_json(i, areas) for i in res]
File "/config/custom_components/nordpool/aio_price.py", line 255, in
raw = [self._parse_json(i, areas) for i in res]
File "/usr/local/lib/python3.8/site-packages/nordpool/elspot.py", line 41, in _parse_json
raise CurrencyMismatch
nordpool.base.CurrencyMismatch
`

It has worked fine until now. When I check the sensor, it does not have any values. It seems like it cant get any information from the nordpool internet source.

@Hellowlol
Copy link
Collaborator

Hellowlol commented Apr 14, 2021

What currency are you using and price zone? Please use the issue template, it’s there for a reason.

@TomTorger
Copy link

TomTorger commented Apr 14, 2021

I get the same error. Sensor config:

- platform: nordpool
  VAT: True
  currency: "NOK"
  region: "Oslo"
  precision: 3 
  price_type: kWh

Failed at about 19.00 CET on several platforms (2 x rpi4 + 1 x nuc i5).

@Hellowlol
Copy link
Collaborator

Seems like a nordpool issue. The site also just list the prices in EUR.

@TomTorger
Copy link

Yup, found the bug reported in the underlying package:
kipe/nordpool#21

@oivindklausen
Copy link

I see the same issue. Is it related to the Nordpool Currency (EUR) issue ?. For some people it seems to work, for others it still fails after several restarts. When it works there is a Warning in the log that the Integrations takes too long time to setup. "Please contact the developer of the integration"

@Hellowlol
Copy link
Collaborator

Hellowlol commented Apr 16, 2021

@oivindklausen I dont know. My sensor work just fine, the problem is that the data from nordpool dont return the correct currency (some times?). So instead of returning the incorrect currency a exception is raised. About the setup is slow depends on how quick the nordpool api responds.

@Hellowlol
Copy link
Collaborator

@oivindklausen Can you share you nordpool settings?

@oivindklausen
Copy link

The integration is only setup from the GUI. These are the current States Attributes (When the integration is working). I think the unit was øre/kWh when it was not working. However, I have not touched these settings and the Integration has been rock solid until the now. After several restarts (Yesterday and Today) both my installations now seems to work. (Home Assistant OS 5.13, core-2021.4.4, supervisor-2021.04.0). This issue has also been discussed in the Norwegain Facebook group.

current_price: 44.867
average: 52.353
off peak 1: 54.78
off peak 2: 47.189
peak: 49.416
min: 44.867
max: 94.287
unit: kWh
currency: NOK
country: Norway
region: Oslo
low price: true
tomorrow_valid: true
today:

  • 47.953
  • 48.657

@Hellowlol
Copy link
Collaborator

Hellowlol commented Apr 16, 2021

What facebook group? I’m Norwegian I’m a member of many smart house groups. Thanks for the example

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

4 participants