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

Error message in log file #34

Closed
1 task done
haaino opened this issue Jul 16, 2022 · 6 comments
Closed
1 task done

Error message in log file #34

haaino opened this issue Jul 16, 2022 · 6 comments
Labels
bug Something isn't working

Comments

@haaino
Copy link

haaino commented Jul 16, 2022

Did you read the instructions?

The problem

Hi,

I’m getting the following errors in my log file

—-

This error originated from a custom integration.

Logger: homeassistant
Source: custom_components/knmi/weather.py:104
Integration: KNMI (documentation, issues)
First occurred: 01:06:39 (96 occurrences)
Last logged: 09:01:39

Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 151, in _handle_refresh_interval
await self._async_refresh(log_failures=True, scheduled=True)
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 283, in _async_refresh
self.async_update_listeners()
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 110, in async_update_listeners
update_callback()
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 339, in _handle_coordinator_update
self.async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 532, in async_write_ha_state
self._async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 572, in _async_write_ha_state
attr.update(self.state_attributes or {})
File "/usr/src/homeassistant/homeassistant/components/weather/init.py", line 698, in state_attributes
if self.forecast is not None:
File "/config/custom_components/knmi/weather.py", line 104, in forecast
int(super().get_data(f"d{i}windrgr"))
ValueError: invalid literal for int() with base 10: ''


I do not know if they are related to issue #33 ?

What version of this integration has the issue?

1.1.11

What version of Home Assistant Core has the issue?

2022.7.5

Home Assistant log

2022-07-15 08:56:27 INFO (MainThread) [homeassistant.setup] Setting up knmi
2022-07-15 08:56:27 INFO (MainThread) [homeassistant.setup] Setup of domain knmi took 0.0 seconds
2022-07-15 08:56:33 INFO (MainThread) [homeassistant.components.binary_sensor] Setting up binary_sensor.knmi
2022-07-15 08:56:33 INFO (MainThread) [homeassistant.components.weather] Setting up weather.knmi
2022-07-15 08:58:16 INFO (MainThread) [homeassistant.components.sensor] Setting up sensor.knmi
2022-07-15 08:58:28 INFO (MainThread) [homeassistant.components.automation.weeralarm] Initialized trigger Weeralarm: Weeralarm KNMI
File "/config/custom_components/knmi/weather.py", line 104, in forecast
File "/config/custom_components/knmi/weather.py", line 104, in forecast
File "/config/custom_components/knmi/weather.py", line 104, in forecast
File "/config/custom_components/knmi/weather.py", line 104, in forecast
File "/config/custom_components/knmi/weather.py", line 104, in forecast

Additional information

No response

@haaino haaino added the bug Something isn't working label Jul 16, 2022
@diedvdyk
Copy link

same error here

@golles
Copy link
Owner

golles commented Jul 16, 2022

At this moment the API is returning "d1windrgr": "",.

The current code isn't dealing with this in a correct way, I'll have a fix for that in #31 as well

@haaino
Copy link
Author

haaino commented Jul 16, 2022

Hope this helps. If I reload the module I get this in the log files.

Logger: homeassistant.components.weather
Source: custom_components/knmi/weather.py:104
Integration: Weather (documentation, issues)
First occurred: 14:13:20 (2 occurrences)
Last logged: 14:13:20

Error adding entities for domain weather with platform knmi
Error while setting up knmi platform for weather
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 397, in async_add_entities
await asyncio.gather(*tasks)
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 641, in _async_add_entity
await entity.add_to_platform_finish()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 776, in add_to_platform_finish
self.async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 532, in async_write_ha_state
self._async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 572, in _async_write_ha_state
attr.update(self.state_attributes or {})
File "/usr/src/homeassistant/homeassistant/components/weather/init.py", line 698, in state_attributes
if self.forecast is not None:
File "/config/custom_components/knmi/weather.py", line 104, in forecast
int(super().get_data(f"d{i}windrgr"))
ValueError: invalid literal for int() with base 10: ''

@golles
Copy link
Owner

golles commented Jul 16, 2022

Thanks, this is the exact same error and also due to the same cause; the API is returning an empty string instead of a number. I've fixed that in 80308ec and am now testing PR #31 containing fixes for both issues you reported.
I'll release that, version 1.2.0, later today

@golles golles closed this as completed in 80308ec Jul 16, 2022
@golles
Copy link
Owner

golles commented Jul 16, 2022

Hi @haaino
Version 1.2.0 https://github.com/golles/ha-knmi/releases/tag/1.2.0 has just been released and should fix this issue.
Feel free to reopen if the issue still persists.

Please star this repository if you like this integration, this recognition drives me to work on this and keep on improving it :-)

@haaino
Copy link
Author

haaino commented Jul 16, 2022

Works like a charm

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

No branches or pull requests

3 participants