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

Missing data from today, found errors in logs from past few days #300

Closed
havardthom opened this issue Mar 17, 2023 · 11 comments
Closed

Missing data from today, found errors in logs from past few days #300

havardthom opened this issue Mar 17, 2023 · 11 comments

Comments

@havardthom
Copy link

Version of the custom_component

0.0.11

Homeassistant version

Home Assistant 2022.12.8
Supervisor 2023.03.1
Operating System 9.4
Grensesnitt 20221213.1 – latest

Configuration

nordpool:

sensor:
  - platform: nordpool
    VAT: True
    low_price_cutoff: 0.95
    region: "Oslo"
    precision: 3 
    price_type: kWh
    friendly_name: "Strømpris"

    # This option allows the usage of a template to add a tariff.
    # now() always refers start of the hour of that price.
    # this way we can calculate the correct costs add that to graphs etc.
    # The price result of the tariff expects this additional cost to be in kWh and not cents.
    # default {{0.0}}
    additional_costs: "{{0.448}}"

Describe the bug

Missing data from nordpool today, checked home assistant logs and found some errors.

image

Debug log

Logger: homeassistant.util.logging
Source: util/logging.py:156
First occurred: 15. mars 2023 kl. 00:01:06 (45 occurrences)
Last logged: 17:00:00

Exception in handle_new_day when dispatching 'nordpool_update_day': () Traceback (most recent call last): File "/config/custom_components/nordpool/sensor.py", line 478, in handle_new_day await self.handle_new_hr() File "/config/custom_components/nordpool/sensor.py", line 483, in handle_new_hr today = await self._api.today(self._area, self._currency) File "/config/custom_components/nordpool/__init__.py", line 113, in today res = await self._someday(area, currency, "today") File "/config/custom_components/nordpool/__init__.py", line 109, 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 483, in handle_new_hr today = await self._api.today(self._area, self._currency) File "/config/custom_components/nordpool/__init__.py", line 113, in today res = await self._someday(area, currency, "today") File "/config/custom_components/nordpool/__init__.py", line 109, in _someday return self._data.get(currency, {}).get(day, {}).get(area) AttributeError: 'NoneType' object has no attribute 'get'
Exception in handle_new_price when dispatching 'nordpool_update_new_price': () Traceback (most recent call last): File "/config/custom_components/nordpool/sensor.py", line 509, in handle_new_price await self.handle_new_hr() File "/config/custom_components/nordpool/sensor.py", line 483, in handle_new_hr today = await self._api.today(self._area, self._currency) File "/config/custom_components/nordpool/__init__.py", line 113, in today res = await self._someday(area, currency, "today") File "/config/custom_components/nordpool/__init__.py", line 109, in _someday return self._data.get(currency, {}).get(day, {}).get(area) AttributeError: 'NoneType' object has no attribute 'get'
@havardthom
Copy link
Author

Prices are back today. Still there are exceptions happening regularly.

First occurred: 15. mars 2023 kl. 00:01:06 (52 occurrences)
Last logged: 00:00:00

@Hellowlol
Copy link
Collaborator

Do you have multiple np sensors? Can you turn on debug logging and post the log if it happens again?

@jpeltoniemi
Copy link

I had the same issue. I have 2 sensors - one in EUR for automations and one in cents for displaying in a chart. The first one became unavailable today and I fixed it by reloading the integration. I have no other information for now.

@Hellowlol
Copy link
Collaborator

Please provide logs

@jpeltoniemi
Copy link

I've had debug logging on for a week now but haven't seen much details in the logs. Here are a couple of repeating errors

2023-04-02 11:34:05.589 ERROR (MainThread) [homeassistant.components.sensor] Platform nordpool does not generate unique IDs. ID nordpool_kwh_fi_eur_3_10_01 already exists - ignoring sensor.nordpool_kwh_fi_eur_3_10_01
2023-04-02 11:35:40.193 ERROR (MainThread) [homeassistant.components.sensor] Platform nordpool does not generate unique IDs. ID nordpool_kwh_fi_eur_3_10_01 already exists - ignoring sensor.nordpool_kwh_fi_eur_3_10_01

2023-04-12 00:00:00.469 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/config/custom_components/nordpool/__init__.py", line 131, in new_day_cb
if not api._data[curr]["tomorrow"]:
KeyError: 'tomorrow'
2023-04-12 00:00:10.263 WARNING (MainThread) [homeassistant.components.sensor] Setup of sensor platform nordpool is taking over 10 seconds.

@shadowano
Copy link

I had the same problem yesterday and today. I solved it by rebooting my system completely, and I got price information for today and tomorrow.

@jpeltoniemi
Copy link

@shadowano Reloading the integration should also have the same effect.

@Hellowlol
Copy link
Collaborator

@jpeltoniemi can you provide the logs related to the nordpool integration? I need the debug log not only the errors. A key error is easy to fix, but it should never had been set to None in the frist place. I need to see what the logs for when that happens

@jpeltoniemi
Copy link

@Hellowlol sorry, the lines I posted were literally the only ones that mention nordpool (excluding duplicates). I removed the second integration and adjusted my automations to use cents, and haven't seen any issues since then. The heating in my house is partially tied to electricity price, so I'm not too eager to break it again.

It shouldn't be hard to replicate though. These are the exact settings I changed when I set up my 2 integrations:
Region: Finland
Currency: EUR
Decimal rounding: 2
Price in cents: true for one and false for the other.

You should see the integrations fail, i.e. prices not getting updated, in 24 hours.

@havardthom
Copy link
Author

Closing this since I have not experienced it since upgrading to v0.0.13. Will try to provide debug logs next time. Thank you!

@Hellowlol
Copy link
Collaborator

Thank you!

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