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

Exception in validate_data when dispatching (186 times) #354

Closed
mm98 opened this issue Sep 4, 2023 · 6 comments · Fixed by #361
Closed

Exception in validate_data when dispatching (186 times) #354

mm98 opened this issue Sep 4, 2023 · 6 comments · Fixed by #361
Assignees
Labels
bug Something isn't working

Comments

@mm98
Copy link

mm98 commented Sep 4, 2023

Describe the issue

I've started seeing lots of daily errors. The tariff's are loaded (correctly) but I get lots of these.

This error originated from a custom integration.

Logger: custom_components.energidataservice.sensor
Source: custom_components/energidataservice/sensor.py:730
Integration: Energi Data Service (documentation, issues)
First occurred: September 3, 2023 at 13:00:01 (186 occurrences)
Last logged: 06:15:27

Error adding tariffs for 2023-09-05 00:00:00+02:00, no valid tariffs was found!
Error adding tariffs for 2023-09-06 00:00:00+02:00, no valid tariffs was found!
2023-09-03 00:20:45.331 WARNING (MainThread) [homeassistant.components.recorder.core] Database currently not locked
2023-09-03 00:43:04.854 WARNING (SyncWorker_7) [custom_components.energidataservice.sensor] Error adding tariffs for 2023-09-05 00:00:00+02:00, no valid tariffs was found!
2023-09-03 00:43:04.891 ERROR (MainThread) [homeassistant.util.logging] Exception in validate_data when dispatching 'eds_update_21b01df0ba9a401fcb6fd8e2888e6cd9': ()
Traceback (most recent call last):
  File "/config/custom_components/energidataservice/sensor.py", line 353, in validate_data
    await self._hass.async_add_executor_job(
  File "/usr/local/lib/python3.11/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/energidataservice/sensor.py", line 730, in _format_list
    price = self._calculate(
            ^^^^^^^^^^^^^^^^
  File "/config/custom_components/energidataservice/sensor.py", line 657, in _calculate
    owner_tariff = float(chargeowner_tariff[str(fake_dt.hour)])
                         ~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^
KeyError: '0'

What version of Home Assistant Core has the issue?

core-2023.8.4

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant OS

Diagnostics information

home-assistant_energidataservice_2023-09-04T04-32-00.223Z.log

Anything in the logs that might be useful for us?

It looks like it IS loading the tariff's, but for some strange reason it keeps trying to load them again (i think). I have a automation, which reloads EDS at 13:00:01.

@mm98 mm98 added the bug Something isn't working label Sep 4, 2023
@jrhansen
Copy link

jrhansen commented Sep 4, 2023

I see the same thing, except the sensor entity no longer updates. I think this started yesterday, as I had to reload the extension to have the sensor update. Apparently, it still does not update automatically.

@mm98
Copy link
Author

mm98 commented Sep 4, 2023

I've noticed something strange. If i Reboot HA the errors stops.

@MTrab
Copy link
Owner

MTrab commented Sep 4, 2023

Not sure when this will be fixed, as I'm in the hospital for a surgery.

@jrhansen
Copy link

jrhansen commented Sep 4, 2023

@mm98: I tried restarting, and I also see no error - and the entity auto-updated just a minute ago. Curious to see, when it will stop working again :-)

@MTrab: Get well soon!

@mm98
Copy link
Author

mm98 commented Sep 4, 2023

Not sure when this will be fixed, as I'm in the hospital for a surgery.

This is absolutely not important right now. No worries. I hope you get well soon!

@mm98
Copy link
Author

mm98 commented Sep 4, 2023

Curious to see, when it will stop working again :-)

By me it is actually working (trafiff's are loaded). The (minor) challenge/problem i see is, that the logs are going crazy for an unknown reason. Tariff's was already loaded at est. 2AM.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants