I am having the same problem with a different error message. I have the Unifi cloud key controller and 3 access points. I can see the mobile devices configured in known_devices.yaml but they are listed as not present although they are. They are shown in the Unifi dashboard.
This is what I have in /config/configuration.yaml
Unifi Presence Detection in Controller
device_tracker:
- platform: unifi
host: 192.168.178.54
port: 8443
username: !secret unifi_username
password: !secret unifi_password
site_id: default
track_new_devices: false
interval_seconds: 120
consider_home: 300
(URL is: https://192.168.178.54:8443/manage/site/default/dashboard; username and password is the same that I use to log into the dashboard)
This is the error message in log:
Log Details (ERROR)
Sat Sep 15 2018 18:26:10 GMT+0200 (CEST)
Error setting up platform unifi
Traceback (most recent call last):
File “/usr/local/lib/python3.6/site-packages/urllib3/connectionpool.py”, line 600, in urlopen
chunked=chunked)
File “/usr/local/lib/python3.6/site-packages/urllib3/connectionpool.py”, line 343, in _make_request
self._validate_conn(conn)
File “/usr/local/lib/python3.6/site-packages/urllib3/connectionpool.py”, line 849, in validate_conn
conn.connect()
File “/usr/local/lib/python3.6/site-packages/urllib3/connection.py”, line 356, in connect
ssl_context=context)
File "/usr/local/lib/python3.6/site-packages/urllib3/util/ssl.py", line 372, in ssl_wrap_socket
return context.wrap_socket(sock)
File “/usr/local/lib/python3.6/ssl.py”, line 407, in wrap_socket
_context=self, _session=session)
File “/usr/local/lib/python3.6/ssl.py”, line 814, in init
self.do_handshake()
File “/usr/local/lib/python3.6/ssl.py”, line 1068, in do_handshake
self._sslobj.do_handshake()
File “/usr/local/lib/python3.6/ssl.py”, line 689, in do_handshake
self._sslobj.do_handshake()
ssl.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:841)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File “/usr/local/lib/python3.6/site-packages/requests/adapters.py”, line 445, in send
timeout=timeout
File “/usr/local/lib/python3.6/site-packages/urllib3/connectionpool.py”, line 638, in urlopen
_stacktrace=sys.exc_info()[2])
File “/usr/local/lib/python3.6/site-packages/urllib3/util/retry.py”, line 398, in increment
raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host=‘192.168.178.54’, port=8443): Max retries exceeded with url: /api/login (Caused by SSLError(SSLError(1, ‘[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:841)’),))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File “/usr/local/lib/python3.6/site-packages/homeassistant/components/device_tracker/init.py”, line 176, in async_setup_platform
platform.get_scanner, hass, {DOMAIN: p_config})
File “/usr/local/lib/python3.6/concurrent/futures/thread.py”, line 56, in run
result = self.fn(*self.args, **self.kwargs)
File “/usr/local/lib/python3.6/site-packages/homeassistant/components/device_tracker/unifi.py”, line 78, in get_scanner
site_id=site_id, ssl_verify=verify_ssl)
File “/usr/local/lib/python3.6/site-packages/pyunifi/controller.py”, line 89, in init
self._login(version)
File “/usr/local/lib/python3.6/site-packages/pyunifi/controller.py”, line 148, in _login
r = self.session.post(login_url, params)
File “/usr/local/lib/python3.6/site-packages/requests/sessions.py”, line 559, in post
return self.request(‘POST’, url, data=data, json=json, **kwargs)
File “/usr/local/lib/python3.6/site-packages/requests/sessions.py”, line 512, in request
resp = self.send(prep, **send_kwargs)
File “/usr/local/lib/python3.6/site-packages/requests/sessions.py”, line 622, in send
r = adapter.send(request, **kwargs)
File “/usr/local/lib/python3.6/site-packages/requests/adapters.py”, line 511, in send
raise SSLError(e, request=request)
requests.exceptions.SSLError: HTTPSConnectionPool(host=‘192.168.178.54’, port=8443): Max retries exceeded with url: /api/login (Caused by SSLError(SSLError(1, ‘[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:841)’),))
Any pointers to what I could be doing wrong? Thanks!