WAQI (Air Quality) stopped working just before the forest fires!

Hello, there are huge forest fires in Canada, and a lot of smog now, I used WAQI to automate my ventilation and filtering, but now after some updates it’s not working, and it happens at the only time of the year I really need it.

Has anyone had a similar issue, or a quick idea how to make it work again?
Thank you

2023-06-07 09:31:00.138 WARNING (MainThread) [homeassistant.components.sensor] Setup of sensor platform waqi is taking over 10 seconds.
2023-06-07 09:31:00.271 ERROR (MainThread) [homeassistant.components.sensor] waqi: Error on device update!
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 560, in _request
    await resp.start(conn)
  File "/usr/local/lib/python3.10/site-packages/aiohttp/client_reqrep.py", line 899, in start
    message, payload = await protocol.read()  # type: ignore[union-attr]
  File "/usr/local/lib/python3.10/site-packages/aiohttp/streams.py", line 616, in read
    await self._waiter
asyncio.exceptions.CancelledError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 521, in _async_add_entity
    await entity.async_device_update(warning=False)
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 779, in async_device_update
    await self.async_update()
  File "/usr/src/homeassistant/homeassistant/components/waqi/sensor.py", line 186, in async_update
    result = await self._client.get_station_by_number(self.uid)
  File "/usr/local/lib/python3.10/site-packages/waqiasync/__init__.py", line 42, in get_station_by_number
    return (yield from self._get(FEED_NUMBER_URL.format(number)))
  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
2023-06-07 09:31:00.354 ERROR (MainThread) [homeassistant.components.sensor] waqi: Error on device update!
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 536, in _request
    conn = await self._connector.connect(
  File "/usr/local/lib/python3.10/site-packages/aiohttp/connector.py", line 540, in connect
    proto = await self._create_connection(req, traces, timeout)
  File "/usr/local/lib/python3.10/site-packages/aiohttp/connector.py", line 901, in _create_connection
    _, proto = await self._create_direct_connection(req, traces, timeout)
  File "/usr/local/lib/python3.10/site-packages/aiohttp/connector.py", line 1152, in _create_direct_connection
    hosts = await asyncio.shield(host_resolved)
asyncio.exceptions.CancelledError

ValueError: Sensor sensor.waqi_regina_[CITY]_canada has device class aqi, state class measurement unit None and suggested precision None thus indicating it has a numeric value; however, it has the non-numeric value: - (<class 'str'>)
Home Assistant 2023.5.4 
Supervisor 2023.06.1 
Operating System 10.2 
Frontend 20230503.3 - latest 

1 Like

Possibly because it’s not reporting?

This happened to me too in Jersey City. I had to do a HA reboot for it to refresh its value. Not very ideal. The value it was stuck on was from 1 week ago

It is reporting, but I’m seeing Unavailable in Developer Tools
Regina is just an unrelated sensor added by WAQI, not the city I’M monitoring I don’t know why it adds all those cities, I only have 1 location:

https://aqicn.org/city/ottawa/

It looks like there was a fix about 6 hours ago. I’m not sure if the changes will make it to our instances of HA in time though.

1 Like

AirVisual Cloud - Home Assistant may be another option to get something in play if you need it now.

Can confirm, the Home Assistant 2023.6.1 update fixed the issue, so the outage lasted the entirety of week where there were forest fires in my region, bad timing I guess. Thanks for the check.