Unifi Integration - Not Connecting

Hi,

I can’t seem to get the integration to connect to the controller.

HA is running on a docker on x.x.1.114:8123
Unifi Controller is on a docker on x.x.1.115:8443

Both sitting on unRAID.

I get the following error in the logs…

Logger: homeassistant.components.unifi
Source: components/unifi/controller.py:506
Integration: Ubiquiti UniFi (documentation, issues)
First occurred: 2 August 2021, 21:27:52 (17 occurrences)
Last logged: 19:15:22

Error connecting to the UniFi controller at https://192.168.1.114: Error requesting data from https://192.168.1.114: Cannot connect to host https:443 ssl:default [Name does not resolve]
Error connecting to the UniFi controller at 192.168.1.115: Error requesting data from 192.168.1.115: Cannot connect to host 192.168.1.115:443 ssl:default [Connect call failed ('192.168.1.115', 443)]
Error connecting to the UniFi controller at 192.168.1.115: Error requesting data from 192.168.1.115: Cannot connect to host 192.168.1.115:8443 ssl:default [Connect call failed ('192.168.1.115', 8443)]
Error connecting to the UniFi controller at https://192.168.1.115:8443: Error requesting data from https://192.168.1.115:8443: Cannot connect to host https:443 ssl:default [Name does not resolve]
Error connecting to the UniFi controller at http://192.168.1.114: Error requesting data from http://192.168.1.114: Cannot connect to host http:443 ssl:default [Name does not resolve]

Can anybody point me in the direction?

Are those logs various attempt, or do you have multiple time the Unifi integration?

  • At least in some of the above, I suspect you entered an URL in the configuration rather than a plain hostname/IP
  • If you’re using IP addresses and SSL, you have to set “SSL Verify” to off

It’s multiple attempts. To different ips. Trying all combos.

SSL verify is set to off.

Should it not just work with 192.168.1.115, username, password, 8443 as the port?

Should. But in the logged attempts you showed, ssl verify seemd on…
AND hostname and ports are 2 different settings, so no 192.168.1.115:8443 as hostname

Ok, here is a clean log…


Logger: homeassistant.components.unifi
Source: components/unifi/controller.py:506 
Integration: Ubiquiti UniFi (documentation, issues) 
First occurred: 20:55:28 (1 occurrences) 
Last logged: 20:55:28

Error connecting to the UniFi controller at 192.168.1.115: Error requesting data from 192.168.1.115: Cannot connect to host 192.168.1.115:8443 ssl:default [Connect call failed ('192.168.1.115', 8443)]

The controller is definitely running on .115:8443

IDK.
Maybe try a nc -zv 192.168.1.115 8443 from the HA shell to see if you have connectivity?

nc: 192.168.1.115 (192.168.1.115:8443): Host is unreachable

So it’s a routing problem between dockers?

HA is using HOST and the Unifi Controller docker is on eth0.

Not sure what you mean by that.
Is it a self-managed container or an HassOS addon?
If it’s self-managed, what’s the command/docker-compose used to launch it.

I am having the same issue, noticed it after update to 2021.08.08. Unifi integration worked before, now just stating

Logger: homeassistant.components.unifi
Source: components/unifi/controller.py:506
Integration: Ubiquiti UniFi (documentation, issues)
First occurred: 19:40:21 (2 occurrences)
Last logged: 19:43:40

Error connecting to the UniFi controller at 10.10.xxx.yyy:

The nc command (HA running on vm on unraid) states … open. Any ideas how to figure out more, what’s wrong?

Same here :frowning:

After migrating my controller from a windows server to docker I too have this issue

Does this integration require HA and the Unifi Network Application to be on the same network? I just can’t get this to work when connecting to a controller that is located on a VM in Oracles Cloud. Unfortunately it’s less than clear what the error is.

2022-02-05 07:56:54 ERROR (MainThread) [homeassistant.components.unifi] Error connecting to the UniFi Network at unifi.storiesfromtheseat.com

Interestingly if I run up a HA server on another server in the same subnet it works just fine.

The nc command shows the port as open.