WAQI sensor isn't loaded during startup after update to 2023.2.5
The problem
The WAQI sensors doesn't load during startup
What version of Home Assistant Core has the issue?
2023.2.5
What was the last working version of Home Assistant Core?
2023.1.7
What type of installation are you running?
Home Assistant OS
Integration causing the issue
WAQI
Link to integration documentation on our website
https://www.home-assistant.io/integrations/waqi
Diagnostics information
No response
Example YAML snippet
# Air Quality
- platform: waqi
token: xxxxxxxxxxxxxxxxxxxxxx
locations:
- dusseldorf
- krefeld
Anything in the logs that might be useful for us?
nothing
Additional information
No response
Hey there @andrey-git, mind taking a look at this issue as it has been labeled with an integration (waqi) you are listed as a code owner for? Thanks!
Code owner commands
Code owners of waqi can trigger bot actions by commenting:
@home-assistant closeCloses the issue.@home-assistant rename Awesome new titleRenames the issue.@home-assistant reopenReopen the issue.@home-assistant unassign waqiRemoves the current integration label and assignees on the issue, add the integration domain after the command.
(message by CodeOwnersMention)
waqi documentation waqi source (message by IssueLinks)
WAQI sensors are working for me. Looks like you didn't check the logs for errors. Maybe try another restart as there is probably some start up error. Make sure when you file an issue you grab the logs as requested in the template.
I am also having issues getting data from the WAQI integration though I'm not sure if my issue is related. It was working for me up until a couple of days ago and I am also on 2023.2.5. Here's the error from my log. I can open a new issue if necessary.
Logger: homeassistant.components.waqi.sensor
Source: components/waqi/sensor.py:88
Integration: waqi (documentation, issues)
First occurred: 11:27:29 AM (64 occurrences)
Last logged: 2:39:01 PM
Failed to connect to WAQI servers
Traceback (most recent call last):
File "/usr/local/lib/python3.10/site-packages/waqiasync/__init__.py", line 47, in _get
resp = yield from self._session.get(
File "/usr/local/lib/python3.10/site-packages/aiohttp/client.py", line 535, in _request
conn = await self._connector.connect(
File "/usr/local/lib/python3.10/site-packages/aiohttp/connector.py", line 542, in connect
proto = await self._create_connection(req, traces, timeout)
File "/usr/local/lib/python3.10/site-packages/aiohttp/connector.py", line 907, in _create_connection
_, proto = await self._create_direct_connection(req, traces, timeout)
File "/usr/local/lib/python3.10/site-packages/aiohttp/connector.py", line 1175, in _create_direct_connection
transp, proto = await self._wrap_create_connection(
File "/usr/local/lib/python3.10/site-packages/aiohttp/connector.py", line 986, in _wrap_create_connection
return await self._loop.create_connection(*args, **kwargs) # type: ignore[return-value] # noqa
File "/usr/local/lib/python3.10/asyncio/base_events.py", line 1049, in create_connection
sock = await self._connect_sock(
File "/usr/local/lib/python3.10/asyncio/base_events.py", line 960, in _connect_sock
await self.sock_connect(sock, address)
File "/usr/local/lib/python3.10/asyncio/selector_events.py", line 500, in sock_connect
return await fut
asyncio.exceptions.CancelledError
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/waqi/sensor.py", line 88, in async_setup_platform
stations = await client.search(location_name)
File "/usr/local/lib/python3.10/site-packages/waqiasync/__init__.py", line 32, in search
return (yield from self._get(SEARCH_URL, keyword=keyword))
File "/usr/local/lib/python3.10/site-packages/waqiasync/__init__.py", line 46, in _get
with async_timeout.timeout(self._timeout):
File "/usr/local/lib/python3.10/site-packages/async_timeout/__init__.py", line 116, in __exit__
self._do_exit(exc_type)
File "/usr/local/lib/python3.10/site-packages/async_timeout/__init__.py", line 212, in _do_exit
raise asyncio.TimeoutError
asyncio.exceptions.TimeoutError
Ok, I restarted twice now and increased the loglevel for homeassistant before. The error log is the same like @yuejon:
Logger: homeassistant.components.waqi.sensor
Source: components/waqi/sensor.py:88
Integration: waqi (documentation, issues)
First occurred: 07:46:20 (2 occurrences)
Last logged: 07:47:05
Failed to connect to WAQI servers
Traceback (most recent call last):
File "/usr/local/lib/python3.10/site-packages/waqiasync/__init__.py", line 47, in _get
resp = yield from self._session.get(
File "/usr/local/lib/python3.10/site-packages/aiohttp/client.py", line 535, in _request
conn = await self._connector.connect(
File "/usr/local/lib/python3.10/site-packages/aiohttp/connector.py", line 542, in connect
proto = await self._create_connection(req, traces, timeout)
File "/usr/local/lib/python3.10/site-packages/aiohttp/connector.py", line 907, in _create_connection
_, proto = await self._create_direct_connection(req, traces, timeout)
File "/usr/local/lib/python3.10/site-packages/aiohttp/connector.py", line 1175, in _create_direct_connection
transp, proto = await self._wrap_create_connection(
File "/usr/local/lib/python3.10/site-packages/aiohttp/connector.py", line 986, in _wrap_create_connection
return await self._loop.create_connection(*args, **kwargs) # type: ignore[return-value] # noqa
File "/usr/local/lib/python3.10/asyncio/base_events.py", line 1049, in create_connection
sock = await self._connect_sock(
File "/usr/local/lib/python3.10/asyncio/base_events.py", line 960, in _connect_sock
await self.sock_connect(sock, address)
File "/usr/local/lib/python3.10/asyncio/selector_events.py", line 500, in sock_connect
return await fut
asyncio.exceptions.CancelledError
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/waqi/sensor.py", line 88, in async_setup_platform
stations = await client.search(location_name)
File "/usr/local/lib/python3.10/site-packages/waqiasync/__init__.py", line 32, in search
return (yield from self._get(SEARCH_URL, keyword=keyword))
File "/usr/local/lib/python3.10/site-packages/waqiasync/__init__.py", line 46, in _get
with async_timeout.timeout(self._timeout):
File "/usr/local/lib/python3.10/site-packages/async_timeout/__init__.py", line 116, in __exit__
self._do_exit(exc_type)
File "/usr/local/lib/python3.10/site-packages/async_timeout/__init__.py", line 212, in _do_exit
raise asyncio.TimeoutError
asyncio.exceptions.TimeoutError
I had also done multiple restarts which didn't fix the issue for me, but it appears to have resolved itself in the middle of the night about 3 hours ago. I'm now getting data from the integration again.
Seem to work here as well since a view hours.