World Air Quality Index - SSL: CERTIFICATE_VERIFY_FAILED

Recently I have enabled the World Air Quality Index component and have noticed many errors/warnings in the log file. The error indicates that it can’t verify a SSL certificate (Not sure which).

An extract of my log:

Traceback (most recent call last):
  File "/usr/lib/python3.4/asyncio/tasks.py", line 233, in _step
    result = coro.throw(exc)
  File "/usr/local/lib/python3.4/dist-packages/homeassistant/helpers/entity_component.py", line 387, in _update_entity_states
    yield from update_coro
  File "/usr/local/lib/python3.4/dist-packages/homeassistant/helpers/entity.py", line 216, in async_update_ha_state
    yield from self.hass.loop.run_in_executor(None, self.update)
  File "/usr/lib/python3.4/asyncio/futures.py", line 388, in __iter__
    yield self  # This tells Task to wait for completion.
  File "/usr/lib/python3.4/asyncio/tasks.py", line 286, in _wakeup
    value = future.result()
  File "/usr/lib/python3.4/asyncio/futures.py", line 277, in result
    raise self._exception
  File "/usr/lib/python3.4/concurrent/futures/thread.py", line 54, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/local/lib/python3.4/dist-packages/homeassistant/components/sensor/waqi.py", line 115, in update
    self.data.update()
  File "/usr/local/lib/python3.4/dist-packages/homeassistant/util/__init__.py", line 296, in wrapper
    result = method(*args, **kwargs)
  File "/usr/local/lib/python3.4/dist-packages/homeassistant/components/sensor/waqi.py", line 132, in update
    self.data = pwaqi.getStationObservation(self._station_id)
  File "/home/pi/.homeassistant/deps/pwaqi/__init__.py", line 44, in getStationObservation
    'user-agent': 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.87 Safari/537.36 OPR/41.0.2353.56',
  File "/usr/local/lib/python3.4/dist-packages/requests/api.py", line 110, in post
    return request('post', url, data=data, json=json, **kwargs)
  File "/usr/local/lib/python3.4/dist-packages/requests/api.py", line 56, in request
    return session.request(method=method, url=url, **kwargs)
  File "/usr/local/lib/python3.4/dist-packages/requests/sessions.py", line 488, in request
    resp = self.send(prep, **send_kwargs)
  File "/usr/local/lib/python3.4/dist-packages/requests/sessions.py", line 609, in send
    r = adapter.send(request, **kwargs)
  File "/usr/local/lib/python3.4/dist-packages/requests/adapters.py", line 497, in send
    raise SSLError(e, request=request)
requests.exceptions.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:600)

Has anyone else seen this or experienced this issue? It seems the data is retrieved, however should be good if this issue could be resolved.

Cheers! Sacha

Yup, their SSL certificate on https://waqi.info has expired. I’ve contacted them already about this.

Ha! Why I didn’t think of that myself :blush: They are using LetsEncrypt so better they create a script to update their certificate (as by default LetsEncrypt SSL certificates are only valid for 90 days).

Contacted them myself as well and received a confirmation email today that the SSL certification was renewed :slight_smile: They explained that for some reason they haven’t received a renewal notification.