Hello, what am I missing? My set up is as follows:
Home Assistant core-2021.5.1 installed in a Docker container running on an Ubuntu 20.04 server (I’ve been trying for a couple of months).
Unifi Controller is installed in a Docker container running on a separate Ubuntu 20.04 server.
I have an EdgeRouter X that is my DHCP server that the Unifi Controller sees - I can control the EdgeRouter X from the Unifi Controller.
The issue I have is that I’m trying to add the Ubiquiti Unifi integration to Home Assistant: for the host name, I put in the IP address of the Ubuntu server that has the Unifi Controller running on it. For the username and password, I enter credentials that I’ve created locally on the Unifi Controller. I leave the SSL box unchecked. The message I receive is “invalid authentication.”
What have I tried?
Have used different username and password combinations.
Removed and re-installed docker and Unifi Controller.
Installed Unifi Controller on a different server.
These all give the Invalid authentication error.
I’ve also tried connecting via a different port and using a server that doesn’t have the Unifi Controller installed - these both gave “Failed to connect.”
I cannot see any error messages in any log files relating to authentication, either at Ubuntu OS level or within the Unifi Controller.
So I have found something under Configuration / General / Logs.
Logger: homeassistant.components.unifi
Source: components/unifi/controller.py:493
Integration: Ubiquiti UniFi ([documentation](https://www.home-assistant.io/integrations/unifi), [issues](https://github.com/home-assistant/home-assistant/issues?q=is%3Aissue+is%3Aopen+label%3A%22integration%3A+unifi%22))
First occurred: 8 May 2021, 02:28:36 (6 occurrences)
Last logged: 02:03:47
Unknown UniFi communication error occurred: Call https://192.168.1.241:443/api/login received 404 Not Found
Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/components/unifi/controller.py", line 493, in get_controller await controller.login() File "/usr/local/lib/python3.8/site-packages/aiounifi/controller.py", line 108, in login await self._request("post", url=url, json=auth) File "/usr/local/lib/python3.8/site-packages/aiounifi/controller.py", line 288, in _request raise ResponseError(f"Call {url} received 404 Not Found") aiounifi.errors.ResponseError: Call https://192.168.1.241:443/api/login received 404 Not Found
192.168.1.241 is the server that the Unifi Controller is installed on.
Yes, I have the same - started when either I updated to HomeAssistant 2020.5.0, or UniFiOS 2.1.7 or UniFi Network 6.1.71
Unknown UniFi communication error occurred: Call https://192.168.1.xxx:8443 received 404 Not Found
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/unifi/controller.py", line 492, in get_controller
await controller.check_unifi_os()
File "/usr/local/lib/python3.8/site-packages/aiounifi/controller.py", line 91, in check_unifi_os
response = await self._request("get", url=self.url, allow_redirects=False)
File "/usr/local/lib/python3.8/site-packages/aiounifi/controller.py", line 288, in _request
raise ResponseError(f"Call {url} received 404 Not Found")
aiounifi.errors.ResponseError: Call https://192.168.1.xxx:8443 received 404 Not Found
I didn’t upgrade HA but did upgrade Unifi network to 6.1.71 and my integration is no longer working as well. Also running new 2.1.71 on controller. Tried removing and re-adding it but it just says authentication failed.
Yep, I can confirm that upgrading my unifi controller to 6.2.26 triggered this issue for me also. Looking at my logs, the authentication fails because 2FA is required for my account.
Logger: homeassistant.components.unifi
Source: components/unifi/controller.py:493
Integration: Ubiquiti UniFi (documentation, issues)
First occurred: 4:52:45 PM (1 occurrences)
Last logged: 4:52:45 PM
Unknown UniFi communication error occurred: api.err.Ubic2faTokenRequired
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/unifi/controller.py", line 493, in get_controller
await controller.login()
File "/usr/local/lib/python3.9/site-packages/aiounifi/controller.py", line 108, in login
await self._request("post", url=url, json=auth)
File "/usr/local/lib/python3.9/site-packages/aiounifi/controller.py", line 300, in _request
_raise_on_error(response)
File "/usr/local/lib/python3.9/site-packages/aiounifi/controller.py", line 318, in _raise_on_error
raise_error(data["meta"]["msg"])
File "/usr/local/lib/python3.9/site-packages/aiounifi/errors.py", line 57, in raise_error
raise cls("{}".format(type))
aiounifi.errors.TwoFaTokenRequired: api.err.Ubic2faTokenRequired
Disabling 2FA (here) allowed my integration to work again. I hope 2FA support can be added soon!
Im seeing this error as well. It was 2FA causing my issue. My IP address changed, so I had to change the IP exclusion in my SWAG docket by adding the new IP address to the internal.conf file.
Emails? Pending? I’m not sure what you’re talking about there, but I’m guessing you created a cloud user instead of a local user. You need to use a LOCAL user account.