I’m running hassio in docker on ubuntu 18.04. I’m using the UniFi Controller addon to manage my AP and that’s working fine (https://xxxxx.duckdns.org:8443). I’m trying to setup the UniFi device tracker and I’m getting nowhere. Here’s the config for it:
device_tracker:
- platform: unifi
host: 192.168.4.3
port: 8443
username: !secret unifi_username
password: !secret unifi_password
track_new_devices: yes
verify_ssl: False
ssid_filter:
- 'SSID1'
- 'SSID2'
And here’s the error I’m getting:
Log Details (ERROR)
Sun Nov 11 2018 22:08:30 GMT-0600 (Central Standard Time)
Error setting up platform unifi
Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/urllib3/connection.py", line 159, in _new_conn
(self._dns_host, self.port), self.timeout, **extra_kw)
File "/usr/local/lib/python3.6/site-packages/urllib3/util/connection.py", line 80, in create_connection
raise err
File "/usr/local/lib/python3.6/site-packages/urllib3/util/connection.py", line 70, in create_connection
sock.connect(sa)
ConnectionRefusedError: [Errno 111] Connection refused
During handling of the above exception, another exception occurred:
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 839, in _validate_conn
conn.connect()
File "/usr/local/lib/python3.6/site-packages/urllib3/connection.py", line 301, in connect
conn = self._new_conn()
File "/usr/local/lib/python3.6/site-packages/urllib3/connection.py", line 168, in _new_conn
self, "Failed to establish a new connection: %s" % e)
urllib3.exceptions.NewConnectionError: <urllib3.connection.VerifiedHTTPSConnection object at 0x7feaa9d57cf8>: Failed to establish a new connection: [Errno 111] Connection refused
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 449, 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.4.3', port=8443): Max retries exceeded with url: /api/login (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x7feaa9d57cf8>: Failed to establish a new connection: [Errno 111] Connection refused',))
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 177, 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 572, in post
return self.request('POST', url, data=data, json=json, **kwargs)
File "/usr/local/lib/python3.6/site-packages/requests/sessions.py", line 524, in request
resp = self.send(prep, **send_kwargs)
File "/usr/local/lib/python3.6/site-packages/requests/sessions.py", line 637, in send
r = adapter.send(request, **kwargs)
File "/usr/local/lib/python3.6/site-packages/requests/adapters.py", line 516, in send
raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPSConnectionPool(host='192.168.4.3', port=8443): Max retries exceeded with url: /api/login (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x7feaa9d57cf8>: Failed to establish a new connection: [Errno 111] Connection refused',))
If I switch to the URL:
device_tracker:
- platform: unifi
host: xxxxx.duckdns.org
port: 8443
username: !secret unifi_username
password: !secret unifi_password
track_new_devices: yes
verify_ssl: False
ssid_filter:
- 'SSID1'
- 'SSID2'
I get this error message:
Log Details (ERROR)
Sun Nov 11 2018 22:13:23 GMT-0600 (Central Standard Time)
Error setting up platform unifi
Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/urllib3/connection.py", line 159, in _new_conn
(self._dns_host, self.port), self.timeout, **extra_kw)
File "/usr/local/lib/python3.6/site-packages/urllib3/util/connection.py", line 80, in create_connection
raise err
File "/usr/local/lib/python3.6/site-packages/urllib3/util/connection.py", line 70, in create_connection
sock.connect(sa)
ConnectionRefusedError: [Errno 111] Connection refused
During handling of the above exception, another exception occurred:
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 839, in _validate_conn
conn.connect()
File "/usr/local/lib/python3.6/site-packages/urllib3/connection.py", line 301, in connect
conn = self._new_conn()
File "/usr/local/lib/python3.6/site-packages/urllib3/connection.py", line 168, in _new_conn
self, "Failed to establish a new connection: %s" % e)
urllib3.exceptions.NewConnectionError: <urllib3.connection.VerifiedHTTPSConnection object at 0x7fd4c0522f60>: Failed to establish a new connection: [Errno 111] Connection refused
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 449, 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='tehan.duckdns.org', port=8443): Max retries exceeded with url: /api/login (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x7fd4c0522f60>: Failed to establish a new connection: [Errno 111] Connection refused',))
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 177, 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 572, in post
return self.request('POST', url, data=data, json=json, **kwargs)
File "/usr/local/lib/python3.6/site-packages/requests/sessions.py", line 524, in request
resp = self.send(prep, **send_kwargs)
File "/usr/local/lib/python3.6/site-packages/requests/sessions.py", line 637, in send
r = adapter.send(request, **kwargs)
File "/usr/local/lib/python3.6/site-packages/requests/adapters.py", line 516, in send
raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPSConnectionPool(host='tehan.duckdns.org', port=8443): Max retries exceeded with url: /api/login (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x7fd4c0522f60>: Failed to establish a new connection: [Errno 111] Connection refused',))
My googlefu is failing and I’ve ran out of ideas here. Any suggestions?